├── include
└── FramelessHelper
│ ├── Core
│ ├── Utils
│ ├── ChromePalette
│ ├── MicaMaterial
│ ├── FramelessHelper_Qt
│ ├── FramelessManager
│ ├── Global
│ ├── FramelessHelper_Win
│ ├── WindowBorderPainter
│ ├── FramelessHelper_Linux
│ ├── FramelessHelper_Windows
│ ├── framelesshelper_qt.h
│ ├── framelesshelper_win.h
│ ├── private
│ │ ├── framelessconfig_p.h
│ │ ├── winverhelper_p.h
│ │ ├── windowborderpainter_p.h
│ │ ├── micamaterial_p.h
│ │ ├── framelessmanager_p.h
│ │ ├── scopeguard_p.h
│ │ ├── chromepalette_p.h
│ │ ├── registrykey_p.h
│ │ └── sysapiloader_p.h
│ ├── framelessmanager.h
│ ├── micamaterial.h
│ └── windowborderpainter.h
│ ├── Quick
│ ├── Global
│ ├── QuickMicaMaterial
│ ├── QuickWindowBorder
│ ├── FramelessQuickHelper
│ ├── FramelessQuickModule
│ ├── FramelessQuickUtils
│ ├── QuickChromePalette
│ ├── framelessquickmodule.h
│ ├── quickchromepalette.h
│ ├── private
│ │ ├── quickwindowborder_p.h
│ │ ├── quickmicamaterial_p.h
│ │ ├── framelessquickwindow_p_p.h
│ │ ├── framelessquickapplicationwindow_p_p.h
│ │ ├── quickimageitem_p.h
│ │ ├── framelessquickwindow_p.h
│ │ ├── framelessquickapplicationwindow_p.h
│ │ └── framelessquickhelper_p.h
│ ├── quickmicamaterial.h
│ └── quickwindowborder.h
│ └── Widgets
│ ├── FramelessDialog
│ ├── FramelessWidget
│ ├── StandardTitleBar
│ ├── FramelessMainWindow
│ ├── Global
│ ├── StandardSystemButton
│ ├── FramelessWidgetsHelper
│ ├── framelessdialog.h
│ ├── framelesshelperwidgets_global.h
│ ├── private
│ ├── framelessdialog_p.h
│ ├── framelesswidget_p.h
│ ├── framelessmainwindow_p.h
│ ├── standardsystembutton_p.h
│ ├── widgetssharedhelper_p.h
│ ├── standardtitlebar_p.h
│ └── framelesswidgetshelper_p.h
│ ├── framelesswidget.h
│ └── framelessmainwindow.h
├── src
├── core
│ ├── utils.h
│ ├── micamaterial.h
│ ├── chromepalette.h
│ ├── framelessmanager.h
│ ├── registrykey_p.h
│ ├── scopeguard_p.h
│ ├── chromepalette_p.h
│ ├── framelesshelper_qt.h
│ ├── framelesshelper_win.h
│ ├── micamaterial_p.h
│ ├── sysapiloader_p.h
│ ├── versionnumber_p.h
│ ├── windowborderpainter.h
│ ├── winverhelper_p.h
│ ├── framelessconfig_p.h
│ ├── framelesshelper_linux.h
│ ├── framelessmanager_p.h
│ ├── framelesshelper_windows.h
│ ├── framelesshelpercore_global.h
│ ├── windowborderpainter_p.h
│ ├── framelesshelpercore_global_p.h
│ ├── resources
│ │ ├── images
│ │ │ └── noise.png
│ │ └── fonts
│ │ │ └── iconfont.ttf
│ └── framelesshelpercore.qrc
├── quick
│ ├── quickimageitem.h
│ ├── quickchromepalette.h
│ ├── quickmicamaterial.h
│ ├── quickwindowborder.h
│ ├── framelessquickhelper.h
│ ├── framelessquickmodule.h
│ ├── framelessquickutils.h
│ ├── quickimageitem_p.h
│ ├── quickmicamaterial_p.h
│ ├── quickwindowborder_p.h
│ ├── framelessquickhelper_p.h
│ ├── framelessquickwindow_p.h
│ ├── framelesshelperquick_global.h
│ ├── framelessquickwindow_p_p.h
│ ├── quickstandardtitlebar_p.h
│ ├── quickstandardsystembutton_p.h
│ ├── framelessquickapplicationwindow_p.h
│ ├── framelessquickapplicationwindow_p_p.h
│ └── quickchromepalette.cpp
├── widgets
│ ├── framelessdialog.h
│ ├── framelesswidget.h
│ ├── standardtitlebar.h
│ ├── framelessmainwindow.h
│ ├── framelessdialog_p.h
│ ├── framelesswidget_p.h
│ ├── standardsystembutton.h
│ ├── framelesswidgetshelper.h
│ ├── standardtitlebar_p.h
│ ├── framelessmainwindow_p.h
│ ├── standardsystembutton_p.h
│ ├── widgetssharedhelper_p.h
│ ├── framelesshelperwidgets_global.h
│ ├── framelesswidgetshelper_p.h
│ ├── framelesshelperwidgets_global.cpp
│ ├── framelessdialog.cpp
│ └── framelesswidget.cpp
└── CMakeLists.txt
├── .gitmodules
├── doc
├── mac_dark.png
├── mac_light.png
├── win_dark.png
├── win_light.png
├── QVogenClient.png
├── linux_dark.png
└── linux_light.png
├── examples
├── shared
│ ├── example.ico
│ ├── log.h
│ ├── settings.h
│ ├── settings.cpp
│ └── log.cpp
├── openglwidget
│ ├── images.qrc
│ ├── images
│ │ └── qtlogo.png
│ ├── mainwindow.h
│ └── logo.h
├── quick
│ ├── images
│ │ ├── microsoft.png
│ │ └── microsoft.svg
│ ├── resources.qrc
│ ├── quick.pro
│ ├── scripts
│ │ ├── d3d11.bat
│ │ ├── d3d12.bat
│ │ ├── opengl.bat
│ │ └── vulkan.bat
│ ├── qml
│ │ └── HomePage.qml
│ ├── quicksettings.h
│ └── quicksettings.cpp
├── widget
│ ├── widget.pro
│ ├── widget.h
│ ├── main.cpp
│ └── CMakeLists.txt
├── dialog
│ ├── dialog.h
│ ├── main.cpp
│ └── CMakeLists.txt
├── CMakeLists.txt
└── mainwindow
│ ├── mainwindow.h
│ └── main.cpp
├── LICENSE
├── .gitignore
├── msbuild
└── FramelessHelper.props
├── qmake
├── widgets.pri
├── inc
│ └── core
│ │ ├── framelesshelper.config
│ │ └── framelesshelper.version
├── quick.pri
└── core.pri
├── .github
└── workflows
│ └── ci.yml
└── FramelessHelperConfig.cmake.in
/include/FramelessHelper/Core/Utils:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/ChromePalette:
--------------------------------------------------------------------------------
1 | #include "chromepalette.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/MicaMaterial:
--------------------------------------------------------------------------------
1 | #include "micamaterial.h"
2 |
--------------------------------------------------------------------------------
/src/core/utils.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/utils.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/FramelessHelper_Qt:
--------------------------------------------------------------------------------
1 | #include "framelesshelper_qt.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/FramelessManager:
--------------------------------------------------------------------------------
1 | #include "framelessmanager.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/Global:
--------------------------------------------------------------------------------
1 | #include "framelesshelpercore_global.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/Global:
--------------------------------------------------------------------------------
1 | #include "framelesshelperquick_global.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/QuickMicaMaterial:
--------------------------------------------------------------------------------
1 | #include "quickmicamaterial.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/QuickWindowBorder:
--------------------------------------------------------------------------------
1 | #include "quickwindowborder.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/FramelessDialog:
--------------------------------------------------------------------------------
1 | #include "framelessdialog.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/FramelessWidget:
--------------------------------------------------------------------------------
1 | #include "framelesswidget.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/StandardTitleBar:
--------------------------------------------------------------------------------
1 | #include "standardtitlebar.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/FramelessHelper_Win:
--------------------------------------------------------------------------------
1 | #include "framelesshelper_win.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/WindowBorderPainter:
--------------------------------------------------------------------------------
1 | #include "windowborderpainter.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/FramelessQuickHelper:
--------------------------------------------------------------------------------
1 | #include "framelessquickhelper.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/FramelessQuickModule:
--------------------------------------------------------------------------------
1 | #include "framelessquickmodule.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/FramelessQuickUtils:
--------------------------------------------------------------------------------
1 | #include "framelessquickutils.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/QuickChromePalette:
--------------------------------------------------------------------------------
1 | #include "quickchromepalette.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/FramelessMainWindow:
--------------------------------------------------------------------------------
1 | #include "framelessmainwindow.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/Global:
--------------------------------------------------------------------------------
1 | #include "framelesshelperwidgets_global.h"
2 |
--------------------------------------------------------------------------------
/src/core/micamaterial.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/micamaterial.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/FramelessHelper_Linux:
--------------------------------------------------------------------------------
1 | #include "framelesshelper_linux.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/FramelessHelper_Windows:
--------------------------------------------------------------------------------
1 | #include "framelesshelper_windows.h"
2 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/StandardSystemButton:
--------------------------------------------------------------------------------
1 | #include "standardsystembutton.h"
2 |
--------------------------------------------------------------------------------
/src/core/chromepalette.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/chromepalette.h"
2 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "cmake"]
2 | path = cmake
3 | url = ../../wangwenx190/cmake-utils.git
4 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/FramelessWidgetsHelper:
--------------------------------------------------------------------------------
1 | #include "framelesswidgetshelper.h"
2 |
--------------------------------------------------------------------------------
/src/core/framelessmanager.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/framelessmanager.h"
2 |
--------------------------------------------------------------------------------
/src/core/registrykey_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/registrykey_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/scopeguard_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/scopeguard_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickimageitem.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/quickimageitem.h"
2 |
--------------------------------------------------------------------------------
/src/core/chromepalette_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/chromepalette_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/framelesshelper_qt.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/framelesshelper_qt.h"
2 |
--------------------------------------------------------------------------------
/src/core/framelesshelper_win.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/framelesshelper_win.h"
2 |
--------------------------------------------------------------------------------
/src/core/micamaterial_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/micamaterial_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/sysapiloader_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/sysapiloader_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/versionnumber_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/versionnumber_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/windowborderpainter.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/windowborderpainter.h"
2 |
--------------------------------------------------------------------------------
/src/core/winverhelper_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/winverhelper_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickchromepalette.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/quickchromepalette.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickmicamaterial.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/quickmicamaterial.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickwindowborder.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/quickwindowborder.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelessdialog.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/framelessdialog.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelesswidget.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/framelesswidget.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/standardtitlebar.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/standardtitlebar.h"
2 |
--------------------------------------------------------------------------------
/src/core/framelessconfig_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/framelessconfig_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/framelesshelper_linux.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/framelesshelper_linux.h"
2 |
--------------------------------------------------------------------------------
/src/core/framelessmanager_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/framelessmanager_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/framelessquickhelper.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/framelessquickhelper.h"
2 |
--------------------------------------------------------------------------------
/src/quick/framelessquickmodule.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/framelessquickmodule.h"
2 |
--------------------------------------------------------------------------------
/src/quick/framelessquickutils.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/framelessquickutils.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickimageitem_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/quickimageitem_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelessmainwindow.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/framelessmainwindow.h"
2 |
--------------------------------------------------------------------------------
/doc/mac_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/doc/mac_dark.png
--------------------------------------------------------------------------------
/doc/mac_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/doc/mac_light.png
--------------------------------------------------------------------------------
/doc/win_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/doc/win_dark.png
--------------------------------------------------------------------------------
/doc/win_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/doc/win_light.png
--------------------------------------------------------------------------------
/src/core/framelesshelper_windows.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/framelesshelper_windows.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickmicamaterial_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/quickmicamaterial_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickwindowborder_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/quickwindowborder_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelessdialog_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/private/framelessdialog_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelesswidget_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/private/framelesswidget_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/standardsystembutton.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/standardsystembutton.h"
2 |
--------------------------------------------------------------------------------
/doc/QVogenClient.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/doc/QVogenClient.png
--------------------------------------------------------------------------------
/doc/linux_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/doc/linux_dark.png
--------------------------------------------------------------------------------
/doc/linux_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/doc/linux_light.png
--------------------------------------------------------------------------------
/src/core/framelesshelpercore_global.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/framelesshelpercore_global.h"
2 |
--------------------------------------------------------------------------------
/src/core/windowborderpainter_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/windowborderpainter_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/framelessquickhelper_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/framelessquickhelper_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/framelessquickwindow_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/framelessquickwindow_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelesswidgetshelper.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/framelesswidgetshelper.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/standardtitlebar_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/private/standardtitlebar_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/framelesshelperquick_global.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/framelesshelperquick_global.h"
2 |
--------------------------------------------------------------------------------
/src/quick/framelessquickwindow_p_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/framelessquickwindow_p_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickstandardtitlebar_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/quickstandardtitlebar_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelessmainwindow_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/private/framelessmainwindow_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/standardsystembutton_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/private/standardsystembutton_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/widgetssharedhelper_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/private/widgetssharedhelper_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/framelesshelpercore_global_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Core/private/framelesshelpercore_global_p.h"
2 |
--------------------------------------------------------------------------------
/src/quick/quickstandardsystembutton_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/quickstandardsystembutton_p.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelesshelperwidgets_global.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/framelesshelperwidgets_global.h"
2 |
--------------------------------------------------------------------------------
/src/widgets/framelesswidgetshelper_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Widgets/private/framelesswidgetshelper_p.h"
2 |
--------------------------------------------------------------------------------
/examples/shared/example.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/examples/shared/example.ico
--------------------------------------------------------------------------------
/src/quick/framelessquickapplicationwindow_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/framelessquickapplicationwindow_p.h"
2 |
--------------------------------------------------------------------------------
/examples/openglwidget/images.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | images/qtlogo.png
4 |
5 |
6 |
--------------------------------------------------------------------------------
/examples/quick/images/microsoft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/examples/quick/images/microsoft.png
--------------------------------------------------------------------------------
/src/core/resources/images/noise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/src/core/resources/images/noise.png
--------------------------------------------------------------------------------
/src/quick/framelessquickapplicationwindow_p_p.h:
--------------------------------------------------------------------------------
1 | #include "../../include/FramelessHelper/Quick/private/framelessquickapplicationwindow_p_p.h"
2 |
--------------------------------------------------------------------------------
/src/core/resources/fonts/iconfont.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/src/core/resources/fonts/iconfont.ttf
--------------------------------------------------------------------------------
/examples/openglwidget/images/qtlogo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Qt-Widgets/framelesshelper-framelesswindow/HEAD/examples/openglwidget/images/qtlogo.png
--------------------------------------------------------------------------------
/src/core/framelesshelpercore.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | resources/fonts/iconfont.ttf
4 | resources/images/noise.png
5 |
6 |
7 |
--------------------------------------------------------------------------------
/examples/quick/resources.qrc:
--------------------------------------------------------------------------------
1 |
2 |
3 | images/microsoft.svg
4 | qml/Window.qml
5 | qml/ApplicationWindow.qml
6 | qml/HomePage.qml
7 |
8 |
9 |
--------------------------------------------------------------------------------
/examples/widget/widget.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = app
2 | TARGET = FramelessHelperDemo-Widget
3 | QT += widgets
4 | HEADERS += \
5 | ../shared/log.h \
6 | ../shared/settings.h \
7 | widget.h
8 | SOURCES += \
9 | ../shared/log.cpp \
10 | ../shared/settings.cpp \
11 | widget.cpp \
12 | main.cpp
13 | include(../../qmake/core.pri)
14 | include(../../qmake/widgets.pri)
15 |
--------------------------------------------------------------------------------
/examples/quick/quick.pro:
--------------------------------------------------------------------------------
1 | TEMPLATE = app
2 | TARGET = FramelessHelperDemo-Quick
3 | QT += qml quick quickcontrols2
4 | DEFINES += QUICK_USE_QMAKE
5 | HEADERS += \
6 | ../shared/log.h \
7 | ../shared/settings.h \
8 | quicksettings.h
9 | SOURCES += \
10 | ../shared/log.cpp \
11 | ../shared/settings.cpp \
12 | quicksettings.cpp \
13 | main.cpp
14 | RESOURCES += resources.qrc
15 | include(../../qmake/core.pri)
16 | include(../../qmake/quick.pri)
17 |
--------------------------------------------------------------------------------
/examples/quick/images/microsoft.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # C++ objects and libs
2 | *.slo
3 | *.lo
4 | *.o
5 | *.a
6 | *.la
7 | *.lai
8 | *.so
9 | *.so.*
10 | *.dll
11 | *.dylib
12 |
13 | # Qt-es
14 | object_script.*.Release
15 | object_script.*.Debug
16 | *_plugin_import.cpp
17 | /.qmake.cache
18 | /.qmake.stash
19 | *.pro.user
20 | *.pro.user.*
21 | *.qbs.user
22 | *.qbs.user.*
23 | *.moc
24 | moc_*.cpp
25 | moc_*.h
26 | qrc_*.cpp
27 | ui_*.h
28 | *.qmlc
29 | *.jsc
30 | Makefile*
31 | *build-*
32 | *.qm
33 | *.prl
34 |
35 | # Qt unit tests
36 | target_wrapper.*
37 |
38 | # QtCreator
39 | *.autosave
40 |
41 | # QtCreator Qml
42 | *.qmlproject.user
43 | *.qmlproject.user.*
44 |
45 | # QtCreator CMake
46 | CMakeLists.txt.user*
47 |
48 | # QtCreator 4.8< compilation database
49 | compile_commands.json
50 |
51 | # QtCreator local machine specific files for imported projects
52 | *creator.user*
53 |
54 | # My
55 | [Bb]in/
56 | [Bb]in64/
57 | [Ll]ib/
58 | [Ll]ib64/
59 | [Bb]uild*/
60 | *.7z
61 | *.zip
62 | *.rar
63 | *.tar
64 | *.gz
65 | *.xz
66 | *.exe
67 | *.lib
68 | *.pdb
69 | *.ilk
70 | *.exp
71 | *.obj
72 | build.user.bat
73 | build.user.sh
74 | user.conf
75 | [Dd]oc/
76 | [Dd]ocs/
77 | Thumbs.db
78 | *.rc
79 | *.bin
80 | *.run
81 | .qmake.conf
82 | *.res
83 | .DS_Store
84 | .vscode/
85 | .vs/
86 | .cmake.conf
87 |
--------------------------------------------------------------------------------
/examples/quick/scripts/d3d11.bat:
--------------------------------------------------------------------------------
1 | :: MIT License
2 | ::
3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
4 | ::
5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy
6 | :: of this software and associated documentation files (the "Software"), to deal
7 | :: in the Software without restriction, including without limitation the rights
8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | :: copies of the Software, and to permit persons to whom the Software is
10 | :: furnished to do so, subject to the following conditions:
11 | ::
12 | :: The above copyright notice and this permission notice shall be included in
13 | :: all copies or substantial portions of the Software.
14 | ::
15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | :: SOFTWARE.
22 |
23 | @echo off
24 | setlocal
25 | set QSG_RHI_BACKEND=d3d11
26 | "%~dp0FramelessHelperDemo-Quick.exe"
27 | endlocal
28 | exit /b 0
29 |
--------------------------------------------------------------------------------
/examples/quick/scripts/d3d12.bat:
--------------------------------------------------------------------------------
1 | :: MIT License
2 | ::
3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
4 | ::
5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy
6 | :: of this software and associated documentation files (the "Software"), to deal
7 | :: in the Software without restriction, including without limitation the rights
8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | :: copies of the Software, and to permit persons to whom the Software is
10 | :: furnished to do so, subject to the following conditions:
11 | ::
12 | :: The above copyright notice and this permission notice shall be included in
13 | :: all copies or substantial portions of the Software.
14 | ::
15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | :: SOFTWARE.
22 |
23 | @echo off
24 | setlocal
25 | set QSG_RHI_BACKEND=d3d12
26 | "%~dp0FramelessHelperDemo-Quick.exe"
27 | endlocal
28 | exit /b 0
29 |
--------------------------------------------------------------------------------
/examples/quick/scripts/opengl.bat:
--------------------------------------------------------------------------------
1 | :: MIT License
2 | ::
3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
4 | ::
5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy
6 | :: of this software and associated documentation files (the "Software"), to deal
7 | :: in the Software without restriction, including without limitation the rights
8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | :: copies of the Software, and to permit persons to whom the Software is
10 | :: furnished to do so, subject to the following conditions:
11 | ::
12 | :: The above copyright notice and this permission notice shall be included in
13 | :: all copies or substantial portions of the Software.
14 | ::
15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | :: SOFTWARE.
22 |
23 | @echo off
24 | setlocal
25 | set QSG_RHI_BACKEND=opengl
26 | "%~dp0FramelessHelperDemo-Quick.exe"
27 | endlocal
28 | exit /b 0
29 |
--------------------------------------------------------------------------------
/examples/quick/scripts/vulkan.bat:
--------------------------------------------------------------------------------
1 | :: MIT License
2 | ::
3 | :: Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
4 | ::
5 | :: Permission is hereby granted, free of charge, to any person obtaining a copy
6 | :: of this software and associated documentation files (the "Software"), to deal
7 | :: in the Software without restriction, including without limitation the rights
8 | :: to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | :: copies of the Software, and to permit persons to whom the Software is
10 | :: furnished to do so, subject to the following conditions:
11 | ::
12 | :: The above copyright notice and this permission notice shall be included in
13 | :: all copies or substantial portions of the Software.
14 | ::
15 | :: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | :: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | :: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | :: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | :: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | :: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | :: SOFTWARE.
22 |
23 | @echo off
24 | setlocal
25 | set QSG_RHI_BACKEND=vulkan
26 | "%~dp0FramelessHelperDemo-Quick.exe"
27 | endlocal
28 | exit /b 0
29 |
--------------------------------------------------------------------------------
/examples/shared/log.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | namespace Log
30 | {
31 | void setup(const QString &app);
32 | } // namespace Log
33 |
--------------------------------------------------------------------------------
/examples/quick/qml/HomePage.qml:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | import QtQml
26 |
27 | QtObject {
28 | property Window window: Window{}
29 | property ApplicationWindow applicationWindow: ApplicationWindow{}
30 |
31 | Component.onCompleted: {
32 | window.show();
33 | applicationWindow.show();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/msbuild/FramelessHelper.props:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | $(MSBuildThisFileDirectory)lib;$(MSBuildThisFileDirectory)lib\debug;$(MSBuildThisFileDirectory)lib\release;$(LibraryPath)
5 |
6 |
7 | $(MSBuildThisFileDirectory)include;$(MSBuildThisFileDirectory)include\FramelessHelper;$(MSBuildThisFileDirectory)include\FramelessHelper\Core;$(MSBuildThisFileDirectory)include\FramelessHelper\Core\private;$(MSBuildThisFileDirectory)include\FramelessHelper\Widgets;$(MSBuildThisFileDirectory)include\FramelessHelper\Widgets\private;$(MSBuildThisFileDirectory)include\FramelessHelper\Quick;$(MSBuildThisFileDirectory)include\FramelessHelper\Quick\private;$(QtHeaderSearchPath)
8 |
9 |
10 |
11 | %(PreprocessorDefinitions)
12 |
13 |
14 | FramelessHelperCore64d.lib;FramelessHelperWidgets64d.lib;FramelessHelperQuick64d.lib;%(AdditionalDependencies);
15 | FramelessHelperCore64.lib;FramelessHelperWidgets64.lib;FramelessHelperQuick64.lib;%(AdditionalDependencies);
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/examples/shared/settings.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | namespace Settings
30 | {
31 | template
32 | void set(const QString &id, const QString &key, const T &data);
33 |
34 | template
35 | [[nodiscard]] T get(const QString &id, const QString &key);
36 | } // namespace Settings
37 |
--------------------------------------------------------------------------------
/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #[[
2 | MIT License
3 |
4 | Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | ]]
24 |
25 | if(TARGET Qt${QT_VERSION_MAJOR}::Core AND TARGET Qt${QT_VERSION_MAJOR}::Gui)
26 | add_subdirectory(core)
27 | endif()
28 |
29 | if(FRAMELESSHELPER_BUILD_WIDGETS AND TARGET Qt${QT_VERSION_MAJOR}::Widgets)
30 | add_subdirectory(widgets)
31 | endif()
32 |
33 | if(FRAMELESSHELPER_BUILD_QUICK AND TARGET Qt${QT_VERSION_MAJOR}::Quick)
34 | add_subdirectory(quick)
35 | endif()
36 |
--------------------------------------------------------------------------------
/examples/dialog/dialog.h:
--------------------------------------------------------------------------------
1 | // Copyright (C) 2022 The Qt Company Ltd.
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3 |
4 | #pragma once
5 |
6 | #include
7 |
8 | FRAMELESSHELPER_REQUIRE_CONFIG(window)
9 |
10 | QT_BEGIN_NAMESPACE
11 | class QCheckBox;
12 | class QDialogButtonBox;
13 | class QGroupBox;
14 | class QLabel;
15 | class QLineEdit;
16 | class QPushButton;
17 | QT_END_NAMESPACE
18 |
19 | #if FRAMELESSHELPER_CONFIG(titlebar)
20 | FRAMELESSHELPER_BEGIN_NAMESPACE
21 | class StandardTitleBar;
22 | FRAMELESSHELPER_END_NAMESPACE
23 | #endif
24 |
25 | class Dialog : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessDialog)
26 | {
27 | Q_OBJECT
28 | Q_DISABLE_COPY_MOVE(Dialog)
29 |
30 | public:
31 | explicit Dialog(QWidget *parent = nullptr);
32 | ~Dialog() override;
33 |
34 | void waitReady();
35 |
36 | protected:
37 | void closeEvent(QCloseEvent *event) override;
38 |
39 | private:
40 | void setupUi();
41 |
42 | private:
43 | #if FRAMELESSHELPER_CONFIG(titlebar)
44 | FRAMELESSHELPER_PREPEND_NAMESPACE(StandardTitleBar) *titleBar = nullptr;
45 | #endif
46 | QLabel *label = nullptr;
47 | QLineEdit *lineEdit = nullptr;
48 | QCheckBox *caseCheckBox = nullptr;
49 | QCheckBox *fromStartCheckBox = nullptr;
50 | QCheckBox *wholeWordsCheckBox = nullptr;
51 | QCheckBox *searchSelectionCheckBox = nullptr;
52 | QCheckBox *backwardCheckBox = nullptr;
53 | QDialogButtonBox *buttonBox = nullptr;
54 | QPushButton *findButton = nullptr;
55 | QPushButton *moreButton = nullptr;
56 | QWidget *extension = nullptr;
57 | };
58 |
--------------------------------------------------------------------------------
/examples/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #[[
2 | MIT License
3 |
4 | Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | SOFTWARE.
23 | ]]
24 |
25 | if(FRAMELESSHELPER_BUILD_WIDGETS AND TARGET Qt${QT_VERSION_MAJOR}::Widgets)
26 | add_subdirectory(widget)
27 | add_subdirectory(mainwindow)
28 | #add_subdirectory(openglwidget) # Currently not functional.
29 | add_subdirectory(dialog)
30 | endif()
31 |
32 | if(FRAMELESSHELPER_BUILD_QUICK AND TARGET Qt${QT_VERSION_MAJOR}::Quick AND (QT_VERSION_MAJOR GREATER_EQUAL 6) AND (NOT FRAMELESSHELPER_NO_PRIVATE))
33 | add_subdirectory(quick)
34 | endif()
35 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/framelessquickmodule.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | QT_BEGIN_NAMESPACE
30 | class QQmlEngine;
31 | QT_END_NAMESPACE
32 |
33 | FRAMELESSHELPER_BEGIN_NAMESPACE
34 |
35 | namespace FramelessHelper::Quick
36 | {
37 | inline void registerTypes(QQmlEngine *engine) { FramelessHelperQuickRegisterTypes(engine); }
38 | } // namespace FramelessHelper::Quick
39 |
40 | FRAMELESSHELPER_END_NAMESPACE
41 |
--------------------------------------------------------------------------------
/qmake/widgets.pri:
--------------------------------------------------------------------------------
1 | QT += widgets
2 |
3 | BASE_INC_DIR = $$PWD/../include
4 | COMMON_INC_DIR = $$BASE_INC_DIR/FramelessHelper
5 | WIDGETS_PUB_INC_DIR = $$COMMON_INC_DIR/Widgets
6 | WIDGETS_PRIV_INC_DIR = $$WIDGETS_PUB_INC_DIR/private
7 | WIDGETS_SRC_DIR = $$PWD/../src/widgets
8 |
9 | DEFINES += \
10 | FRAMELESSHELPER_WIDGETS_STATIC
11 |
12 | INCLUDEPATH += \
13 | $$BASE_INC_DIR \
14 | $$COMMON_INC_DIR \
15 | $$WIDGETS_PUB_INC_DIR \
16 | $$WIDGETS_PRIV_INC_DIR
17 |
18 | DEPENDPATH += \
19 | $$BASE_INC_DIR \
20 | $$COMMON_INC_DIR \
21 | $$WIDGETS_PUB_INC_DIR \
22 | $$WIDGETS_PRIV_INC_DIR
23 |
24 | HEADERS += \
25 | $$WIDGETS_PUB_INC_DIR/framelesshelperwidgets_global.h \
26 | $$WIDGETS_PUB_INC_DIR/framelesswidget.h \
27 | $$WIDGETS_PUB_INC_DIR/framelessmainwindow.h \
28 | $$WIDGETS_PUB_INC_DIR/standardsystembutton.h \
29 | $$WIDGETS_PUB_INC_DIR/framelesswidgetshelper.h \
30 | $$WIDGETS_PUB_INC_DIR/standardtitlebar.h \
31 | $$WIDGETS_PUB_INC_DIR/framelessdialog.h \
32 | $$WIDGETS_PRIV_INC_DIR/framelesswidgetshelper_p.h \
33 | $$WIDGETS_PRIV_INC_DIR/standardsystembutton_p.h \
34 | $$WIDGETS_PRIV_INC_DIR/standardtitlebar_p.h \
35 | $$WIDGETS_PRIV_INC_DIR/framelesswidget_p.h \
36 | $$WIDGETS_PRIV_INC_DIR/framelessmainwindow_p.h \
37 | $$WIDGETS_PRIV_INC_DIR/widgetssharedhelper_p.h \
38 | $$WIDGETS_PRIV_INC_DIR/framelessdialog_p.h
39 |
40 | SOURCES += \
41 | $$WIDGETS_SRC_DIR/framelessmainwindow.cpp \
42 | $$WIDGETS_SRC_DIR/framelesswidgetshelper.cpp \
43 | $$WIDGETS_SRC_DIR/framelesswidget.cpp \
44 | $$WIDGETS_SRC_DIR/standardsystembutton.cpp \
45 | $$WIDGETS_SRC_DIR/standardtitlebar.cpp \
46 | $$WIDGETS_SRC_DIR/widgetssharedhelper.cpp \
47 | $$WIDGETS_SRC_DIR/framelesshelperwidgets_global.cpp \
48 | $$WIDGETS_SRC_DIR/framelessdialog.cpp
49 |
--------------------------------------------------------------------------------
/examples/quick/quicksettings.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 |
30 | class QuickSettings : public QObject
31 | {
32 | Q_OBJECT
33 | #ifdef QML_NAMED_ELEMENT
34 | QML_NAMED_ELEMENT(Settings)
35 | #endif
36 | #ifdef QML_SINGLETON
37 | QML_SINGLETON
38 | #endif
39 | Q_DISABLE_COPY_MOVE(QuickSettings)
40 |
41 | public:
42 | explicit QuickSettings(QObject *parent = nullptr);
43 | ~QuickSettings() override;
44 |
45 | public Q_SLOTS:
46 | void saveGeometry(QWindow *window);
47 | Q_NODISCARD bool restoreGeometry(QWindow *window);
48 | };
49 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/framelesshelper_qt.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | FRAMELESSHELPER_BEGIN_NAMESPACE
30 |
31 | struct SystemParameters;
32 |
33 | class FRAMELESSHELPER_CORE_API FramelessHelperQt : public QObject
34 | {
35 | Q_OBJECT
36 | FRAMELESSHELPER_CLASS_INFO
37 | Q_DISABLE_COPY_MOVE(FramelessHelperQt)
38 |
39 | public:
40 | explicit FramelessHelperQt(QObject *parent = nullptr);
41 | ~FramelessHelperQt() override;
42 |
43 | static void addWindow(const SystemParameters *params);
44 | static void removeWindow(const WId windowId);
45 |
46 | protected:
47 | Q_NODISCARD bool eventFilter(QObject *object, QEvent *event) override;
48 | };
49 |
50 | FRAMELESSHELPER_END_NAMESPACE
51 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/framelessdialog.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 |
30 | #if FRAMELESSHELPER_CONFIG(window)
31 |
32 | FRAMELESSHELPER_BEGIN_NAMESPACE
33 |
34 | class FramelessDialogPrivate;
35 |
36 | class FRAMELESSHELPER_WIDGETS_API FramelessDialog : public QDialog
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PRIVATE(FramelessDialog)
41 | Q_DISABLE_COPY_MOVE(FramelessDialog)
42 |
43 | public:
44 | explicit FramelessDialog(QWidget *parent = nullptr);
45 | ~FramelessDialog() override;
46 |
47 | private:
48 | QScopedPointer d_ptr;
49 | };
50 |
51 | FRAMELESSHELPER_END_NAMESPACE
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/examples/openglwidget/mainwindow.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | FRAMELESSHELPER_BEGIN_NAMESPACE
30 | class StandardTitleBar;
31 | FRAMELESSHELPER_END_NAMESPACE
32 |
33 | class GLWidget;
34 |
35 | class MainWindow : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessWidget)
36 | {
37 | Q_OBJECT
38 | Q_DISABLE_COPY_MOVE(MainWindow)
39 |
40 | public:
41 | explicit MainWindow(QWidget *parent = nullptr);
42 | ~MainWindow() override;
43 |
44 | void waitReady();
45 |
46 | protected:
47 | void closeEvent(QCloseEvent *event) override;
48 |
49 | private:
50 | void initialize();
51 |
52 | private:
53 | FRAMELESSHELPER_PREPEND_NAMESPACE(StandardTitleBar) *m_titleBar = nullptr;
54 | GLWidget *m_glWidget = nullptr;
55 | };
56 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/framelesshelper_win.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 |
30 | #ifdef Q_OS_WINDOWS
31 |
32 | FRAMELESSHELPER_BEGIN_NAMESPACE
33 |
34 | struct SystemParameters;
35 |
36 | class FRAMELESSHELPER_CORE_API FramelessHelperWin : public QAbstractNativeEventFilter
37 | {
38 | Q_DISABLE_COPY_MOVE(FramelessHelperWin)
39 |
40 | public:
41 | explicit FramelessHelperWin();
42 | ~FramelessHelperWin() override;
43 |
44 | static void addWindow(const SystemParameters *params);
45 | static void removeWindow(const WId windowId);
46 |
47 | Q_NODISCARD bool nativeEventFilter(const QByteArray &eventType, void *message, QT_NATIVE_EVENT_RESULT_TYPE *result) override;
48 | };
49 |
50 | FRAMELESSHELPER_END_NAMESPACE
51 |
52 | #endif // Q_OS_WINDOWS
53 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/quickchromepalette.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | #if FRAMELESSHELPER_CONFIG(titlebar)
32 |
33 | FRAMELESSHELPER_BEGIN_NAMESPACE
34 |
35 | class FRAMELESSHELPER_QUICK_API QuickChromePalette : public ChromePalette, public QQmlParserStatus
36 | {
37 | Q_OBJECT
38 | FRAMELESSHELPER_CLASS_INFO
39 | #ifdef QML_ANONYMOUS
40 | QML_ANONYMOUS
41 | #endif
42 | Q_DISABLE_COPY_MOVE(QuickChromePalette)
43 | Q_INTERFACES(QQmlParserStatus)
44 |
45 | public:
46 | explicit QuickChromePalette(QObject *parent = nullptr);
47 | ~QuickChromePalette() override;
48 |
49 | protected:
50 | void classBegin() override;
51 | void componentComplete() override;
52 | };
53 |
54 | FRAMELESSHELPER_END_NAMESPACE
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/private/framelessconfig_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | FRAMELESSHELPER_BEGIN_NAMESPACE
30 |
31 | class FRAMELESSHELPER_CORE_API FramelessConfig : public QObject
32 | {
33 | Q_OBJECT
34 | FRAMELESSHELPER_CLASS_INFO
35 | Q_DISABLE_COPY_MOVE(FramelessConfig)
36 |
37 | public:
38 | Q_NODISCARD static FramelessConfig *instance();
39 |
40 | void reload(const bool force = false);
41 |
42 | void set(const Global::Option option, const bool on = true);
43 | Q_NODISCARD bool isSet(const Global::Option option) const;
44 |
45 | static void setLoadFromEnvironmentVariablesDisabled(const bool on = true);
46 | static void setLoadFromConfigurationFileDisabled(const bool on = true);
47 |
48 | private:
49 | explicit FramelessConfig(QObject *parent = nullptr);
50 | ~FramelessConfig() override;
51 | };
52 |
53 | FRAMELESSHELPER_END_NAMESPACE
54 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/private/winverhelper_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #ifdef Q_OS_WINDOWS
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | namespace WindowsVersionHelper
34 | {
35 |
36 | #define DECL(Name) [[nodiscard]] FRAMELESSHELPER_CORE_API bool isWin##Name##OrGreater();
37 |
38 | DECL(2K)
39 | DECL(XP)
40 | DECL(XP64)
41 | DECL(Vista)
42 | DECL(VistaSP1)
43 | DECL(VistaSP2)
44 | DECL(7)
45 | DECL(7SP1)
46 | DECL(8)
47 | DECL(8Point1)
48 | DECL(8Point1Update1)
49 | DECL(10)
50 | DECL(10TH1)
51 | DECL(10TH2)
52 | DECL(10RS1)
53 | DECL(10RS2)
54 | DECL(10RS3)
55 | DECL(10RS4)
56 | DECL(10RS5)
57 | DECL(1019H1)
58 | DECL(1019H2)
59 | DECL(1020H1)
60 | DECL(1020H2)
61 | DECL(1021H1)
62 | DECL(1021H2)
63 | DECL(1022H2)
64 | DECL(11)
65 | DECL(1121H2)
66 | DECL(1122H2)
67 |
68 | #undef DECL
69 |
70 | } // namespace WindowsVersionHelper
71 |
72 | FRAMELESSHELPER_END_NAMESPACE
73 |
74 | #endif // Q_OS_WINDOWS
75 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/framelesshelperwidgets_global.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #ifndef FRAMELESSHELPER_WIDGETS_API
30 | # ifdef FRAMELESSHELPER_WIDGETS_STATIC
31 | # define FRAMELESSHELPER_WIDGETS_API
32 | # else
33 | # ifdef FRAMELESSHELPER_WIDGETS_LIBRARY
34 | # define FRAMELESSHELPER_WIDGETS_API Q_DECL_EXPORT
35 | # else
36 | # define FRAMELESSHELPER_WIDGETS_API Q_DECL_IMPORT
37 | # endif
38 | # endif
39 | #endif
40 |
41 | FRAMELESSHELPER_BEGIN_NAMESPACE
42 |
43 | FRAMELESSHELPER_WIDGETS_API void FramelessHelperWidgetsInitialize();
44 | FRAMELESSHELPER_WIDGETS_API void FramelessHelperWidgetsUninitialize();
45 |
46 | namespace FramelessHelper::Widgets
47 | {
48 | inline void initialize() { FramelessHelperWidgetsInitialize(); }
49 | inline void uninitialize() { FramelessHelperWidgetsUninitialize(); }
50 | } // namespace FramelessHelper::Widgets
51 |
52 | FRAMELESSHELPER_END_NAMESPACE
53 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/private/framelessdialog_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #if FRAMELESSHELPER_CONFIG(window)
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | class FramelessDialog;
34 | class WidgetsSharedHelper;
35 |
36 | class FRAMELESSHELPER_WIDGETS_API FramelessDialogPrivate : public QObject
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PUBLIC(FramelessDialog)
41 | Q_DISABLE_COPY_MOVE(FramelessDialogPrivate)
42 |
43 | public:
44 | explicit FramelessDialogPrivate(FramelessDialog *q);
45 | ~FramelessDialogPrivate() override;
46 |
47 | Q_NODISCARD static FramelessDialogPrivate *get(FramelessDialog *pub);
48 | Q_NODISCARD static const FramelessDialogPrivate *get(const FramelessDialog *pub);
49 |
50 | FramelessDialog *q_ptr = nullptr;
51 | WidgetsSharedHelper *sharedHelper = nullptr;
52 | };
53 |
54 | FRAMELESSHELPER_END_NAMESPACE
55 |
56 | #endif
57 |
--------------------------------------------------------------------------------
/examples/mainwindow/mainwindow.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | FRAMELESSHELPER_REQUIRE_CONFIG(window)
30 |
31 | #if FRAMELESSHELPER_CONFIG(titlebar)
32 | FRAMELESSHELPER_BEGIN_NAMESPACE
33 | class StandardTitleBar;
34 | FRAMELESSHELPER_END_NAMESPACE
35 | #endif
36 |
37 | namespace Ui
38 | {
39 | class MainWindow;
40 | }
41 |
42 | class MainWindow : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessMainWindow)
43 | {
44 | Q_OBJECT
45 | Q_DISABLE_COPY_MOVE(MainWindow)
46 |
47 | public:
48 | explicit MainWindow(QWidget *parent = nullptr, const Qt::WindowFlags flags = {});
49 | ~MainWindow() override;
50 |
51 | void waitReady();
52 |
53 | protected:
54 | void closeEvent(QCloseEvent *event) override;
55 |
56 | private:
57 | void initialize();
58 |
59 | private:
60 | #if FRAMELESSHELPER_CONFIG(titlebar)
61 | FRAMELESSHELPER_PREPEND_NAMESPACE(StandardTitleBar) *m_titleBar = nullptr;
62 | #endif
63 | Ui::MainWindow *m_mainWindow = nullptr;
64 | };
65 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/private/framelesswidget_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #if FRAMELESSHELPER_CONFIG(window)
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | class FramelessWidget;
34 | class WidgetsSharedHelper;
35 |
36 | class FRAMELESSHELPER_WIDGETS_API FramelessWidgetPrivate : public QObject
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PUBLIC(FramelessWidget)
41 | Q_DISABLE_COPY_MOVE(FramelessWidgetPrivate)
42 |
43 | public:
44 | explicit FramelessWidgetPrivate(FramelessWidget *q);
45 | ~FramelessWidgetPrivate() override;
46 |
47 | Q_NODISCARD static FramelessWidgetPrivate *get(FramelessWidget *pub);
48 | Q_NODISCARD static const FramelessWidgetPrivate *get(const FramelessWidget *pub);
49 |
50 | FramelessWidget *q_ptr = nullptr;
51 | Qt::WindowState savedWindowState = Qt::WindowNoState;
52 | WidgetsSharedHelper *sharedHelper = nullptr;
53 | };
54 |
55 | FRAMELESSHELPER_END_NAMESPACE
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/qmake/inc/core/framelesshelper.config:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | // Generated automatically by CMake.
26 | // WARNING! DO NOT EDIT THIS FILE MANUALLY!
27 | // ALL CHANGES WILL BE LOST AFTER RE-CONFIGURING!
28 | // Also please do not include this file directly,
29 | // it's designed to be included by FramelessHelper's own headers.
30 |
31 | #pragma once
32 |
33 | #ifndef _FRAMELESSHELPER_CONFIG_DEFINED_
34 | #define _FRAMELESSHELPER_CONFIG_DEFINED_
35 |
36 | #define FRAMELESSHELPER_FEATURE_static_build 1
37 | #define FRAMELESSHELPER_FEATURE_widgets 1
38 | #define FRAMELESSHELPER_FEATURE_quick 1
39 | #define FRAMELESSHELPER_FEATURE_debug_output -1
40 | #define FRAMELESSHELPER_FEATURE_bundle_resource 1
41 | #define FRAMELESSHELPER_FEATURE_private_qt 1
42 | #define FRAMELESSHELPER_FEATURE_window 1
43 | #define FRAMELESSHELPER_FEATURE_titlebar 1
44 | #define FRAMELESSHELPER_FEATURE_translation 1
45 | #define FRAMELESSHELPER_FEATURE_mica_material 1
46 | #define FRAMELESSHELPER_FEATURE_border_painter 1
47 | #define FRAMELESSHELPER_FEATURE_system_button 1
48 |
49 | #endif // _FRAMELESSHELPER_CONFIG_DEFINED_
50 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/private/framelessmainwindow_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #if FRAMELESSHELPER_CONFIG(window)
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | class FramelessMainWindow;
34 | class WidgetsSharedHelper;
35 |
36 | class FRAMELESSHELPER_WIDGETS_API FramelessMainWindowPrivate : public QObject
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PUBLIC(FramelessMainWindow)
41 | Q_DISABLE_COPY_MOVE(FramelessMainWindowPrivate)
42 |
43 | public:
44 | explicit FramelessMainWindowPrivate(FramelessMainWindow *q);
45 | ~FramelessMainWindowPrivate() override;
46 |
47 | Q_NODISCARD static FramelessMainWindowPrivate *get(FramelessMainWindow *pub);
48 | Q_NODISCARD static const FramelessMainWindowPrivate *get(const FramelessMainWindow *pub);
49 |
50 | FramelessMainWindow *q_ptr = nullptr;
51 | Qt::WindowState savedWindowState = Qt::WindowNoState;
52 | WidgetsSharedHelper *sharedHelper = nullptr;
53 | };
54 |
55 | FRAMELESSHELPER_END_NAMESPACE
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/src/quick/quickchromepalette.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #include "quickchromepalette.h"
26 |
27 | #if FRAMELESSHELPER_CONFIG(titlebar)
28 |
29 | #include
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | #if FRAMELESSHELPER_CONFIG(debug_output)
34 | [[maybe_unused]] static Q_LOGGING_CATEGORY(lcQuickChromePalette, "wangwenx190.framelesshelper.quick.quickchromepalette")
35 | # define INFO qCInfo(lcQuickChromePalette)
36 | # define DEBUG qCDebug(lcQuickChromePalette)
37 | # define WARNING qCWarning(lcQuickChromePalette)
38 | # define CRITICAL qCCritical(lcQuickChromePalette)
39 | #else
40 | # define INFO QT_NO_QDEBUG_MACRO()
41 | # define DEBUG QT_NO_QDEBUG_MACRO()
42 | # define WARNING QT_NO_QDEBUG_MACRO()
43 | # define CRITICAL QT_NO_QDEBUG_MACRO()
44 | #endif
45 |
46 | QuickChromePalette::QuickChromePalette(QObject *parent) : ChromePalette(parent)
47 | {
48 | }
49 |
50 | QuickChromePalette::~QuickChromePalette() = default;
51 |
52 | void QuickChromePalette::classBegin()
53 | {
54 | }
55 |
56 | void QuickChromePalette::componentComplete()
57 | {
58 | }
59 |
60 | FRAMELESSHELPER_END_NAMESPACE
61 |
62 | #endif
63 |
--------------------------------------------------------------------------------
/qmake/quick.pri:
--------------------------------------------------------------------------------
1 | QT += \
2 | quick quick-private \
3 | quicktemplates2 quicktemplates2-private \
4 | quickcontrols2 quickcontrols2-private
5 |
6 | BASE_INC_DIR = $$PWD/../include
7 | COMMON_INC_DIR = $$BASE_INC_DIR/FramelessHelper
8 | QUICK_PUB_INC_DIR = $$COMMON_INC_DIR/Quick
9 | QUICK_PRIV_INC_DIR = $$QUICK_PUB_INC_DIR/private
10 | QUICK_SRC_DIR = $$PWD/../src/quick
11 |
12 | DEFINES += \
13 | FRAMELESSHELPER_QUICK_STATIC
14 |
15 | INCLUDEPATH += \
16 | $$BASE_INC_DIR \
17 | $$COMMON_INC_DIR \
18 | $$QUICK_PUB_INC_DIR \
19 | $$QUICK_PRIV_INC_DIR
20 |
21 | DEPENDPATH += \
22 | $$BASE_INC_DIR \
23 | $$COMMON_INC_DIR \
24 | $$QUICK_PUB_INC_DIR \
25 | $$QUICK_PRIV_INC_DIR
26 |
27 | HEADERS += \
28 | $$QUICK_PUB_INC_DIR/framelesshelperquick_global.h \
29 | $$QUICK_PUB_INC_DIR/framelessquickmodule.h \
30 | $$QUICK_PUB_INC_DIR/framelessquickhelper.h \
31 | $$QUICK_PUB_INC_DIR/framelessquickutils.h \
32 | $$QUICK_PUB_INC_DIR/quickchromepalette.h \
33 | $$QUICK_PUB_INC_DIR/quickmicamaterial.h \
34 | $$QUICK_PUB_INC_DIR/quickimageitem.h \
35 | $$QUICK_PUB_INC_DIR/quickwindowborder.h \
36 | $$QUICK_PRIV_INC_DIR/quickstandardsystembutton_p.h \
37 | $$QUICK_PRIV_INC_DIR/quickstandardtitlebar_p.h \
38 | $$QUICK_PRIV_INC_DIR/framelessquickhelper_p.h \
39 | $$QUICK_PRIV_INC_DIR/framelessquickwindow_p.h \
40 | $$QUICK_PRIV_INC_DIR/framelessquickwindow_p_p.h \
41 | $$QUICK_PRIV_INC_DIR/framelessquickapplicationwindow_p.h \
42 | $$QUICK_PRIV_INC_DIR/framelessquickapplicationwindow_p_p.h \
43 | $$QUICK_PRIV_INC_DIR/quickmicamaterial_p.h \
44 | $$QUICK_PRIV_INC_DIR/quickimageitem_p.h \
45 | $$QUICK_PRIV_INC_DIR/quickwindowborder_p.h
46 |
47 | SOURCES += \
48 | $$QUICK_SRC_DIR/quickstandardsystembutton.cpp \
49 | $$QUICK_SRC_DIR/quickstandardtitlebar.cpp \
50 | $$QUICK_SRC_DIR/framelessquickutils.cpp \
51 | $$QUICK_SRC_DIR/framelessquickmodule.cpp \
52 | $$QUICK_SRC_DIR/framelessquickwindow.cpp \
53 | $$QUICK_SRC_DIR/framelessquickapplicationwindow.cpp \
54 | $$QUICK_SRC_DIR/framelessquickhelper.cpp \
55 | $$QUICK_SRC_DIR/quickchromepalette.cpp \
56 | $$QUICK_SRC_DIR/framelesshelperquick_global.cpp \
57 | $$QUICK_SRC_DIR/quickmicamaterial.cpp \
58 | $$QUICK_SRC_DIR/quickimageitem.cpp \
59 | $$QUICK_SRC_DIR/quickwindowborder.cpp
60 |
--------------------------------------------------------------------------------
/examples/widget/widget.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | FRAMELESSHELPER_REQUIRE_CONFIG(window)
30 |
31 | QT_BEGIN_NAMESPACE
32 | class QLabel;
33 | class QShortcut;
34 | QT_END_NAMESPACE
35 |
36 | #if FRAMELESSHELPER_CONFIG(titlebar)
37 | FRAMELESSHELPER_BEGIN_NAMESPACE
38 | class StandardTitleBar;
39 | FRAMELESSHELPER_END_NAMESPACE
40 | #endif
41 |
42 | class Widget : public FRAMELESSHELPER_PREPEND_NAMESPACE(FramelessWidget)
43 | {
44 | Q_OBJECT
45 | Q_DISABLE_COPY_MOVE(Widget)
46 |
47 | public:
48 | explicit Widget(QWidget *parent = nullptr);
49 | ~Widget() override;
50 |
51 | void waitReady();
52 |
53 | protected:
54 | void timerEvent(QTimerEvent *event) override;
55 | void closeEvent(QCloseEvent *event) override;
56 |
57 | private:
58 | void initialize();
59 |
60 | private Q_SLOTS:
61 | void updateStyleSheet();
62 |
63 | private:
64 | #if FRAMELESSHELPER_CONFIG(titlebar)
65 | FRAMELESSHELPER_PREPEND_NAMESPACE(StandardTitleBar) *m_titleBar = nullptr;
66 | #endif
67 | QLabel *m_clockLabel = nullptr;
68 | QShortcut *m_fullScreenShortcut = nullptr;
69 | QShortcut *m_cancelShortcut = nullptr;
70 | };
71 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Core/private/windowborderpainter_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 |
30 | #if FRAMELESSHELPER_CONFIG(border_painter)
31 |
32 | FRAMELESSHELPER_BEGIN_NAMESPACE
33 |
34 | class WindowBorderPainter;
35 |
36 | class FRAMELESSHELPER_CORE_API WindowBorderPainterPrivate : public QObject
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PUBLIC(WindowBorderPainter)
41 | Q_DISABLE_COPY_MOVE(WindowBorderPainterPrivate)
42 |
43 | public:
44 | explicit WindowBorderPainterPrivate(WindowBorderPainter *q);
45 | ~WindowBorderPainterPrivate() override;
46 |
47 | Q_NODISCARD static WindowBorderPainterPrivate *get(WindowBorderPainter *q);
48 | Q_NODISCARD static const WindowBorderPainterPrivate *get(const WindowBorderPainter *q);
49 |
50 | WindowBorderPainter *q_ptr = nullptr;
51 | std::optional thickness = std::nullopt;
52 | std::optional edges = std::nullopt;
53 | std::optional activeColor = std::nullopt;
54 | std::optional inactiveColor = std::nullopt;
55 | };
56 |
57 | FRAMELESSHELPER_END_NAMESPACE
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/private/quickwindowborder_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #if FRAMELESSHELPER_CONFIG(border_painter)
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | class QuickWindowBorder;
34 | class WindowBorderPainter;
35 |
36 | class FRAMELESSHELPER_QUICK_API QuickWindowBorderPrivate : public QObject
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DISABLE_COPY_MOVE(QuickWindowBorderPrivate)
41 | Q_DECLARE_PUBLIC(QuickWindowBorder)
42 |
43 | public:
44 | explicit QuickWindowBorderPrivate(QuickWindowBorder *q);
45 | ~QuickWindowBorderPrivate() override;
46 |
47 | Q_NODISCARD static QuickWindowBorderPrivate *get(QuickWindowBorder *q);
48 | Q_NODISCARD static const QuickWindowBorderPrivate *get(const QuickWindowBorder *q);
49 |
50 | Q_SLOT void update();
51 |
52 | void initialize();
53 | void rebindWindow();
54 |
55 | QuickWindowBorder *q_ptr = nullptr;
56 | WindowBorderPainter *borderPainter = nullptr;
57 | QMetaObject::Connection activeChangeConnection = {};
58 | QMetaObject::Connection visibilityChangeConnection = {};
59 | };
60 |
61 | FRAMELESSHELPER_END_NAMESPACE
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/src/widgets/framelesshelperwidgets_global.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #include "framelesshelperwidgets_global.h"
26 | #include
27 |
28 | FRAMELESSHELPER_BEGIN_NAMESPACE
29 |
30 | #if FRAMELESSHELPER_CONFIG(debug_output)
31 | [[maybe_unused]] static Q_LOGGING_CATEGORY(lcWidgetsGlobal, "wangwenx190.framelesshelper.widgets.global")
32 | # define INFO qCInfo(lcWidgetsGlobal)
33 | # define DEBUG qCDebug(lcWidgetsGlobal)
34 | # define WARNING qCWarning(lcWidgetsGlobal)
35 | # define CRITICAL qCCritical(lcWidgetsGlobal)
36 | #else
37 | # define INFO QT_NO_QDEBUG_MACRO()
38 | # define DEBUG QT_NO_QDEBUG_MACRO()
39 | # define WARNING QT_NO_QDEBUG_MACRO()
40 | # define CRITICAL QT_NO_QDEBUG_MACRO()
41 | #endif
42 |
43 | void FramelessHelperWidgetsInitialize()
44 | {
45 | static bool inited = false;
46 | if (inited) {
47 | return;
48 | }
49 | inited = true;
50 |
51 | FramelessHelperCoreInitialize();
52 | }
53 |
54 | void FramelessHelperWidgetsUninitialize()
55 | {
56 | static bool uninited = false;
57 | if (uninited) {
58 | return;
59 | }
60 | uninited = true;
61 |
62 | // ### TODO: The Widgets module-specific uninitialization.
63 |
64 | FramelessHelperCoreUninitialize();
65 | }
66 |
67 | FRAMELESSHELPER_END_NAMESPACE
68 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/private/quickmicamaterial_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #if FRAMELESSHELPER_CONFIG(mica_material)
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | class MicaMaterial;
34 | class QuickMicaMaterial;
35 |
36 | class FRAMELESSHELPER_QUICK_API QuickMicaMaterialPrivate : public QObject
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DISABLE_COPY_MOVE(QuickMicaMaterialPrivate)
41 | Q_DECLARE_PUBLIC(QuickMicaMaterial)
42 |
43 | public:
44 | explicit QuickMicaMaterialPrivate(QuickMicaMaterial *q);
45 | ~QuickMicaMaterialPrivate() override;
46 |
47 | Q_NODISCARD static QuickMicaMaterialPrivate *get(QuickMicaMaterial *q);
48 | Q_NODISCARD static const QuickMicaMaterialPrivate *get(const QuickMicaMaterial *q);
49 |
50 | Q_SLOT void rebindWindow();
51 |
52 | void initialize();
53 |
54 | QuickMicaMaterial *q_ptr = nullptr;
55 | QMetaObject::Connection rootWindowXChangedConnection = {};
56 | QMetaObject::Connection rootWindowYChangedConnection = {};
57 | QMetaObject::Connection rootWindowActiveChangedConnection = {};
58 | MicaMaterial *micaMaterial = nullptr;
59 | };
60 |
61 | FRAMELESSHELPER_END_NAMESPACE
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/framelesswidget.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 |
30 | #if FRAMELESSHELPER_CONFIG(window)
31 |
32 | FRAMELESSHELPER_BEGIN_NAMESPACE
33 |
34 | class FramelessWidgetPrivate;
35 |
36 | class FRAMELESSHELPER_WIDGETS_API FramelessWidget : public QWidget
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PRIVATE(FramelessWidget)
41 | Q_DISABLE_COPY_MOVE(FramelessWidget)
42 | Q_PROPERTY(bool hidden READ isHidden NOTIFY hiddenChanged FINAL)
43 | Q_PROPERTY(bool normal READ isNormal NOTIFY normalChanged FINAL)
44 | Q_PROPERTY(bool zoomed READ isZoomed NOTIFY zoomedChanged FINAL)
45 |
46 | public:
47 | explicit FramelessWidget(QWidget *parent = nullptr);
48 | ~FramelessWidget() override;
49 |
50 | Q_NODISCARD bool isNormal() const;
51 | Q_NODISCARD bool isZoomed() const;
52 |
53 | public Q_SLOTS:
54 | void toggleMaximized();
55 | void toggleFullScreen();
56 |
57 | Q_SIGNALS:
58 | void hiddenChanged();
59 | void normalChanged();
60 | void zoomedChanged();
61 |
62 | private:
63 | QScopedPointer d_ptr;
64 | };
65 |
66 | FRAMELESSHELPER_END_NAMESPACE
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/private/framelessquickwindow_p_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #if (FRAMELESSHELPER_CONFIG(private_qt) && FRAMELESSHELPER_CONFIG(window))
30 |
31 | #include
32 |
33 | FRAMELESSHELPER_BEGIN_NAMESPACE
34 |
35 | #if FRAMELESSHELPER_CONFIG(border_painter)
36 | class QuickWindowBorder;
37 | #endif
38 | class FramelessQuickWindow;
39 |
40 | class FRAMELESSHELPER_QUICK_API FramelessQuickWindowPrivate : public QObject
41 | {
42 | Q_OBJECT
43 | FRAMELESSHELPER_CLASS_INFO
44 | Q_DECLARE_PUBLIC(FramelessQuickWindow)
45 | Q_DISABLE_COPY_MOVE(FramelessQuickWindowPrivate)
46 |
47 | public:
48 | explicit FramelessQuickWindowPrivate(FramelessQuickWindow *q);
49 | ~FramelessQuickWindowPrivate() override;
50 |
51 | Q_NODISCARD static FramelessQuickWindowPrivate *get(FramelessQuickWindow *pub);
52 | Q_NODISCARD static const FramelessQuickWindowPrivate *get(const FramelessQuickWindow *pub);
53 |
54 | FramelessQuickWindow *q_ptr = nullptr;
55 | QQuickWindow::Visibility savedVisibility = QQuickWindow::Windowed;
56 | #if FRAMELESSHELPER_CONFIG(border_painter)
57 | QuickWindowBorder *windowBorder = nullptr;
58 | #endif
59 | };
60 |
61 | FRAMELESSHELPER_END_NAMESPACE
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/framelessmainwindow.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 |
30 | #if FRAMELESSHELPER_CONFIG(window)
31 |
32 | FRAMELESSHELPER_BEGIN_NAMESPACE
33 |
34 | class FramelessMainWindowPrivate;
35 |
36 | class FRAMELESSHELPER_WIDGETS_API FramelessMainWindow : public QMainWindow
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PRIVATE(FramelessMainWindow)
41 | Q_DISABLE_COPY_MOVE(FramelessMainWindow)
42 | Q_PROPERTY(bool hidden READ isHidden NOTIFY hiddenChanged FINAL)
43 | Q_PROPERTY(bool normal READ isNormal NOTIFY normalChanged FINAL)
44 | Q_PROPERTY(bool zoomed READ isZoomed NOTIFY zoomedChanged FINAL)
45 |
46 | public:
47 | explicit FramelessMainWindow(QWidget *parent = nullptr, const Qt::WindowFlags flags = {});
48 | ~FramelessMainWindow() override;
49 |
50 | Q_NODISCARD bool isNormal() const;
51 | Q_NODISCARD bool isZoomed() const;
52 |
53 | public Q_SLOTS:
54 | void toggleMaximized();
55 | void toggleFullScreen();
56 |
57 | Q_SIGNALS:
58 | void hiddenChanged();
59 | void normalChanged();
60 | void zoomedChanged();
61 |
62 | private:
63 | QScopedPointer d_ptr;
64 | };
65 |
66 | FRAMELESSHELPER_END_NAMESPACE
67 |
68 | #endif
69 |
--------------------------------------------------------------------------------
/qmake/inc/core/framelesshelper.version:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | // Generated automatically by QMake.
26 | // WARNING! DO NOT EDIT THIS FILE MANUALLY!
27 | // ALL CHANGES WILL BE LOST AFTER RE-CONFIGURING!
28 | // Also please do not include this file directly,
29 | // it's designed to be included by FramelessHelper's own headers.
30 |
31 | #pragma once
32 |
33 | #ifndef _FRAMELESSHELPER_VERSION_DEFINED_
34 | #define _FRAMELESSHELPER_VERSION_DEFINED_
35 |
36 | [[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_MAJOR = 2;
37 | [[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_MINOR = 5;
38 | [[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_PATCH = 0;
39 | //[[maybe_unused]] inline constexpr const int FRAMELESSHELPER_VERSION_TWEAK = 0;
40 | [[maybe_unused]] inline constexpr const char FRAMELESSHELPER_VERSION_STR[] = "2.5.0";
41 | [[maybe_unused]] inline constexpr const char FRAMELESSHELPER_COMMIT_STR[] = "UNKNOWN";
42 | [[maybe_unused]] inline constexpr const char FRAMELESSHELPER_COMPILE_DATETIME_STR[] = "UNKNOWN";
43 |
44 | #define __FRAMELESSHELPER_VERSION_MAJOR__ 2
45 | #define __FRAMELESSHELPER_VERSION_MINOR__ 5
46 | #define __FRAMELESSHELPER_VERSION_PATCH__ 0
47 | //#define __FRAMELESSHELPER_VERSION_TWEAK__ 0
48 | #define __FRAMELESSHELPER_VERSION__ 0x02050000
49 | #define __FRAMELESSHELPER__ 0x02050000
50 |
51 | #endif // _FRAMELESSHELPER_VERSION_DEFINED_
52 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Widgets/private/standardsystembutton_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 |
30 | #if FRAMELESSHELPER_CONFIG(system_button)
31 |
32 | FRAMELESSHELPER_BEGIN_NAMESPACE
33 |
34 | class StandardSystemButton;
35 |
36 | class FRAMELESSHELPER_WIDGETS_API StandardSystemButtonPrivate : public QObject
37 | {
38 | Q_OBJECT
39 | FRAMELESSHELPER_CLASS_INFO
40 | Q_DECLARE_PUBLIC(StandardSystemButton)
41 | Q_DISABLE_COPY_MOVE(StandardSystemButtonPrivate)
42 |
43 | public:
44 | explicit StandardSystemButtonPrivate(StandardSystemButton *q);
45 | ~StandardSystemButtonPrivate() override;
46 |
47 | Q_NODISCARD static StandardSystemButtonPrivate *get(StandardSystemButton *pub);
48 | Q_NODISCARD static const StandardSystemButtonPrivate *get(const StandardSystemButton *pub);
49 |
50 | Q_NODISCARD static QSize getRecommendedButtonSize();
51 |
52 | StandardSystemButton *q_ptr = nullptr;
53 | Global::SystemButtonType buttonType = Global::SystemButtonType::Unknown;
54 | QString glyph = {};
55 | QColor hoverColor = {};
56 | QColor pressColor = {};
57 | QColor normalColor = {};
58 | QColor activeForegroundColor = {};
59 | QColor inactiveForegroundColor = {};
60 | bool active = false;
61 | std::optional glyphSize = std::nullopt;
62 | };
63 |
64 | FRAMELESSHELPER_END_NAMESPACE
65 |
66 | #endif
67 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/private/framelessquickapplicationwindow_p_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 |
29 | #if (FRAMELESSHELPER_CONFIG(private_qt) && FRAMELESSHELPER_CONFIG(window) && (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)))
30 |
31 | #include
32 |
33 | FRAMELESSHELPER_BEGIN_NAMESPACE
34 |
35 | #if FRAMELESSHELPER_CONFIG(border_painter)
36 | class QuickWindowBorder;
37 | #endif
38 | class FramelessQuickApplicationWindow;
39 |
40 | class FRAMELESSHELPER_QUICK_API FramelessQuickApplicationWindowPrivate : public QObject
41 | {
42 | Q_OBJECT
43 | FRAMELESSHELPER_CLASS_INFO
44 | Q_DECLARE_PUBLIC(FramelessQuickApplicationWindow)
45 | Q_DISABLE_COPY_MOVE(FramelessQuickApplicationWindowPrivate)
46 |
47 | public:
48 | explicit FramelessQuickApplicationWindowPrivate(FramelessQuickApplicationWindow *q);
49 | ~FramelessQuickApplicationWindowPrivate() override;
50 |
51 | Q_NODISCARD static FramelessQuickApplicationWindowPrivate *get(FramelessQuickApplicationWindow *pub);
52 | Q_NODISCARD static const FramelessQuickApplicationWindowPrivate *get(const FramelessQuickApplicationWindow *pub);
53 |
54 | FramelessQuickApplicationWindow *q_ptr = nullptr;
55 | QQuickWindow::Visibility savedVisibility = QQuickWindow::Windowed;
56 | #if FRAMELESSHELPER_CONFIG(border_painter)
57 | QuickWindowBorder *windowBorder = nullptr;
58 | #endif
59 | };
60 |
61 | FRAMELESSHELPER_END_NAMESPACE
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/include/FramelessHelper/Quick/private/quickimageitem_p.h:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #pragma once
26 |
27 | #include
28 | #include
29 | #include
30 |
31 | FRAMELESSHELPER_BEGIN_NAMESPACE
32 |
33 | class FRAMELESSHELPER_QUICK_API QuickImageItem : public QQuickPaintedItem
34 | {
35 | Q_OBJECT
36 | FRAMELESSHELPER_CLASS_INFO
37 | #ifdef QML_NAMED_ELEMENT
38 | QML_NAMED_ELEMENT(ImageItem)
39 | #endif
40 | Q_DISABLE_COPY_MOVE(QuickImageItem)
41 |
42 | Q_PROPERTY(QVariant source READ source WRITE setSource NOTIFY sourceChanged FINAL)
43 |
44 | public:
45 | explicit QuickImageItem(QQuickItem *parent = nullptr);
46 | ~QuickImageItem() override;
47 |
48 | void paint(QPainter *painter) override;
49 |
50 | Q_NODISCARD QVariant source() const;
51 | void setSource(const QVariant &value);
52 |
53 | Q_SIGNALS:
54 | void sourceChanged();
55 |
56 | protected:
57 | void classBegin() override;
58 | void componentComplete() override;
59 |
60 | private:
61 | void fromUrl(const QUrl &value, QPainter *painter) const;
62 | void fromString(const QString &value, QPainter *painter) const;
63 | void fromImage(const QImage &value, QPainter *painter) const;
64 | void fromPixmap(const QPixmap &value, QPainter *painter) const;
65 | void fromIcon(const QIcon &value, QPainter *painter) const;
66 | Q_NODISCARD QRectF paintArea() const;
67 |
68 | private:
69 | QVariant m_source = {};
70 | };
71 |
72 | FRAMELESSHELPER_END_NAMESPACE
73 |
--------------------------------------------------------------------------------
/examples/dialog/main.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * MIT License
3 | *
4 | * Copyright (C) 2021-2023 by wangwenx190 (Yuhang Zhao)
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining a copy
7 | * of this software and associated documentation files (the "Software"), to deal
8 | * in the Software without restriction, including without limitation the rights
9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | * copies of the Software, and to permit persons to whom the Software is
11 | * furnished to do so, subject to the following conditions:
12 | *
13 | * The above copyright notice and this permission notice shall be included in
14 | * all copies or substantial portions of the Software.
15 | *
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 | * SOFTWARE.
23 | */
24 |
25 | #include
26 | #include
27 | #include "dialog.h"
28 | #include "../shared/log.h"
29 |
30 | FRAMELESSHELPER_USE_NAMESPACE
31 |
32 | #define CREATE_WINDOW(Name) \
33 | const auto Name = std::make_unique