update readme

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2022-03-25 16:16:03 +08:00
parent 533bbeac82
commit 389a342a81
14 changed files with 21 additions and 94 deletions

115
README.md
View File

@ -1,103 +1,30 @@
# FramelessHelper
# FramelessHelper 2.0
If you are using part of or all the code from this repository in your own projects, it's my pleasure and I'm happy that it can help you. But I hope you can tell me the URL of the homepage or repository of your projects, whether your projects are close-sourced or commercial products do not matter. I'll link to your homepage or repository in this README file. It would be much better if you can provide me some screenshots of your software for demonstration.
## Highlights compared to 1.x
如果您正在使用此项目的部分或全部代码,这是我的荣幸,我很高兴能帮到您,但我同时也希望,您能将您项目的首页或仓库的网址告诉我(闭源或收费都没关系),我将在这个自述文件中链接到您所提供的网址,以供展示。如果您能一并提供一些软件运行时的截图,那就更好了。
- Windows: Gained the ability to only remove the title bar but preserve the window frame at the same time.
- Windows: The flicker and jitter during window resizing is mostly gone. It will completely gone when DPI is 96.
- Windows: The system menu will be opened if you right-click on your custom title bar.
- Windows: Replaced Qt's original system menu with FramelessHelper's homemade one, which looks a lot better than the original one.
- Linux: Removed the limitation of the Qt version. The minimum supported version is Qt 5.6 now (previously was 5.15).
- macOS: Removed the limitation of the Qt version. The minimum supported version is Qt 5.6 now (previously was 5.15).
- macOS: The frameless window now supports native resizing.
- Common: Almost completely rewritten of the whole library, it's now a lot more easier to setup your own custom title bar than before.
- Common: Added many more helper functions to allow creating your own custom window easier.
- Misc: Reorganized the project structure to be more like a modern library, it's now a lot more friendly to the library users.
- Misc: Many bugs from the 1.x times are fixed (they were not fixable in 1.x due to technical reasons).
## Screenshots
## Current status
![Quick_Acrylic_Win7](/screenshots/quick_acrylic_win7.png)
Platform | Core Module | Widgets Module | Quick Module
--------- | ---------- | --------------- | -----------
Windows | done | done | mostly done
Linux | planned | planned | planned
macOS | planned | planned | planned
## Features
## Feedback
- Support Windows, X11, Wayland and macOS.
- Frameless but have frame shadow.
- Draggable and resizable.
- Automatically high DPI scaling.
- Multi-monitor support (different resolution and DPI).
- Have animations when minimizing, maximizing and restoring.
- Support tiled and stack windows by DWM (Win32 only).
- Won't cover the task bar when maximized (Win32 only).
- Won't block the auto-hide task bar when maximized (Win32 only).
## Usage
```cpp
#include "framelesswindowsmanager.h"
#include <QWidget>
int main(int argc, char *argv[]) {
QWidget widget;
// Qt's internal function. Make sure it's a top level window.
widget.createWinId();
// Do this before the widget is shown.
FramelessWindowsManager::addWindow(widget.windowHandle());
widget.show();
}
```
Please refer to [the QWidget example](/examples/widget/) for more detailed information.
### Some details
```cpp
// Only **TOP LEVEL** QWidgets and QWindows are supported.
QMainWindow *mainWindow = new QMainWindow;
// Qt's internal function. Make sure it's a top level window.
mainWindow->createWinId();
QWindow *win = mainWindow->windowHandle();
// Disable resizing of the given window. Resizing is enabled by default.
FramelessWindowsManager::setResizable(win, false);
// All the following values should not be DPI-aware, just use the
// original numbers, assuming the scale factor is 1.0, don't scale
// them yourself, this code will do the scaling according to DPI
// internally and automatically.
// Maximum window size
win->setMaximumSize(1280, 720);
// Minimum window size
win->setMinimumSize(800, 540);
// The **POINTER** of a QWidget or QQuickItem
FramelessWindowsManager::setHitTestVisibleInChrome(win, ui->pushButton_minimize, true);
```
## IMPORTANT NOTES
- For [QDockWidget](https://doc.qt.io/qt-6/qdockwidget.html), it supports set a custom title bar widget officially, no need to use this library, and this library is known to be not working well for QDockWidgets. Please refer to <https://doc.qt.io/qt-6/qdockwidget.html#setTitleBarWidget> for more details.
- Only top level windows ([QWindow](https://doc.qt.io/qt-6/qwindow.html) and [QWidget](https://doc.qt.io/qt-6/qwidget.html)) are supported.
- Win32: There are some known issues when DWM composition is disabled. This is unsupported and not tested and will not be fixed. However, PRs are always welcome.
- Win32: High DPI scaling must be enabled for your application otherwise some Win32 APIs may return wrong value and thus it may result in unexpected behavior.
## Supported Platforms
### Win32
Windows 7 ~ 10, 32 bit & 64 bit.
The code itself should be able to work on Windows Vista in theory, but Qt5 has dropped Vista support long time ago. And Qt6 will only support Win10.
### UNIX
A not too old version of Linux and macOS, 32 bit & 64 bit.
## Requirements
### Win32
| Component | Requirement | Additional Information |
| --- | --- | --- |
| Qt | >= 5.6 | Only the `core` and `gui` modules are required |
| Compiler | >= C++11 | MSVC, MinGW, Clang-CL, Intel-CL or cross compile from Linux/macOS are all supported |
### UNIX
| Component | Requirement | Additional Information |
| --- | --- | --- |
| Qt | >= 5.15 | This code uses two functions, [`startSystemMove`](https://doc.qt.io/qt-5/qwindow.html#startSystemMove) and [`startSystemResize`](https://doc.qt.io/qt-5/qwindow.html#startSystemResize), which are introduced in Qt 5.15 |
| Compiler | >= C++11 | MSVC, MinGW, Clang-CL, Intel-CL / GCC, Clang, ICC are all supported |
## Known Bugs
Please refer to <https://github.com/wangwenx190/framelesshelper/issues> for more information.
Please write down your feature requests and bug reports in here: <https://github.com/wangwenx190/framelesshelper/issues/104>, thanks!
## License

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1006 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 905 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB