wangwenx190 / framelesshelper

Project moved to: https://github.com/stdware/qwindowkit Cross-platform window customization framework for Qt Widgets and Qt Quick. Supports Windows, Linux and macOS.
MIT License
846 stars 202 forks source link

[ATTENTION] The next major release - 2.0 early feedback #104

Closed wangwenx190 closed 2 years ago

wangwenx190 commented 2 years ago

Please don't hesitate to tell me your feature requests and any bugs you have found! Thanks!

ifpelset commented 2 years ago

问题描述:MainWindow demo中清空centeralWidget,添加QOpenGLWidget控件,初次最大化窗口时出现白色背景闪烁。 代码分支:wip 操作系统:Windows 10 Qt版本:5.12 布局截图: 123

wangwenx190 commented 2 years ago

@ifpelset 好的,收到了。我这边自己搞一个OpenGLWidget的demo试试看。

xland commented 2 years ago

WIN10 FramelessHelper2.0 Qt6.3.0

高分屏下窗口右上角有1个像素的空白 image

窗口处于Active状态时顶边颜色与其他三边的颜色不同 image

wangwenx190 commented 2 years ago

@xland 第一个问题知道了,好解决。第二个问题不应该,你这是widget程序吧,顶边的颜色应该是主题色才对。你看看DwmGetColorizationColor获取到的颜色是否是你设置的主题色。文档:https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/nf-dwmapi-dwmgetcolorizationcolor。如果不是的话跟我反馈下,我这边调整调整。

xland commented 2 years ago

@wangwenx190

我是用的Widget程序

我的主题颜色确实是蓝色,但为什么顶边的颜色是黑色,我用DwmGetColorizationColor得到的color值为3808456647

另外,您有没有发现上图中顶边的黑色边框与titlebar的灰色背景之间还有一条极细的白边

    DWORD color = 0;  //3808456647
    BOOL opaque = FALSE;
    HRESULT hr = DwmGetColorizationColor(&color, &opaque);

image

image

wangwenx190 commented 2 years ago

@xland 好的。你能不能看看你注册表的以下键值: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorPrevalence是0还是1 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\ColorPrevalence是0还是1 另外,你系统具体的版本号是多少?就是10.0.xxx这个版本号,可以用cmd或者winver直接看,设置的关于里也有

wangwenx190 commented 2 years ago

白边是布局导致的,从截图里看应该是没有顶到头,可能需要稍微调整下布局

xland commented 2 years ago

@wangwenx190

HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorPrevalence值为0 HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize\ColorPrevalence值为0

以下是我在mainwindow里设置TitleBar的代码,感觉布局上应该没啥问题,或者我有遗漏的地方,请不吝赐教。

    ui.setupUi(this);
    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->setContentsMargins(0, 0, 0, 0);
    layout->setSpacing(0);
    layout->setStretch(0, 0);
    ui.centralWidget->setLayout(layout);
    TopBar* topBar = new TopBar(this);  //这是一个自定义Widget,里面没啥代码
    layout->addWidget(topBar);
    layout->addStretch();
    setTitleBarWidget(topBar);

方便的话加我微信,liulun18158135758,沟通方便一些

wangwenx190 commented 2 years ago

FramelessHelper 2.0.0 is now officially released! Big thanks to everyone! Some minor issues are known to exist and they'll get fixed before 2.1 is offically released. The 2.1 roadmap can be seen on the README file. Please don't hesitate to tell me your feature requests! Bug reports are also welcome!

wangwenx190 commented 2 years ago

@xland 注册表的值不对,所以顶边的颜色错了,你得说一下你的Windows版本号,10.0.xxx这种格式的。我说的布局问题是我内部设置了widget的布局,你自己创建的布局本身就已经在我设置的布局内部了,所以你那边修改布局是没用的。微信可以加。