Commit Graph

36 Commits

Author SHA1 Message Date
Yuhang Zhao 684b05ccad Simplify FramelessHelper code
Remove unused code.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-12-04 11:41:54 +08:00
Yuhang Zhao 84ce2eb418 Simplify the code a bit
There is a type called QObjectList already.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-20 20:52:12 +08:00
Yuhang Zhao 8e78e275e4 Add a cross-platform frameless window example
Written in pure Qt. Cross-platform.
Lacking the system features on Windows of course.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-19 12:20:11 +08:00
Yuhang Zhao bd60d9d1d2 Remove the widget and quick dependency for UNIX as well
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-18 12:07:29 +08:00
Yuhang Zhao b672851f51 Win32: Remove the dependency of the widgets and quick module
This commit totally removed the dependency of the widgets
and quick modules for the Windows platform. Now the library
itself only depends on the core and gui modules. Currently
no bug can be found. But there are some side effects: one is
we can't set a palette for a widget due to we can't access
QWidget specific functions so if you want to enable blur
effect, you will have to do this by yourself. Another one is
you now have to pass the window handle to WinNativeEventFilter
instead of the pointer of a QObject. Before this patch, I'm
using QWidget::winId() to get the window handle, now we have
get rid of the widgets dependency so I can't get the window
handle now, you have to pass it explicitly. And it leads to
huge refactoring of the whole repository. But I think it's
worth doing. If anyone knows how to get the window handle
without introducing new dependencies, please tell me. It will
help me a lot.

To remove the quick dependency, the FramelessQuickHelper class
is moved out of the library now. If your project needs it,
please copy the files to your project and include them directly.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-16 23:01:00 +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 f597b64f46 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-09 20:22:31 +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 1cc4d92aca Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-26 17:36:40 +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 c0de790138 Fix Linux build.
Signed-off-by: Yuhang Zhao  <2546789017@qq.com>
2020-10-18 14:15:13 +08:00
Yuhang Zhao 904bbb8576 Remove QPointer usages.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-15 21:06:58 +08:00
Yuhang Zhao 5fc425fc64 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-14 18:36:13 +08:00
Yuhang Zhao 12253c8a50 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-10 12:41:43 +08:00
Yuhang Zhao a36e4fb81b Fix build with Qt6
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-08 09:46:57 +08:00
Yuhang Zhao 43012e2681 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-08-01 11:45:12 +08:00
Yuhang Zhao 1cd1b0cc2b Adapt to Qt6 changes, again.
Forgot to change this file.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-07-26 09:33:41 +08:00
Yuhang Zhao 807dda608e Adapt to new style.
1. Use QList instead of QVector because QVector will become an alias of QList since Qt6.
2. Don't use *const because the account of const is too large.
3. New style applied, by Clang Format.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-06-27 14:19:09 +08:00
Yuhang Zhao 8ec1cfcf35 Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-23 21:52:40 +08:00
Yuhang Zhao d28e3d167c Add a way to ignore title bar.
If a window is in fullscreen mode, it should not have a title bar.

Maybe a rare use case, but better than nothing.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-17 17:35:09 +08:00
Yuhang Zhao 86269c82b3 Avoid name conflicts.
They can be compiled but to reduce confusion, let change their names.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-13 13:19:27 +08:00
Yuhang Zhao 921b87ab2e Minor improvements.
Use global screen coordinates instead of local window coordinates to get more reliable hit test result.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-13 12:56:03 +08:00
Yuhang Zhao 2ca6a90ae2 Add a Qt Quick helper class.
It's much easier to use it in Qt Quick now.

Fixes: #11

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-12 20:53:53 +08:00
Yuhang Zhao 48ff3280b1 UNIX helper: Use QSize instead of QRect
We only need the size, not the geometry.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-11 12:50:07 +08:00
Yuhang Zhao a34834c3f7 Fix bugs in UNIX helper.
Found during using it in a real project.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-10 20:24:11 +08:00
Yuhang Zhao 57d2667c5e Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-09 13:13:42 +08:00
Yuhang Zhao ae62a8fb49 Minor improvements.
Move the moveWindowToDesktopCenter function to FramelessHelper.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-09 11:33:20 +08:00
Yuhang Zhao 0fe297b5e4 Add UNIX helper back.
With some improvements.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-08 21:07:44 +08:00
Yuhang Zhao 7753161f9f Add Qt Quick example.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-08 14:19:41 +08:00
Yuhang Zhao 4e1d324100 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-04-17 21:39:36 +08:00
Yuhang Zhao eefb3feb44 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-04-12 20:54:58 +08:00
Yuhang Zhao bffcc2829a Fix build with MSVC.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-04-09 19:36:39 +08:00
Yuhang Zhao c1fddf0028 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-04-06 12:12:32 +08:00
Yuhang Zhao df6b381006 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-04-05 17:21:18 +08:00
Yuhang Zhao cdd8ca2e84 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-04-04 22:20:02 +08:00