更新部分样式和图标

修复最大化状态显示错误问题
This commit is contained in:
JackLee_CN 2024-11-07 12:27:03 +08:00
parent 8678fb6978
commit 6e346d0fbb
18 changed files with 44 additions and 21 deletions

View File

@ -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>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 791 B

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 469 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 439 B

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 380 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 928 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 752 B

After

Width:  |  Height:  |  Size: 735 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 897 B

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 886 B

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 825 B

View File

@ -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{

View File

@ -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;

View File

@ -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)

View File

@ -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();

View File

@ -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);