Commit Graph

25 Commits

Author SHA1 Message Date
Yuhang Zhao cdb7b87eb4 Remove acrylic related things
They'll be moved to a separate repo instead

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2021-04-02 12:02:46 +08:00
Yuhang Zhao ecd1a2312c Remove useless code
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2021-03-16 09:22:19 +08:00
Yuhang Zhao 21774f9fbc Disable dynamic switching of Acrylic blur and wallpaper blur
After some testing, it's found that it's not reliable.
Maybe we should use another windows message to do this?
To be investigated.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2021-03-11 09:20:09 +08:00
Yuhang Zhao c9be4858ec Use the official Acrylic blur whenever possible
And switch back to the wallpaper blur when the window is being moved or resized.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2021-03-10 17:28:48 +08:00
Yuhang Zhao 0931b73671 Some refactor
Rename some functions to make it more clear.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2021-03-10 10:05:23 +08:00
Yuhang Zhao 21f1f69684 Use wallpaper blur by default
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2021-03-08 21:10:11 +08:00
Yuhang Zhao f70158a276 Add cross-platform Acrylic Effect
Currently still lacking Linux and macOS support,
but will be added sooner.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2021-03-08 14:10:55 +08:00
Yuhang Zhao 68bc4c31ed Cleanup
WinNativeEventFilter:
1. Removed all unused functions and macros.
Win32 API prototypes are not touched because
we may still need them in the future.
2. Don't store data through SetWindowLongPtrW,
using dynamic properties of QWindow instead.
People may rely on GetWindowLongPtrW(hwnd, GWLP_USERDATA)
to do their own work.
3. Some helper functions are removed, such as
moveWindowToDesktopCenter(). You can implement them
yourself. Keep them in the source code will keep
pulling in new dependencies so I have to get rid
of them.
4. Some blocks are removed, such as WM_GETMINMAXIINFO.
It's not needed. You can call Qt's standard API now,
such as setMaximumSize() and setMinimumSize().

FramelessQuickHelper:
1. Removed all functions that can be replaced by Qt's
own API, such as setMaximumSize() and setMinimumSize().
2. Removed helper functions, such as moveWindowToDesktopCenter().
You can implement them yourself. Just few lines of code.

FramelessWindowsManager:
Adapt to the above changes.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-28 11:54:56 +08:00
Yuhang Zhao 137019f7e6 Refactor
Use QWindow pointer on all platforms.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-17 15:08:39 +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 c783bc1fe2 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-11-12 11:34:41 +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 955961cf9b Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-24 23:45:23 +08:00
Yuhang Zhao 5fc425fc64 Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-14 18:36:13 +08:00
Yuhang Zhao 7cc51b8c2e Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-10-10 11:29:33 +08:00
Yuhang Zhao c9e38491ae Update.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-08-13 16:29:12 +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 a2fde746f5 Minor improvements.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-24 21:26:44 +08:00
Yuhang Zhao e401db219d Add a few more functions to the quick helper.
Maybe useful.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-24 20:54:13 +08:00
Yuhang Zhao 066650f824 Minor tweaks.
Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-22 12:19:12 +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 d8e07b86c4 Add moveWindowToDesktopCenter to the quick helper.
It may be useful for Qt Quick users.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-13 21:24:51 +08:00
Yuhang Zhao b216f18b35 Add functions to set max/min size of window to the quick helper.
They may be useful as well.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
2020-05-13 16:52:47 +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