窗口阴影与窗口置顶

This commit is contained in:
hewenfei 2023-04-06 09:28:37 +08:00
parent af4077b47c
commit cc999cd560
2 changed files with 17 additions and 3 deletions

View File

@ -9,7 +9,15 @@
int main(int argc, char *argv[])
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
// SideBarApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
#endif
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
#endif
QCoreApplication::setApplicationName("ukui-menu");
QCoreApplication::setOrganizationName("ukui");
QCoreApplication::setOrganizationDomain("ukui.org");

View File

@ -99,7 +99,7 @@ void WindowHelper::setWindowAttribute(QWindow *window)
}
// kwin
KWindowSystem::setType(window->winId(), NET::Notification);
KWindowSystem::setType(window->winId(), NET::Normal);
KWindowSystem::setState(window->winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
if (!QX11Info::isPlatformX11()) {
// wayland环境 设置跳过多任务视图设置跳过任务栏s
@ -240,8 +240,13 @@ void WindowGeometryHelper::updateGeometry()
int height = MenuSetting::instance()->get(MENU_HEIGHT).toInt();
int margin = MenuSetting::instance()->get(MENU_MARGIN).toInt();
width = width > screenRect.width() ? screenRect.width() : width;
height = height > screenRect.height() ? screenRect.height() : height;
if (width > screenRect.width()) {
width = screenRect.width();
}
if (height > screenRect.height()) {
height = screenRect.height();
}
//上: 1, 下: 0, 左: 2, 右: 3
switch (m_panelPos) {
@ -388,6 +393,7 @@ void MenuWindow::init()
setColor("transparent");
// setFlags(Qt::FramelessWindowHint);
setFlag(Qt::WindowStaysOnTopHint);
WindowHelper::setWindowAttribute(this);
WindowHelper::removeHeaderBar(this);
WindowHelper::windowBlur(this, true);