Commit Graph

227 Commits

Author SHA1 Message Date
Yuhang Zhao ac6a2c11a7 win: minor improvement
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-11-06 15:52:25 +08:00
Yuhang Zhao 9715bd9d4b minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-11-03 13:52:57 +08:00
Yuhang Zhao c75712d3f1 Add option to suppress debug messages
Fixes: #177

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-11-02 15:13:47 +08:00
trbogdanov 78638a3e23
call gtk_init() before gtk_settings_get_default() to avoid Q_ASSERT triggering (#173)
As stated in GTK documentation about gtk_init():

* "Call this function before using any other GTK+ functions in your GUI
applications. It will initialize everything needed to operate the toolkit
and parses some standard command line options."

* "It is possible to pass NULL if argv is not available or commandline
handling is not required."

Fixes: #170
2022-10-31 09:39:43 +08:00
Yuhang Zhao 4c88bc5ab2 Fix build error on macOS
Fixes: #174

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-29 18:52:39 +08:00
Yuhang Zhao 90116239cf win: minor tweaks
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-21 09:41:35 +08:00
Yuhang Zhao 53bf6016df win: simplify code a little
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2022-10-20 17:26:55 +08:00
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