Commit Graph

365 Commits

Author SHA1 Message Date
Yuhang Zhao fe81fb80bd cmake: fix install error
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-18 10:08:43 +08:00
Yuhang Zhao 85366ba667 Revert "misc: use better code style"
This reverts commit 3889e49583.

Reason for revert: breaks CI, and no siginificant improvement.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-18 09:22:00 +08:00
Yuhang Zhao 3889e49583 misc: use better code style
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-17 18:01:41 +08:00
Yuhang Zhao 1ae0bd8fd6 examples: reuse common code
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-17 13:43:38 +08:00
Yuhang Zhao e2f7c76c88 win: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-16 13:41:41 +08:00
Yuhang Zhao ca8e9f555d quick: remove now useless workaround
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-14 10:24:46 +08:00
Yuhang Zhao 8097a30a68 fix macos build
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-13 11:55:06 +08:00
Yuhang Zhao 2dc7951f7a fix unix build, issue found by ci
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-13 11:38:20 +08:00
Yuhang Zhao 87da6cb5da move static_assert to cpp source files
To speed up compilation time.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-13 09:44:50 +08:00
Yuhang Zhao f15ca8daf0 fix various issues
1. Fix mica material doesn't work normally when used on multiple windows.
2. Fix build on Qt5.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-12 14:08:58 +08:00
Yuhang Zhao 994b02ad6c quick: add FramelessApplicationWindow element
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-12 10:47:41 +08:00
Yuhang Zhao b9f5cf79c0 win32: add support for dark theme menu
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-11 16:17:04 +08:00
Yuhang Zhao fcf51d6d73 refactor
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-11 11:52:49 +08:00
Yuhang Zhao 1e43ba2e81 improve windowborder element
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-10 22:12:01 +08:00
Yuhang Zhao 1fc23e1c6a cmake: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-10 15:13:18 +08:00
Yuhang Zhao 55be173c31 minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-10 13:59:00 +08:00
Yuhang Zhao 92415fb61c Add WindowBorderPainter and WindowBorder
1. Added WindowBorderPainter for QtWidgets
2. Added WindowBorder for QtQuick (uses WindowBorderPainter internally)
3. Adjust some header includes
4. Limit a Linux workaround to the appropriate Qt versions

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-10 13:35:37 +08:00
Yuhang Zhao b50a2dcd72 fix Qt5 compilation error
And change to lazy initialization for Mica Material.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-09 10:08:49 +08:00
Yuhang Zhao d483c39b9a add way to disable window maximization
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-08 15:25:22 +08:00
Yuhang Zhao e77a2db663 Revert "fix multiple issues found by user"
This reverts commit c0ce7b0f48.

Reason for revert: the fix is totally wrong, as it's trying
to fix a bug which never exists, what's worse, the wrong fix
itself is also causing critical regressions. so revert it immediately.

But the QMake modifications are correct and necessary, so don't
revert that part.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-04 08:55:25 +08:00
Yuhang Zhao c0ce7b0f48 fix multiple issues found by user
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-02 20:17:52 +08:00
Yuhang Zhao ac9a05209e quick: fix misleading and annoying warning
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-30 12:58:13 +08:00
Yuhang Zhao cb107b127a win: add one more workaround of Qt bug
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-29 15:01:59 +08:00
Yuhang Zhao 57a4d8875c cmake: improve the build scripts
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-27 21:13:46 +08:00
Yuhang Zhao 07101273bd win: refactor & simplify
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-26 11:18:13 +08:00
Yuhang Zhao f97f000cc7 avoid potential deadlocks
And some other minor tweaks.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-25 10:35:00 +08:00
Yuhang Zhao c914992aa4 adapt to latest qtbase
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-24 17:57:38 +08:00
Yuhang Zhao 684ebc3fa3 minor improvement
Code simplification & adapt to latest Qt code.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-23 14:04:47 +08:00
Yuhang Zhao eeda750a61 finalize api update
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-21 13:22:03 +08:00
Yuhang Zhao 81ec19d2aa remove unsafe compile params
Not sure whether MinGW supports it or not.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-20 17:39:24 +08:00
Yuhang Zhao 47bf4da5ae allow user to remove a window from the frameless window list
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-20 15:56:59 +08:00
Yuhang Zhao 3d3607af7b refactor
and maybe avoid potential bugs.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-16 17:38:13 +08:00
Yuhang Zhao 91bb8273b8 routine code quality improvement
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-15 18:24:34 +08:00
Yuhang Zhao 47dcb8f032 quick: emulate Windows behavior more, just like widget
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-14 17:07:06 +08:00
Yuhang Zhao 1b36587f14 widgets: emulate Windows behavior more
On Windows, when you left click the window icon in the title bar, the system menu will be triggered.
And when you double click it, the window will be closed.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-14 13:30:08 +08:00
Yuhang Zhao 8667d1996e cmake: add some experimental flags, but commented out
Uncomment out if they are verified to work well.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-13 20:02:02 +08:00
Yuhang Zhao 0ceb0e85c1 win: remove one confusing assert
It works well for msvc but it also confuses a lot of people, so let's remove it.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-13 17:46:23 +08:00
Yuhang Zhao 221f1c12aa fix button size can't be changed
widget: fix the bug
quick: add the interface to change size

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-13 17:38:10 +08:00
Yuhang Zhao 119d10930b win: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-13 11:02:53 +08:00
Yuhang Zhao 55fe04000e add more comments
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-11 10:43:48 +08:00
Yuhang Zhao 9cf8ba959d mac: fix build 2022-09-10 17:56:39 +08:00
Yuhang Zhao 33c3eaa05a win: add missing definitions for mingw
Fixes: #153
Fixes: #154

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-10 16:04:17 +08:00
Yuhang Zhao 34596db939 fix various issues found by user
Issue list:

1. MinGW lacks some definitions so there's compilation errors
2. The chrome buttons' foreground color is incorrect when the window is inactive.
3. Adapt to new macros from Qt dev branch.
4. Remove unneeded parameter from setApplicationOSThemeAware().

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-10 13:11:55 +08:00
Yuhang Zhao 6fe35a667e cmake: fix build error
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-07 13:44:08 +08:00
Yuhang Zhao 7dda58deaf free all resources during destruction
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-06 13:40:16 +08:00
Yuhang Zhao fb13ff1c1b improve macos experience [2/2]
Add support for old Qt version and old macOS version.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-06 11:31:07 +08:00
Yuhang Zhao f2a6d35908 improve macos code [1/2]
1. Simplify code a little
2. Use Qt functionalities as many as possible.
3. Prepare for adding old Qt support.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-05 16:55:55 +08:00
Yuhang Zhao b9f65aa783 add frameless dialog & demo
And some other minor fixes.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-05 15:00:02 +08:00
Yuhang Zhao 5018d9ea82 widget: add support for changing title font
Not needed for Qt Quick, because you can easily to change it:

```qml
StandardTitleBar {
    titleLabel {
        font {
            family: "Arial"
            pointSize: 10
            italic: true
        }
    }
}
```

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-02 10:39:45 +08:00
Yuhang Zhao ba343fbbd4 win: fix bug when using Qt 5.14 and below
Fixes: #152

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-01 16:45:32 +08:00
Yuhang Zhao 6b1a37a82a win: fix null pointer access in some rare cases
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-09-01 10:51:50 +08:00
Yuhang Zhao 7a35b09a74 add limited qmake support
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-31 16:34:30 +08:00
Yuhang Zhao abf4b29dca minor fixes of the last commit
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-31 10:45:26 +08:00
Yuhang Zhao 463ac0a999 add window icon support
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-31 10:21:24 +08:00
Yuhang Zhao e55afa2fe3 simplify a function
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-28 20:08:44 +08:00
Yuhang Zhao ce78c037b1 add some helper functionalities
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-28 19:25:22 +08:00
Yuhang Zhao 5195a27022 linux: adapt to latest qtbase changes
The X11 QPA has gained the ability to detect runtime theme changes in Qt 6.4.0

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-27 13:07:01 +08:00
Yuhang Zhao c3338cd9b7 win: don't use round corner when fullscreen on win11
Fixes: #149

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-26 15:54:56 +08:00
Yuhang Zhao 406c801383 Remove unneeded function
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-25 11:16:50 +08:00
Yuhang Zhao de3d5440db simplify code a little
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-22 18:02:03 +08:00
Yuhang Zhao f484209b94 win: fix round error on some systems
Fixes: #146

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-22 13:57:21 +08:00
Yuhang Zhao 6c060b3946 demo: add shortcut to switch between fullscreen state
Can also help use better debugging the old style window frame
issue on Windows.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-21 15:38:43 +08:00
Yuhang Zhao 1bce57445b win: use qt own functions more
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-19 10:53:46 +08:00
Yuhang Zhao a49756ee45 registrykey: rename
RegistryKey is a better name than Registry.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-17 10:42:48 +08:00
Yuhang Zhao 0535276f55 win: use Qt functionalities as much as possible
If Qt provides the functionalities we need, use it
instead of reinventing the wheel.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-16 15:24:14 +08:00
Yuhang Zhao 3dbeb2721a minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-06 12:01:12 +08:00
Yuhang Zhao beb16bfdc2 linux: minor improvement
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-04 10:32:32 +08:00
Yuhang Zhao 9343c7a088 macos: remove needless version check
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-08-03 09:41:29 +08:00
Yuhang Zhao f4f56498c2 win32: minor improvement
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-30 17:26:27 +08:00
Yuhang Zhao 775b1a2aab minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-30 11:34:14 +08:00
Yuhang Zhao cf83b050d2 common: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-29 15:36:28 +08:00
Yuhang Zhao 4fe67c9313 cmake: minor improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-27 09:36:28 +08:00
Yuhang Zhao 14a3440bbf win32: fix typo
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-25 09:35:02 +08:00
Yuhang Zhao 1264fe8341 minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-24 14:54:55 +08:00
Yuhang Zhao b2f443a592 cmake: minor tweaks of msvc flags
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-21 13:57:13 +08:00
Yuhang Zhao 56499c7028 fix the widget demo
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-18 15:16:06 +08:00
Yuhang Zhao 7616161699 Implement homemade Mica material & other improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-16 15:25:15 +08:00
Yuhang Zhao 7f9f2c8543 adapt to latest qt change
And install some missing files

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-13 10:40:29 +08:00
Yuhang Zhao 5e863ee661 cmake: fix include dir for package
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-12 14:58:20 +08:00
Yuhang Zhao b9d187d5f1 icon font: logic minor improvement
No need to bundle the Segoe icon font file,
the OS will always have them installed.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-12 14:00:49 +08:00
Yuhang Zhao b8fee2e732 support use different icon font based on current platform
And some other minor tweaks

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-11 10:55:05 +08:00
Yuhang Zhao 4f8106a009 minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-10 14:26:01 +08:00
Yuhang Zhao 2f36d1f73e blur behind window: add macos implementation
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-09 14:59:47 +08:00
Yuhang Zhao 7e3a735a7d minor tweaks and improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-09 12:10:41 +08:00
Yuhang Zhao 2a113ee8ab Allow build as a CMake package, support the install command
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-08 13:47:50 +08:00
Yuhang Zhao 9a93475f2b fix typo: snap layouts --> snap layout
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-07 17:00:15 +08:00
Yuhang Zhao 011b4a85f5 fix Qt5 build
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-07 16:22:34 +08:00
Yuhang Zhao 2806cc811b code simplification, minor re-structure
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-07 13:43:09 +08:00
VerySimple b413d0b1e6
修改了几个地方 (#139)
* merge 3 commits

modify a few lines

Update framelesshelper_windows.h

* improve syntax
2022-07-07 10:26:14 +08:00
Yuhang Zhao 01828e086f quick blur demo: fix typo
And minor improvements to the win32 utils code.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-06 18:01:24 +08:00
Yuhang Zhao 464e2af515 finish the chrome palette implementation
And with some other minor tweaks that improve user experience.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-06 14:24:41 +08:00
Yuhang Zhao e8dcb6e6fe add api to set title bar and chrome button color
TODO:
1. Special handling for the close button
2. Move QuickChromePalette class to own files
3. More testing

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-05 17:58:04 +08:00
Yuhang Zhao aed1673855 win32: remove the limit to the manifest file
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-05 10:36:34 +08:00
Yuhang Zhao df5ff50c7f win32: minor improvement
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-04 18:05:04 +08:00
Yuhang Zhao cbf34ea0ec win32: try to fix bug
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-04 13:03:23 +08:00
Yuhang Zhao 71f8a5aab1 add blurBehindWindowEnabled property
Current only implements for Windows,
macOS will be implemented later,
Linux won't be supported in the near future.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-03 16:01:19 +08:00
Yuhang Zhao f90b49538a add support for qmltc tool
Also remove one useless enum.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-07-01 15:52:28 +08:00
Yuhang Zhao 66250dbb6e cmake: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-27 14:15:34 +08:00
Yuhang Zhao 6683a183d7 cmake: a little simplification
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-27 10:00:23 +08:00
Yuhang Zhao 7b769a71a0 minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-26 14:57:18 +08:00
Yuhang Zhao a89f19af96 2.1.7 release
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-25 19:38:41 +08:00
Yuhang Zhao 75f19218c6 minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-24 21:38:26 +08:00
Yuhang Zhao 888f9d0aca standardsystembutton: use icon font instead of svg images
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-24 18:04:49 +08:00
Yuhang Zhao bfc7b27900 macos: minor improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-23 16:43:22 +08:00
Yuhang Zhao 7a65ce04ee win32: remove ATL dependency
Fixes: #136

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-20 17:14:16 +08:00
Yuhang Zhao 9cbfe495b7 win32: fix crash in rare cases
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-07 10:43:26 +08:00
Yuhang Zhao a04fd53a38 general improvements
1. replace raw char array with QByteArray
2. Register QWindow for Quick module
3. Account for hidden and disable state when hovering controls
4. fix quick title bar label alignment

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-06-01 11:16:34 +08:00
Yuhang Zhao 0cff5ff48e add "hideWhenClose" property
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-23 21:09:09 +08:00
Yuhang Zhao 093040ec93 make windowFixedSize a Qt property
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-23 15:17:34 +08:00
Yuhang Zhao 6fe3dd1088 cmake: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-23 14:46:20 +08:00
Yuhang Zhao 5754f2ec20 common: improve robustness
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-20 17:36:44 +08:00
Yuhang Zhao 44b3730056 quick: remove not used code
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-19 10:23:18 +08:00
Yuhang Zhao 6731007e35 quick: make sure top border stays on top
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-18 18:00:56 +08:00
Yuhang Zhao 06653433d7 win32: a little fix
Amends commit 8f31e67dae

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-18 09:34:00 +08:00
Yuhang Zhao 8f31e67dae win32: remove useless error checking
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-18 09:24:25 +08:00
Yuhang Zhao ff1605ee7b win32: fix crash caused by "isWindowFixedSize()"
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-16 10:09:23 +08:00
Yuhang Zhao 45be647baf win32: fix another issue related to hit test
This issue was hidden due to it's actually not executed.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-15 15:51:09 +08:00
Yuhang Zhao c2c6ef1976 win32: fix controls in the title bar area can't be hovered
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-15 14:29:21 +08:00
Yuhang Zhao 3a0e6f081f titlebar: allow use alternative background
Set this property to true if you want to use your own background color/pixmap
instead of system's current accent color.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-15 11:46:27 +08:00
Yuhang Zhao 1cd39fd7b2 quick: a little code simplification
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-14 10:02:42 +08:00
Yuhang Zhao 45b3657d7e minor tweaks
Doesn't seem to affect the final appearance

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-13 20:51:03 +08:00
Yuhang Zhao d13d74783f quick: simplify implementation
1. Merge the three system buttons into one class.
2. Fixed some color calculation errors of system button.
3. Removed some not used bundled resources.
4. Added function to retrieve runtime version of FramelessHelper.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-13 17:33:01 +08:00
Yuhang Zhao 8042a78b8f various fixes and improvements
1. Make all demo applications be able to record and restore the previous window geometry.
2. Improve the robustness of the widgets and quick implementation.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-13 14:19:50 +08:00
Julien 915e775d94
FIX: crash in isFixedSize when calling destructors (#131)
Fixes: #130

Co-authored-by: Julien Maille <julien.maille@data-pixel.com>
2022-05-13 11:05:11 +08:00
Yuhang Zhao 5c3b8b70df general: fix the system button background color in various cases
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-12 17:25:10 +08:00
Yuhang Zhao 8cb24c61b3 general improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-12 15:07:57 +08:00
Yuhang Zhao bebd20f01e win32: finish the fixed size fix
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-11 21:18:25 +08:00
Yuhang Zhao ab20f3433b remove useless code
And that also fixes the bug for Qt Quick applications

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-11 20:24:29 +08:00
Yuhang Zhao a1acc3e06f common: minor tweaks
Code simplification, format changes, etc ...

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-11 17:32:14 +08:00
Yuhang Zhao aad6957a52 win32: fix fixed size behavior
The code was from 2.0 and due to we changed solution in 2.1,
it needs to be tweaked accordingly but was forgotten.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-11 11:04:03 +08:00
Yuhang Zhao 059013a338 update readme
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-09 14:32:21 +08:00
Yuhang Zhao 54496f9fe0 lower warning level for msvc
Bug reports from users indicate that /W4 causes many
warnings for MSVC 2019 and the warnings come from
private Qt headers so no way to fix them in FramelessHelper.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-09 11:39:15 +08:00
Yuhang Zhao 66d77112ed win32: fix possible crash in some very rare cases
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-08 21:50:08 +08:00
Yuhang Zhao a10ac4e32d demos: simplify some code
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-08 18:24:09 +08:00
Yuhang Zhao c853cc63c6 re-fix wrong parameter for xcb
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-08 16:42:55 +08:00
Yuhang Zhao 053d6b104e centralize how we handle global options
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-08 16:09:00 +08:00
Yuhang Zhao 286811c9df expose private headers, someone may need
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-07 18:02:44 +08:00
Yuhang Zhao c936a7da80 minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-06 21:00:07 +08:00
Yuhang Zhao 196aeb1ce1 linux: minor fixes of the xcb usage
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-06 16:32:59 +08:00
Yuhang Zhao e7f434c5a4 demo: center window on first show
Looks better than before.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-05 20:23:35 +08:00
Yuhang Zhao 1c6e02d81b code tidies, prepare for the 2.1 release
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-05 18:02:38 +08:00
Yuhang Zhao cfb0842726 win: make sure we can still compile this project using some old windows sdks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-04 17:09:30 +08:00
Yuhang Zhao 9d71baffd1 remove the last piece of Qt internal classes
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-04 16:08:47 +08:00
Yuhang Zhao a97b1782ae redesign the title bar interface
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-04 14:50:11 +08:00
Yuhang Zhao 81e736570f refactor widgets interface
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-03 19:02:39 +08:00
Yuhang Zhao 306ebfc717 Refactor the Quick implementation, interface is now simpler
Now we use attached properties instead, it make things simpler.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-05-02 12:26:57 +08:00
Yuhang Zhao d6fa6a163e quick: fix build on Qt5
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-30 13:30:30 +08:00
Yuhang Zhao ff8252aaf4 Add initial snap layout implementation
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-30 12:47:51 +08:00
Yuhang Zhao fbe241f29e internal refactor
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-29 18:03:39 +08:00
Yuhang Zhao 2f629a9e5b Quick: make the titleBarItem become a property
By making it a Q_PROPERTY we can use it more conveniently.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-25 14:50:41 +08:00
Yuhang Zhao fd2b3f5e84 Linux: fix mouse release event not being sent due to wrong parameter
Also simplifies a little Windows implementation.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-25 13:48:19 +08:00
Yuhang Zhao 3d7576e062 macOS: remove the system buttons, fix implementation
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-24 21:03:46 +08:00
Yuhang Zhao 3c0209c979 Linux: fix the mouse grab issue, for real
Port previous workaround from 1.x to 2.0

And some minor tweaks.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-24 13:37:10 +08:00
Yuhang Zhao 2915d1f33a Widgets: move FramelessWidgetsHelper to source directory
It's pure implementation detail, so should not be publicly visible

Also fixed the crash of the QOpenGLWidget demo application.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-24 11:33:05 +08:00
Yuhang Zhao a0a9b8d108 Final code of version 2.0.0!
Some minor issues are known to exist and they'll get fixed before 2.1 is officially released.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-23 14:59:27 +08:00
Yuhang Zhao 8460995d7f quick module: minor improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-22 15:49:00 +08:00
Yuhang Zhao 201f54e7a5 widgets module: fix two issues
1. The top border has a one pixel gap under some circumstances, fixed
2. The zoomed property didn't get notified correctly sometimes, fixed

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-22 12:57:00 +08:00
Yuhang Zhao 3f17626c64 misc: minor tweaks
1. Finish the simple title bar of the QOpenGLWidget demo
2. Minor improvements of the Quick implementation

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-22 12:04:38 +08:00
Yuhang Zhao 130d174dc2 misc: improve old Qt version support
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-21 21:13:16 +08:00
Yuhang Zhao 701d8d0927 fix build on 5.12 & add initial opengl demo
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-21 15:10:16 +08:00
Yuhang Zhao cf4e4c331b macos: verify functionality
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-20 16:31:30 +08:00
Yuhang Zhao f2faf5dac3 linux: minor improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-20 15:26:25 +08:00
Yuhang Zhao b5eebada2c minor general improvement
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-20 13:09:11 +08:00
Yuhang Zhao b6e86f90e6 macos: fix build
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-19 17:13:07 +08:00
Yuhang Zhao d86e9144a2 general improvement
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-19 17:01:07 +08:00
Yuhang Zhao 68296cc1ae linux: update the implementation based on previous commit
When implementing macOS functionalities, some functions changed signature, update accordingly.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-18 19:11:23 +08:00
Yuhang Zhao 976b2463d7 win32: update changes from previous commit
Some functions changed signature, update accordingly.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-18 17:33:41 +08:00
Yuhang Zhao 5173fb51af macos: add initial implementation
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-18 16:56:58 +08:00
Yuhang Zhao dee635c0b9 misc: minor improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-17 21:09:24 +08:00
Yuhang Zhao bb42c69d36 linux: minor improvements
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-17 18:30:16 +08:00
Yuhang Zhao 45ebbee471 misc: minor format changes
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-17 17:29:22 +08:00
Yuhang Zhao 079c8ff6b6 misc: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-17 09:03:11 +08:00
Yuhang Zhao 2c0ec868ab finish the linux implementation
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-16 16:55:51 +08:00
Yuhang Zhao 859912ae25 misc: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-16 10:09:51 +08:00
Yuhang Zhao cd05b6ecdf quick: finish qml -> cpp migrating
Convert all qml files to pure c++ implementation.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-16 09:52:38 +08:00
Yuhang Zhao 4f5044a58c wip: quick: start migrating to modern usage
Still wip, but doesn't left much.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-14 17:33:09 +08:00
Yuhang Zhao d353c81c5e misc: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-14 10:22:57 +08:00
Yuhang Zhao a57011bd11 win32: half implementation of max btn docking
Now the problem is how to send mouse click events to our system buttons

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-09 12:53:55 +08:00
Yuhang Zhao c940bd5ce7 try to enable the win11 docking feature, but failed
It's really a headache. Maybe need to try another solution.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-07 15:51:58 +08:00
Yuhang Zhao 1839c968db finish the implementation of StandardSystemButton
Convenient button widget to emulate the standard system button

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-07 10:17:16 +08:00
Yuhang Zhao 4eac2b2970 implement TransparentWindowBackground option
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-06 13:15:29 +08:00
Yuhang Zhao e19dad5b82 some wip code
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-05 19:54:43 +08:00
Yuhang Zhao b5d2ae5888 quick: improve the standard titlebar's appearance
And some minor tweaks to the initialize() function.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-02 17:56:45 +08:00
Yuhang Zhao d4bacdcab6 quick: fix running on qt5
Previously Qt5 can't recognize the Anchor enum, it's fixed now.
Also rename framelesshelper_quick to framelessquickhelper, the
former name was to avoid conflict with an already removed class.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-02 13:07:26 +08:00
Yuhang Zhao 3a466492c2 win32: fix 32bit compilation failure, for real
I misunderstands the 32bit build failure in the previous
commit. The fix in the last commit didn't fix anything
but break the compilation on 32bit platforms.

Fixes: #109

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-02 09:56:32 +08:00
Yuhang Zhao eb1c6f4a62 win32: minor improvements
1. Fix build on 32bit platforms: the "Ptr" suffixed APIs not available on 32bit platforms
2. Reduce the confusion caused by the original "UseStandardWindowLayout" option
3. Minor tweaks of the quick implementation

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-01 20:06:48 +08:00
Yuhang Zhao be09197784 win32: fix the d2d crash on win7
The function signature was wrong so it crashed.
Now it won't crash anymore.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-01 15:46:52 +08:00
Yuhang Zhao 5c7434ea35 misc: refactor, take 2
add byte array literals handling

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-01 15:18:44 +08:00
Yuhang Zhao bde9c85cd9 cmake: add license headers
add some more license headers

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-01 14:36:36 +08:00
Yuhang Zhao 6166422e37 misc: internal refactor
centralize how we handle string literals.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-04-01 14:09:14 +08:00
Yuhang Zhao 3525dfee58 win32: nitpck: don't highlight the first entry of the system menu if brought by mouse
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-31 15:59:49 +08:00
Yuhang Zhao 92ab78e281 win32: nitpick
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-31 10:59:26 +08:00
Yuhang Zhao f13238312b win32: fix dark mode detection
global dark mode was first introduced in Win10 1607, not 1809
1809 was the first version that file explorer supported dark mode
really sorry for the wrong information

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-30 14:15:12 +08:00
Yuhang Zhao 90ad8d281a little simplify
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-30 13:16:19 +08:00
Julien 4af48d84b9
Fix "out of boundaries" line drawing (#106)
drawLine on [0, w-1]
2022-03-30 09:32:19 +08:00
Julien 06c23aaba5
FIX #92 do not call startSystemMove2 in MousePressEvent (#105)
* FIX #92 do not call startSystemMove2 in MousePressEvent

* Add same fix for QtQuick

Co-authored-by: Julien Maille <julien.maille@data-pixel.com>
2022-03-29 15:38:20 +08:00
Yuhang Zhao c49b971983 internal refactoring
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-29 13:34:05 +08:00
Yuhang Zhao d4e711d679 win implementation is mostly settled now
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-26 15:31:16 +08:00
Yuhang Zhao 533bbeac82 wip - QtQuick impl on win mostly done
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-25 15:44:59 +08:00
Yuhang Zhao fd3b815924 wip
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-03-24 16:37:37 +08:00