Commit Graph

329 Commits

Author SHA1 Message Date
Yuhang Zhao 74d865a3e3 Fix a multi-screen bug
Before this patch, the maximum size of a frameless window
will be limited to the primary screen's size if the user
doesn't set a maximum window size explicitly.

It works fine on single screen cases, however, if you have
multiple screens and when you are trying to resize the window
to some size bigger than the primary screen, such as expand
it from one screen to another, the window will refuse to
continue resizing after it reaches the primary screen's size.

The solution is simple and straightforward: if the user doesn't
set the maximum window size explicitly, just don't set the maximum
size to let it can be resized without any limitations.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-16 18:13:52 +08:00
Yuhang Zhao 8ca84fd435 Fix a regression.
If the user set a custom title bar height, just return
the original value, don't plus the border height afterwards,
this is not what the user would want.

But if we are querying the standard value, it should be
border height + caption height.

Border width and border height don't have this issue.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-16 17:15:06 +08:00
Yuhang Zhao 9cb3392ce4 Fix system metric is double scaled
Fixes: #36

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-14 20:42:16 +08:00
Yuhang Zhao 14556d8b2d Update documentation.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-14 17:41:17 +08:00
Yuhang Zhao c24fec11ab Add some useful information for developers
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-14 17:32:24 +08:00
Yuhang Zhao 9cd7e368de Minor improvement.
It turns out that the final title bar height contains
the border height as well.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-14 16:27:20 +08:00
Yuhang Zhao 1822333268 Remove unnecessary cast to QWidget.
TO BE VARIFIED!

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-14 10:22:38 +08:00
Yuhang Zhao 5fe936f631 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-13 09:56:11 +08:00
Yuhang Zhao ddef1cab43 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-12 21:20:20 +08:00
Yuhang Zhao 13e974a078 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-12 20:58:04 +08:00
Yuhang Zhao f35407ce5c Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-12 20:34:12 +08:00
Yuhang Zhao c783bc1fe2 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-12 11:34:41 +08:00
Yuhang Zhao f597b64f46 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-09 20:22:31 +08:00
Yuhang Zhao 1bf0d59efa Fix Qt5 and Qt6 build.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-07 00:29:36 +08:00
Yuhang Zhao fd3fb7deda Fix Qt6 build.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-06 10:31:19 +08:00
Yuhang Zhao d3152df01f UNIX: resize: fix wrong logic.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-05 20:19:04 +08:00
Yuhang Zhao b5e497e6ff UNIX: fall back to traditional way.
The startSystemMove and startSystemResize may
return false on some systems, just fallback to
use the old way to move and resize the window.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-05 18:25:44 +08:00
Yuhang Zhao d06a5ccab9
Merge pull request #31 from SBG-Systems/fix_dual_screen
Fix object detection with dual screen
2020-11-03 14:25:03 +08:00
Yuhang Zhao b1ddc5010d Fix build on old Qt versions.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-03 14:11:47 +08:00
Yuhang Zhao 9964d97374 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-30 16:18:38 +08:00
Yuhang Zhao f5a6493364 Minor improvements.
If there is a API, use API instead of reading registry.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-29 12:16:25 +08:00
Alexandre Petitjean bf2c085519 Fix object detection with dual screen 2020-10-28 17:06:06 +01:00
Yuhang Zhao c302bf331c Fix regression.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-26 18:12:51 +08:00
Yuhang Zhao 1cc4d92aca Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-26 17:36:40 +08:00
Yuhang Zhao be507e0475 Fix CMake builds.
Link to missing libraries.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-25 11:31:23 +08:00
Yuhang Zhao 10876e6f0b Fix DPI functions are link to system libraries directly.
Forgot to change them during refactor.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-25 11:26:06 +08:00
Yuhang Zhao 1c0e4a4657 Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-25 11:06:48 +08:00
Yuhang Zhao 7c255ea79e Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-25 09:57:11 +08:00
Yuhang Zhao 955961cf9b Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-24 23:45:23 +08:00
Yuhang Zhao c3d54c616d Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-23 19:04:52 +08:00
Yuhang Zhao 3a17359978 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-23 14:34:51 +08:00
Yuhang Zhao 9d4a3a453c Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-23 14:03:04 +08:00
Yuhang Zhao 286fc26d3f Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-23 12:47:37 +08:00
Yuhang Zhao 12923d9bbd Fix icon size again.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-22 21:59:09 +08:00
Yuhang Zhao 2e1075235c Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-22 19:55:13 +08:00
Yuhang Zhao b21f1023b5 Fix wrong size of the 3 system buttons.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-22 16:36:00 +08:00
Yuhang Zhao c82f2aa0f5 Update README
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-22 11:55:07 +08:00
Yuhang Zhao d671fd703d Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-22 11:49:30 +08:00
Yuhang Zhao 6a12cb1a30 Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-21 21:21:56 +08:00
Yuhang Zhao 19da037a77 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-21 19:48:41 +08:00
Yuhang Zhao 8c21be9e64 Fixed two issues.
1. The border color on Win10 when in light theme is also #707070, not pure white.
2. The brush color of the Acrylic effect is reversed before, it is now correct.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-21 11:10:51 +08:00
Yuhang Zhao f3e863e14b Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-20 23:26:03 +08:00
Yuhang Zhao a8f7fdef1d A little simplify.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-20 14:07:32 +08:00
Yuhang Zhao cde5ebcf8d Fix build on 5.12
Q_DISABLE_COPY_MOVE: since 5.13
QLatin1String arg: since 5.14

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-20 13:01:43 +08:00
Yuhang Zhao 17b35173ef Minor improvements to the Win32Demo project.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-20 09:55:20 +08:00
Yuhang Zhao 886f31d0c0 Fix two issues.
1. The border line may disappear when resizing: fixed by change the line width to 2px.
2. Some part of the window become totally transparent after DPI changes: fixed by calling update() after DPI changes.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-19 22:07:12 +08:00
Yuhang Zhao 47910161c9 Fix build for old Qt versions.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-19 18:24:38 +08:00
Yuhang Zhao af65f2d9e3 Link to system dlls by default.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-19 16:29:00 +08:00
Yuhang Zhao 72db8e7043 Improve the Win32Demo project.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-19 14:54:13 +08:00
Yuhang Zhao 396b7a2f69 Adapt to file rename.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-18 21:23:24 +08:00