窗口阴影与窗口置顶
This commit is contained in:
parent
af4077b47c
commit
cc999cd560
|
@ -9,7 +9,15 @@
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
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_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::setApplicationName("ukui-menu");
|
||||||
QCoreApplication::setOrganizationName("ukui");
|
QCoreApplication::setOrganizationName("ukui");
|
||||||
QCoreApplication::setOrganizationDomain("ukui.org");
|
QCoreApplication::setOrganizationDomain("ukui.org");
|
||||||
|
|
|
@ -99,7 +99,7 @@ void WindowHelper::setWindowAttribute(QWindow *window)
|
||||||
}
|
}
|
||||||
|
|
||||||
// kwin
|
// kwin
|
||||||
KWindowSystem::setType(window->winId(), NET::Notification);
|
KWindowSystem::setType(window->winId(), NET::Normal);
|
||||||
KWindowSystem::setState(window->winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
|
KWindowSystem::setState(window->winId(), NET::SkipTaskbar | NET::SkipPager | NET::SkipSwitcher);
|
||||||
if (!QX11Info::isPlatformX11()) {
|
if (!QX11Info::isPlatformX11()) {
|
||||||
// wayland环境 设置跳过多任务视图,设置跳过任务栏s
|
// wayland环境 设置跳过多任务视图,设置跳过任务栏s
|
||||||
|
@ -240,8 +240,13 @@ void WindowGeometryHelper::updateGeometry()
|
||||||
int height = MenuSetting::instance()->get(MENU_HEIGHT).toInt();
|
int height = MenuSetting::instance()->get(MENU_HEIGHT).toInt();
|
||||||
int margin = MenuSetting::instance()->get(MENU_MARGIN).toInt();
|
int margin = MenuSetting::instance()->get(MENU_MARGIN).toInt();
|
||||||
|
|
||||||
width = width > screenRect.width() ? screenRect.width() : width;
|
if (width > screenRect.width()) {
|
||||||
height = height > screenRect.height() ? screenRect.height() : height;
|
width = screenRect.width();
|
||||||
|
}
|
||||||
|
if (height > screenRect.height()) {
|
||||||
|
height = screenRect.height();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//上: 1, 下: 0, 左: 2, 右: 3
|
//上: 1, 下: 0, 左: 2, 右: 3
|
||||||
switch (m_panelPos) {
|
switch (m_panelPos) {
|
||||||
|
@ -388,6 +393,7 @@ void MenuWindow::init()
|
||||||
setColor("transparent");
|
setColor("transparent");
|
||||||
|
|
||||||
// setFlags(Qt::FramelessWindowHint);
|
// setFlags(Qt::FramelessWindowHint);
|
||||||
|
setFlag(Qt::WindowStaysOnTopHint);
|
||||||
WindowHelper::setWindowAttribute(this);
|
WindowHelper::setWindowAttribute(this);
|
||||||
WindowHelper::removeHeaderBar(this);
|
WindowHelper::removeHeaderBar(this);
|
||||||
WindowHelper::windowBlur(this, true);
|
WindowHelper::windowBlur(this, true);
|
||||||
|
|
Loading…
Reference in New Issue