forked from github_mirror/framelesshelper
Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
parent
5f77fe6fad
commit
0b3972643d
|
@ -32,7 +32,6 @@ int main(int argc, char *argv[]) {
|
|||
QWidget widget;
|
||||
widget.setContentsMargins(0, 0, 0, 0);
|
||||
QLabel *label = new QLabel;
|
||||
label->setText(QObject::tr("Hello, World!"));
|
||||
QObject::connect(&widget, &QWidget::windowTitleChanged, label,
|
||||
&QLabel::setText);
|
||||
QPushButton *minimizeButton = new QPushButton;
|
||||
|
@ -70,6 +69,7 @@ int main(int argc, char *argv[]) {
|
|||
mainLayout->addLayout(tbLayout);
|
||||
mainLayout->addStretch();
|
||||
widget.setLayout(mainLayout);
|
||||
widget.setWindowTitle(QObject::tr("Hello, World!"));
|
||||
helper.setIgnoreObjects(&widget,
|
||||
{minimizeButton, maximizeButton, closeButton});
|
||||
helper.removeWindowFrame(&widget);
|
||||
|
|
|
@ -43,7 +43,6 @@ int main(int argc, char *argv[]) {
|
|||
QWidget widget;
|
||||
widget.setContentsMargins(0, 0, 0, 0);
|
||||
QLabel *label = new QLabel;
|
||||
label->setText(QObject::tr("Hello, World!"));
|
||||
QObject::connect(&widget, &QWidget::windowTitleChanged, label,
|
||||
&QLabel::setText);
|
||||
QPushButton *minimizeButton = new QPushButton;
|
||||
|
@ -81,6 +80,7 @@ int main(int argc, char *argv[]) {
|
|||
mainLayout->addLayout(tbLayout);
|
||||
mainLayout->addStretch();
|
||||
widget.setLayout(mainLayout);
|
||||
widget.setWindowTitle(QObject::tr("Hello, World!"));
|
||||
const auto hWnd_widget = reinterpret_cast<HWND>(widget.winId());
|
||||
WinNativeEventFilter::addFramelessWindow(hWnd_widget);
|
||||
const auto data_widget = WinNativeEventFilter::windowData(hWnd_widget);
|
||||
|
|
|
@ -11,12 +11,11 @@ Window {
|
|||
|
||||
FramelessHelper {
|
||||
id: framelessHelper
|
||||
Component.onCompleted: framelessHelper.removeWindowFrame()
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: titleBar
|
||||
height: 30
|
||||
height: framelessHelper.titleBarHeight
|
||||
color: "white"
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
|
@ -75,4 +74,6 @@ Window {
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
}
|
||||
|
||||
Component.onCompleted: framelessHelper.removeWindowFrame()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue