diff --git a/README.md b/README.md index 96f3828..257f5fc 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,21 @@ If you are using part of or all the code from this repository in your own projec 如果您正在使用此项目的部分或全部代码,这是我的荣幸,我很高兴能帮到您,但我同时也希望,您能将您项目的首页或仓库的网址告诉我(闭源或收费都没关系),我将在这个自述文件中链接到您所提供的网址,以供展示。如果您能一并提供一些软件运行时的截图,那就更好了。 -## Screenshots +## Screenshots - Win32 + +![Win32Demo 1](/screenshots/win32demo1.png) + +![Win32Demo 2](/screenshots/win32demo2.png) + +![Win32Demo 3](/screenshots/win32demo3.png) + +![Win32Demo 4](/screenshots/win32demo4.png) + +![Win32Demo 5](/screenshots/win32demo5.png) + +![Win32Demo 6](/screenshots/win32demo6.png) + +## Screenshots - Cross platform ![zhihuiyanglao](/screenshots/zhihuiyanglao.png) diff --git a/README_win32.md b/README_win32.md index 1dca3e6..5762100 100644 --- a/README_win32.md +++ b/README_win32.md @@ -2,15 +2,17 @@ ## Screenshots -![zhihuiyanglao](/screenshots/zhihuiyanglao.png) +![Win32Demo 1](/screenshots/win32demo1.png) -![QQ Player](/screenshots/qqplayer.png) +![Win32Demo 2](/screenshots/win32demo2.png) -![Qt Widgets example](/screenshots/widgets.png) +![Win32Demo 3](/screenshots/win32demo3.png) -![Qt MainWindow example](/screenshots/mainwindow.png) +![Win32Demo 4](/screenshots/win32demo4.png) -![Qt Quick example](/screenshots/quick.png) +![Win32Demo 5](/screenshots/win32demo5.png) + +![Win32Demo 6](/screenshots/win32demo6.png) ## Features diff --git a/examples/Win32Demo/widget.cpp b/examples/Win32Demo/widget.cpp index b02ffbd..f2ea481 100644 --- a/examples/Win32Demo/widget.cpp +++ b/examples/Win32Demo/widget.cpp @@ -155,6 +155,8 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) ui->forceAcrylicCB->setEnabled(m_bIsWin101803OrGreater); if (shouldDrawBorder()) { layout()->setContentsMargins(1, 1, 1, 1); + } else { + layout()->setContentsMargins(0, 0, 0, 0); } updateTitleBar(); @@ -213,7 +215,7 @@ Widget::Widget(QWidget *parent) : QWidget(parent), ui(new Ui::Widget) }); connect(ui->blurEffectCB, &QCheckBox::stateChanged, this, [this](int state) { const bool enable = state == Qt::Checked; - QColor color = Qt::white; + QColor color = {0, 0, 0, 127}; if (m_bIsWin101803OrGreater && ui->forceAcrylicCB->isChecked()) { if (enable && m_bShowColorDialog) { color = QColorDialog::getColor(color, @@ -280,6 +282,11 @@ bool Widget::shouldDrawThemedBorder(const bool ignoreWindowState) const return (shouldDrawBorder(ignoreWindowState) && isThemeColorEnabled()); } +bool Widget::shouldDrawThemedTitleBar() const +{ + return m_bIsWin10OrGreater && isThemeColorEnabled(); +} + QColor Widget::activeBorderColor() const { return isThemeColorEnabled() ? m_cThemeColor : m_cDefaultActiveBorderColor; @@ -387,7 +394,7 @@ void Widget::paintEvent(QPaintEvent *event) void Widget::updateTitleBar() { - const bool themedTitleBar = shouldDrawThemedBorder(true) && isActiveWindow(); + const bool themedTitleBar = shouldDrawThemedTitleBar() && isActiveWindow(); if (themedTitleBar && !m_bExtendToTitleBar) { ui->minimizeButton->setIcon(QIcon(QLatin1String(":/images/button_minimize_white.svg"))); ui->closeButton->setIcon(QIcon(QLatin1String(":/images/button_close_white.svg"))); @@ -446,7 +453,7 @@ void Widget::updateTitleBar() void Widget::initWindow() { if (m_bIsWin10OrGreater) { - ui->preserveWindowFrameCB->click(); + //ui->preserveWindowFrameCB->click(); if (m_bIsWin101803OrGreater) { ui->forceAcrylicCB->click(); } diff --git a/examples/Win32Demo/widget.h b/examples/Win32Demo/widget.h index 9eec8d1..a73334f 100644 --- a/examples/Win32Demo/widget.h +++ b/examples/Win32Demo/widget.h @@ -55,6 +55,7 @@ public: bool shouldDrawBorder(const bool ignoreWindowState = false) const; bool shouldDrawThemedBorder(const bool ignoreWindowState = false) const; + bool shouldDrawThemedTitleBar() const; QColor activeBorderColor() const; QColor inactiveBorderColor() const; diff --git a/screenshots/win32demo1.png b/screenshots/win32demo1.png new file mode 100644 index 0000000..3e81fa5 Binary files /dev/null and b/screenshots/win32demo1.png differ diff --git a/screenshots/win32demo2.png b/screenshots/win32demo2.png new file mode 100644 index 0000000..1478daf Binary files /dev/null and b/screenshots/win32demo2.png differ diff --git a/screenshots/win32demo3.png b/screenshots/win32demo3.png new file mode 100644 index 0000000..284f80c Binary files /dev/null and b/screenshots/win32demo3.png differ diff --git a/screenshots/win32demo4.png b/screenshots/win32demo4.png new file mode 100644 index 0000000..18e72f7 Binary files /dev/null and b/screenshots/win32demo4.png differ diff --git a/screenshots/win32demo5.png b/screenshots/win32demo5.png new file mode 100644 index 0000000..c649d91 Binary files /dev/null and b/screenshots/win32demo5.png differ diff --git a/screenshots/win32demo6.png b/screenshots/win32demo6.png new file mode 100644 index 0000000..e11ab13 Binary files /dev/null and b/screenshots/win32demo6.png differ