🐞 fix(UI模块): 添加最大化选项悬浮提示
https://gitee.com/openkylin/kylin-connectivity/issues/I7260C
This commit is contained in:
parent
b20c80a157
commit
71903ac4e3
|
@ -731,40 +731,45 @@
|
|||
<context>
|
||||
<name>Titlebar</name>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="182"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="186"/>
|
||||
<source>Menu</source>
|
||||
<translation>འདེམས་ཚན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="42"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="44"/>
|
||||
<source>kylin-connectivity</source>
|
||||
<translation>སྣེ་མང་མཐུན་སྦྱོར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="54"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="56"/>
|
||||
<source>Minimize</source>
|
||||
<translation>ཆེས་ཆུང་ཅན་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="72"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="66"/>
|
||||
<source>Maximize</source>
|
||||
<translation>ཆེ་ཤོས་སུ་སྒྱུར་བ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="76"/>
|
||||
<source>Close</source>
|
||||
<translation>སྒོ་རྒྱག་པ་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="199"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="239"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="203"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="243"/>
|
||||
<source>Help</source>
|
||||
<translation>རོགས་རམ།</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="200"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="241"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="204"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="245"/>
|
||||
<source>About</source>
|
||||
<translation>སྐོར་</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="201"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="243"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="205"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="247"/>
|
||||
<source>Quit</source>
|
||||
<translation>ཕྱིར་འབུད་</translation>
|
||||
</message>
|
||||
|
|
|
@ -1134,40 +1134,45 @@
|
|||
<translation type="vanished">Search</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="182"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="186"/>
|
||||
<source>Menu</source>
|
||||
<translation>Menu</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="42"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="44"/>
|
||||
<source>kylin-connectivity</source>
|
||||
<translation>kylin-connectivity</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="54"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="56"/>
|
||||
<source>Minimize</source>
|
||||
<translation>Minimize</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="72"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="66"/>
|
||||
<source>Maximize</source>
|
||||
<translation>Maximize</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="76"/>
|
||||
<source>Close</source>
|
||||
<translation>Close</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="199"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="239"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="203"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="243"/>
|
||||
<source>Help</source>
|
||||
<translation>Help</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="200"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="241"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="204"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="245"/>
|
||||
<source>About</source>
|
||||
<translation>About</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="201"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="243"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="205"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="247"/>
|
||||
<source>Quit</source>
|
||||
<translation>Quit</translation>
|
||||
</message>
|
||||
|
|
|
@ -1097,40 +1097,45 @@
|
|||
<translation type="vanished">搜索</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="182"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="186"/>
|
||||
<source>Menu</source>
|
||||
<translation>选项</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="42"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="44"/>
|
||||
<source>kylin-connectivity</source>
|
||||
<translation>多端协同</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="54"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="56"/>
|
||||
<source>Minimize</source>
|
||||
<translation>最小化</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="72"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="66"/>
|
||||
<source>Maximize</source>
|
||||
<translation>最大化</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="76"/>
|
||||
<source>Close</source>
|
||||
<translation>关闭</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="199"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="239"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="203"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="243"/>
|
||||
<source>Help</source>
|
||||
<translation>帮助</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="200"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="241"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="204"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="245"/>
|
||||
<source>About</source>
|
||||
<translation>关于</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../ui/view/titlebar.cpp" line="201"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="243"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="205"/>
|
||||
<location filename="../ui/view/titlebar.cpp" line="247"/>
|
||||
<source>Quit</source>
|
||||
<translation>退出</translation>
|
||||
</message>
|
||||
|
|
|
@ -18,7 +18,9 @@ Titlebar::Titlebar(QWidget *parent) : QWidget(parent)
|
|||
connectInit();
|
||||
}
|
||||
|
||||
Titlebar::~Titlebar() {}
|
||||
Titlebar::~Titlebar()
|
||||
{
|
||||
}
|
||||
|
||||
void Titlebar::initUI()
|
||||
{
|
||||
|
@ -36,7 +38,7 @@ void Titlebar::initUI()
|
|||
m_titleIcon->setContentsMargins(8, 8, 8, 8);
|
||||
|
||||
m_minBtn = new QPushButton(this);
|
||||
m_maxBtn = new QPushButton();
|
||||
m_maxBtn = new QPushButton(this);
|
||||
m_closeBtn = new QPushButton(this);
|
||||
|
||||
m_titleNameLab->setText(tr("kylin-connectivity"));
|
||||
|
@ -60,6 +62,8 @@ void Titlebar::initUI()
|
|||
m_maxBtn->setProperty("useIconHighlightEffect", 0x2);
|
||||
m_maxBtn->setFlat(true);
|
||||
m_maxBtn->setContentsMargins(4, 0, 4, 0);
|
||||
m_maxBtn->setFocusPolicy(Qt::NoFocus);
|
||||
m_maxBtn->setToolTip(tr("Maximize"));
|
||||
// 关闭按钮
|
||||
m_closeBtn->setIcon(QIcon::fromTheme("window-close-symbolic"));
|
||||
m_closeBtn->setFixedSize(BTN_SIZE, BTN_SIZE);
|
||||
|
@ -118,12 +122,12 @@ void Titlebar::setTheme(PublicAttributes::Theme theme)
|
|||
m_theme = theme;
|
||||
if (m_isDefault) {
|
||||
switch (m_theme) {
|
||||
case PublicAttributes::Theme::Light: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #FFFFFF;}");
|
||||
} break;
|
||||
case PublicAttributes::Theme::Dark: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #1D1D1D;}");
|
||||
} break;
|
||||
case PublicAttributes::Theme::Light: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #FFFFFF;}");
|
||||
} break;
|
||||
case PublicAttributes::Theme::Dark: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #1D1D1D;}");
|
||||
} break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,12 +137,12 @@ void Titlebar::setBackground(bool isDefault)
|
|||
m_isDefault = isDefault;
|
||||
if (isDefault) {
|
||||
switch (m_theme) {
|
||||
case PublicAttributes::Theme::Light: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #FFFFFF;}");
|
||||
} break;
|
||||
case PublicAttributes::Theme::Dark: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #1D1D1D;}");
|
||||
} break;
|
||||
case PublicAttributes::Theme::Light: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #FFFFFF;}");
|
||||
} break;
|
||||
case PublicAttributes::Theme::Dark: {
|
||||
setStyleSheet("QWidget#titlebar{background-color: #1D1D1D;}");
|
||||
} break;
|
||||
}
|
||||
} else {
|
||||
setAttribute(Qt::WA_StyledBackground);
|
||||
|
|
Loading…
Reference in New Issue