更新部分样式和图标
修复最大化状态显示错误问题
2
res.qrc
@ -15,7 +15,7 @@
|
||||
<file>res/img/btn/btn_close.png</file>
|
||||
<file>res/img/btn/btn_max.png</file>
|
||||
<file>res/img/btn/btn_min.png</file>
|
||||
<file>res/img/btn/btn_restart_max.png</file>
|
||||
<file>res/img/btn/btn_max_restore.png</file>
|
||||
<file>res/qss/dark_style.qss</file>
|
||||
<file>res/qss/light_style.qss</file>
|
||||
|
||||
|
Before Width: | Height: | Size: 791 B After Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 469 B |
Before Width: | Height: | Size: 439 B After Width: | Height: | Size: 527 B |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 380 B |
BIN
res/img/btn/btn_max_restore.png
Normal file
After Width: | Height: | Size: 547 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 196 B |
Before Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 966 B After Width: | Height: | Size: 928 B |
Before Width: | Height: | Size: 752 B After Width: | Height: | Size: 735 B |
Before Width: | Height: | Size: 897 B After Width: | Height: | Size: 717 B |
Before Width: | Height: | Size: 886 B After Width: | Height: | Size: 868 B |
Before Width: | Height: | Size: 678 B After Width: | Height: | Size: 825 B |
@ -6,6 +6,8 @@ QWidget#m_widget{
|
||||
|
||||
QPushButton#btn_opt{
|
||||
image:url(:/res/img/xsteam.png);
|
||||
width:35px;
|
||||
height:35px;
|
||||
border:none;
|
||||
}
|
||||
|
||||
@ -93,20 +95,32 @@ QPushButton#btn_min,QPushButton#btn_max,QPushButton#btn_close{
|
||||
QPushButton#btn_min{
|
||||
image:url(":/res/img/btn/btn_min.png");
|
||||
border:none;
|
||||
width:20px;
|
||||
height:20px;
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
QPushButton#btn_max{
|
||||
image:url(":/res/img/btn/btn_max.png");
|
||||
border:none;
|
||||
width:20px;
|
||||
height:20px;
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
QPushButton#btn_max[maximizeProperty='maximize'] {
|
||||
image:url(":/res/img/btn/btn_max.png");
|
||||
border:none;
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
QPushButton#btn_max[maximizeProperty='restore'] {
|
||||
image:url(":/res/img/btn/btn_max_restore.png");
|
||||
border:none;
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
QPushButton#btn_close{
|
||||
image:url(":/res/img/btn/btn_close.png");
|
||||
border:none;
|
||||
width:20px;
|
||||
height:20px;
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
QPushButton#btn_min:hover,QPushButton#btn_max:hover,QPushButton#btn_close:hover{
|
||||
|
@ -6,6 +6,8 @@ QWidget#m_widget{
|
||||
|
||||
QPushButton#btn_opt{
|
||||
image:url(:/res/img/xsteam.png);
|
||||
width:35px;
|
||||
height:35px;
|
||||
border:none;
|
||||
}
|
||||
|
||||
@ -76,6 +78,18 @@ QPushButton#btn_max{
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
QPushButton#btn_max[maximizeProperty='maximize'] {
|
||||
image:url(":/res/img/btn/btn_max.png");
|
||||
border:none;
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
QPushButton#btn_max[maximizeProperty='restore'] {
|
||||
image:url(":/res/img/btn/btn_max_restore.png");
|
||||
border:none;
|
||||
width:25px;
|
||||
height:25px;
|
||||
}
|
||||
QPushButton#btn_close{
|
||||
image:url(":/res/img/btn/btn_close.png");
|
||||
border:none;
|
||||
|
@ -11,7 +11,6 @@ sui_title::sui_title(QWidget *parent)
|
||||
for (int i = 0; i <= m_btn_obj_str.count() - 1; i++)
|
||||
{
|
||||
QPushButton *btn=new QPushButton(this);
|
||||
btn->setFixedSize(35, 35);
|
||||
btn->setAutoFillBackground(true);
|
||||
btn->setFlat(true);
|
||||
btn->setObjectName(m_btn_obj_str[i]);
|
||||
@ -53,7 +52,7 @@ void sui_title::connect_slots()
|
||||
{
|
||||
for (auto btn : m_btn_vectors)
|
||||
{
|
||||
connect(btn, SIGNAL(clicked(bool)), this, SLOT(on_clicked()));
|
||||
connect(btn, SIGNAL(clicked(bool)), this, SLOT(slots_on_clicked()));
|
||||
}
|
||||
}
|
||||
void sui_title::btn_ico_menu()
|
||||
@ -236,7 +235,7 @@ void sui_title::mouseDoubleClickEvent(QMouseEvent *event)
|
||||
emit m_btn_vectors[2]->clicked();
|
||||
}
|
||||
// 进行最小化、最大化/还原、关闭操作
|
||||
void sui_title::on_clicked()
|
||||
void sui_title::slots_on_clicked()
|
||||
{
|
||||
if (sender()->objectName() == "btn_opt")
|
||||
{
|
||||
@ -249,6 +248,7 @@ void sui_title::on_clicked()
|
||||
else if (sender()->objectName() == "btn_max")
|
||||
{
|
||||
window()->isFullScreen() ? window()->showNormal() : window()->showFullScreen();
|
||||
up_maximize();
|
||||
}
|
||||
else if (sender()->objectName() == "btn_close")
|
||||
{
|
||||
@ -284,13 +284,14 @@ void sui_title::up_maximize()
|
||||
// 设置按钮的属性名为"maximizeProperty"
|
||||
m_btn_vectors[2]->setProperty("maximizeProperty", tr("maximize"));
|
||||
}
|
||||
m_btn_vectors[2]->setStyle(QApplication::style());
|
||||
m_btn_vectors[2]->style()->unpolish(m_btn_vectors[2]);
|
||||
m_btn_vectors[2]->style()->polish(m_btn_vectors[2]);
|
||||
}
|
||||
}
|
||||
void sui_title::set_type(QD_TYPE _type)
|
||||
{
|
||||
m_type = _type;
|
||||
if (m_type)
|
||||
if (m_type==QD_TYPE::QD_EXIT)
|
||||
{
|
||||
// 启动系统主题监听线程
|
||||
m_style = new sui_sys_style();
|
||||
@ -303,7 +304,7 @@ void sui_title::set_type(QD_TYPE _type)
|
||||
}
|
||||
else
|
||||
{
|
||||
disconnect(m_btn_vectors[0], SIGNAL(clicked(bool)), this, SLOT(btn_ico_menu()));
|
||||
disconnect(m_btn_vectors[0], SIGNAL(clicked(bool)), this, SLOT(slots_on_clicked()));
|
||||
}
|
||||
}
|
||||
void sui_title::set_title(QString str)
|
||||
|
@ -40,9 +40,6 @@ public:
|
||||
protected:
|
||||
//双击标题栏进行界面的最大化/还原
|
||||
void mouseDoubleClickEvent(QMouseEvent *event);
|
||||
private slots:
|
||||
//进行最小化、最大化/还原、关闭操作
|
||||
void on_clicked();
|
||||
private:
|
||||
//最大化/还原
|
||||
void up_maximize();
|
||||
@ -63,6 +60,7 @@ private:
|
||||
QStringList m_btn_obj_str={"btn_opt","btn_min","btn_max","btn_close"};
|
||||
QStringList m_btn_tips_str={"功能","最小化","最大化","关闭"};
|
||||
public slots:
|
||||
void slots_on_clicked();
|
||||
void slots_set_style_change();
|
||||
void slots_set_font_change();
|
||||
void slots_style_system();
|
||||
|
@ -163,19 +163,15 @@ void xsteam_ui::xsteam_init_foot_layout()
|
||||
state_tips_txt->setAlignment(Qt::AlignCenter);
|
||||
|
||||
btn_xs_download = new QPushButton();
|
||||
btn_xs_download->setMaximumSize(25, 25);
|
||||
btn_xs_download->setObjectName(tr("BTN_DOWNLOAD"));
|
||||
|
||||
btn_xs_sets = new QPushButton();
|
||||
btn_xs_sets->setMaximumSize(25, 25);
|
||||
btn_xs_sets->setObjectName(tr("BTN_SETS"));
|
||||
|
||||
btn_xs_update = new QPushButton();
|
||||
btn_xs_update->setMaximumSize(25, 25);
|
||||
btn_xs_update->setObjectName(tr("BTN_UPDATE"));
|
||||
|
||||
btn_xs_about = new QPushButton();
|
||||
btn_xs_about->setMaximumSize(25, 25);
|
||||
btn_xs_about->setObjectName(tr("BTN_ABOUT"));
|
||||
|
||||
foot_status_data_layout->addWidget(version_tips);
|
||||
|