更改窗口双标题问题
This commit is contained in:
parent
5f7249c8e6
commit
919329ab00
|
@ -983,6 +983,11 @@ void Widget::slotShowMiniWidget()
|
||||||
m_miniWidget->update();
|
m_miniWidget->update();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (Global::isWayland) {
|
||||||
|
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||||
|
kdk::UkuiStyleHelper::self()->removeHeader((QWidget *)m_miniWidget);
|
||||||
|
}
|
||||||
|
|
||||||
m_miniWidget->setWindowOpacity(0);
|
m_miniWidget->setWindowOpacity(0);
|
||||||
m_miniWidget->showNormal();
|
m_miniWidget->showNormal();
|
||||||
m_miniWidget->activateWindow();
|
m_miniWidget->activateWindow();
|
||||||
|
@ -1005,21 +1010,27 @@ void Widget::slotClose()
|
||||||
|
|
||||||
void Widget::slotShowMinimized()
|
void Widget::slotShowMinimized()
|
||||||
{
|
{
|
||||||
this->showMinimized();
|
if (Global::isWayland) {
|
||||||
if(Minimize == true)
|
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||||
{
|
kdk::UkuiStyleHelper::self()->removeHeader((QWidget *)m_miniWidget);
|
||||||
this->showMaximized();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
this->showMinimized();
|
||||||
|
if(Minimize == true) {
|
||||||
|
this->showMaximized();
|
||||||
|
} else {
|
||||||
this->showNormal();
|
this->showNormal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::slotShowMaximized()
|
void Widget::slotShowMaximized()
|
||||||
{
|
{
|
||||||
if(Minimize)
|
if (Global::isWayland) {
|
||||||
{
|
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||||
|
kdk::UkuiStyleHelper::self()->removeHeader(m_miniWidget);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Minimize) {
|
||||||
showNormal();
|
showNormal();
|
||||||
Minimize = false;
|
Minimize = false;
|
||||||
m_titleBar->maximumBtn->setIcon(QIcon::fromTheme("window-maximize-symbolic"));
|
m_titleBar->maximumBtn->setIcon(QIcon::fromTheme("window-maximize-symbolic"));
|
||||||
|
@ -1027,13 +1038,10 @@ void Widget::slotShowMaximized()
|
||||||
m_titleBar->maximumBtn->setProperty("isWindowButton", 0x1);
|
m_titleBar->maximumBtn->setProperty("isWindowButton", 0x1);
|
||||||
m_titleBar->maximumBtn->setProperty("useIconHighlightEffect", 0x2);
|
m_titleBar->maximumBtn->setProperty("useIconHighlightEffect", 0x2);
|
||||||
m_titleBar->maximumBtn->setFlat(true);
|
m_titleBar->maximumBtn->setFlat(true);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
showMaximized();
|
showMaximized();
|
||||||
Minimize = true;
|
Minimize = true;
|
||||||
m_titleBar->maximumBtn->setIcon(QIcon::fromTheme("window-restore-symbolic"));
|
m_titleBar->maximumBtn->setIcon(QIcon::fromTheme("window-restore-symbolic"));
|
||||||
// maximumBtn->setToolTip(tr("还原"));
|
|
||||||
m_titleBar->maximumBtn->setToolTip(tr("reduction"));
|
m_titleBar->maximumBtn->setToolTip(tr("reduction"));
|
||||||
m_titleBar->maximumBtn->setProperty("isWindowButton", 0x1);
|
m_titleBar->maximumBtn->setProperty("isWindowButton", 0x1);
|
||||||
m_titleBar->maximumBtn->setProperty("useIconHighlightEffect", 0x2);
|
m_titleBar->maximumBtn->setProperty("useIconHighlightEffect", 0x2);
|
||||||
|
@ -1121,12 +1129,13 @@ void Widget::PlayPause() const
|
||||||
|
|
||||||
void Widget::slotRecoverNormalWidget()
|
void Widget::slotRecoverNormalWidget()
|
||||||
{
|
{
|
||||||
if(Minimize == true)
|
if (Global::isWayland) {
|
||||||
{
|
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||||
this->showMaximized();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if(Minimize == true) {
|
||||||
|
this->showMaximized();
|
||||||
|
} else {
|
||||||
this->showNormal();
|
this->showNormal();
|
||||||
}
|
}
|
||||||
m_miniWidget->hide();
|
m_miniWidget->hide();
|
||||||
|
|
|
@ -31,6 +31,10 @@ miniWidget::miniWidget(QWidget *parent) : QFrame(parent)
|
||||||
setFixedSize(300,60);
|
setFixedSize(300,60);
|
||||||
this->setObjectName("miniWidget");
|
this->setObjectName("miniWidget");
|
||||||
|
|
||||||
|
if (Global::isWayland) {
|
||||||
|
kdk::UkuiStyleHelper::self()->removeHeader(this);
|
||||||
|
}
|
||||||
|
|
||||||
m_mouseState = false;
|
m_mouseState = false;
|
||||||
setWindowFlags(Qt::WindowStaysOnTopHint);
|
setWindowFlags(Qt::WindowStaysOnTopHint);
|
||||||
// setWindowFlags(Qt::FramelessWindowHint|Qt::Tool|Qt::WindowStaysOnTopHint);
|
// setWindowFlags(Qt::FramelessWindowHint|Qt::Tool|Qt::WindowStaysOnTopHint);
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
#include "menumodule.h"
|
#include "menumodule.h"
|
||||||
#include "UI/mainwidget.h"
|
#include "UI/mainwidget.h"
|
||||||
#include "UI/base/xatom-helper.h"
|
#include "UI/base/xatom-helper.h"
|
||||||
|
#include "UIControl/global/global.h"
|
||||||
|
#include "ukuistylehelper/ukuistylehelper.h"
|
||||||
|
#include "windowmanager/windowmanager.h"
|
||||||
|
|
||||||
#define PT_14 14
|
#define PT_14 14
|
||||||
|
|
||||||
|
@ -198,11 +201,18 @@ void menuModule::helpAction(){
|
||||||
void menuModule::initAbout(){
|
void menuModule::initAbout(){
|
||||||
aboutWindow->setWindowModality(Qt::ApplicationModal);
|
aboutWindow->setWindowModality(Qt::ApplicationModal);
|
||||||
aboutWindow->setWindowFlag(Qt::Tool);
|
aboutWindow->setWindowFlag(Qt::Tool);
|
||||||
MotifWmHints hints;
|
|
||||||
hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS;
|
if (Global::isWayland) {
|
||||||
hints.functions = MWM_FUNC_ALL;
|
kdk::UkuiStyleHelper::self()->removeHeader(aboutWindow);
|
||||||
hints.decorations = MWM_DECOR_BORDER;
|
} else {
|
||||||
XAtomHelper::getInstance()->setWindowMotifHint(aboutWindow->winId(), hints);
|
MotifWmHints hints;
|
||||||
|
hints.flags = MWM_HINTS_FUNCTIONS|MWM_HINTS_DECORATIONS;
|
||||||
|
hints.functions = MWM_FUNC_ALL;
|
||||||
|
hints.decorations = MWM_DECOR_BORDER;
|
||||||
|
XAtomHelper::getInstance()->setWindowMotifHint(aboutWindow->winId(), hints);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
aboutWindow->setFixedSize(420,390);
|
aboutWindow->setFixedSize(420,390);
|
||||||
QVBoxLayout *mainlyt = new QVBoxLayout();
|
QVBoxLayout *mainlyt = new QVBoxLayout();
|
||||||
QHBoxLayout *titleLyt = initTitleBar();
|
QHBoxLayout *titleLyt = initTitleBar();
|
||||||
|
|
|
@ -3,6 +3,8 @@ kylin-music (1.1.0.47-ok6~0718) yangtze; urgency=medium
|
||||||
* [BUG]
|
* [BUG]
|
||||||
- close-cd: #127037, 解决音乐音量控件显示位置和窗口显示问题
|
- close-cd: #127037, 解决音乐音量控件显示位置和窗口显示问题
|
||||||
|
|
||||||
|
* 其他: 更改窗口双标题问题
|
||||||
|
|
||||||
-- yushuoqi <yushuoqi@kylinos.cn> Mon, 18 Jul 2022 11:25:08 +0800
|
-- yushuoqi <yushuoqi@kylinos.cn> Mon, 18 Jul 2022 11:25:08 +0800
|
||||||
|
|
||||||
kylin-music (1.1.0.47-ok5~0716) yangtze; urgency=medium
|
kylin-music (1.1.0.47-ok5~0716) yangtze; urgency=medium
|
||||||
|
|
Loading…
Reference in New Issue