Commit Graph

220 Commits

Author SHA1 Message Date
Yuhang Zhao af6d3c7380 win: minor tweaks
1. Avoid name collision of original Win SDK
2. Enable non-client area DPI scaling when building with Qt < 5.9.0

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-20 14:15:11 +08:00
Yuhang Zhao fe6fb8ef5f win: add new win10 subver
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-19 17:15:23 +08:00
Yuhang Zhao 439a5d569b fix issues found by ci
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-18 17:03:28 +08:00
Yuhang Zhao eb43a60094 cmake: use more strict qt
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-18 16:50:29 +08:00
Yuhang Zhao c29e6de2e1 try to fix ci
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-18 10:52:04 +08:00
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