更新所有窗口样式为sui

This commit is contained in:
JackLee_CN 2024-10-31 12:23:59 +08:00
parent 537944bf0c
commit ab1edfecdf
10 changed files with 30 additions and 16 deletions

View File

@ -16,7 +16,7 @@ sui::~sui()
void sui::init_layout() void sui::init_layout()
{ {
m_title=new sui_title(this); m_title=new sui_title(this);
m_title->set_title_txt(tr("XSteam")); m_title->set_title(tr("XSteam"));
setObjectName(tr("m_widget")); setObjectName(tr("m_widget"));
m_layout->addWidget(m_title); m_layout->addWidget(m_title);
m_title->setMouseTracking(true); m_title->setMouseTracking(true);

View File

@ -273,8 +273,9 @@ void sui_title::up_maximize()
void sui_title::set_type(QD_TYPE _type) void sui_title::set_type(QD_TYPE _type)
{ {
m_type = _type; m_type = _type;
disconnect(m_icon_button, SIGNAL(clicked(bool)), this, SLOT(slots_ico_menu()));
} }
void sui_title::set_title_txt(QString str) void sui_title::set_title(QString str)
{ {
m_title_label->setText(str); m_title_label->setText(str);
} }

View File

@ -30,7 +30,7 @@ class sui_title: public QWidget
public: public:
explicit sui_title(QWidget *parent = nullptr); explicit sui_title(QWidget *parent = nullptr);
~sui_title(); ~sui_title();
void set_title_txt(QString str); void set_title(QString str);
void set_type(QD_TYPE _type); void set_type(QD_TYPE _type);
protected: protected:
//双击标题栏进行界面的最大化/还原 //双击标题栏进行界面的最大化/还原

View File

@ -2,6 +2,7 @@
xsteam_about_ui::xsteam_about_ui() xsteam_about_ui::xsteam_about_ui()
{ {
m_widget=new QWidget();
m_Layout = new QVBoxLayout(); m_Layout = new QVBoxLayout();
f_Layout =new QHBoxLayout(); f_Layout =new QHBoxLayout();
copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved.")); copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved."));
@ -15,7 +16,8 @@ xsteam_about_ui::xsteam_about_ui()
load_about(); load_about();
setWindowTitle(tr("About XSteam")); setWindowTitle(tr("About XSteam"));
m_Layout->setContentsMargins(0, 0, 0, 0); m_Layout->setContentsMargins(0, 0, 0, 0);
setLayout(m_Layout); m_widget->setLayout(m_Layout);
layout()->addWidget(m_widget);
} }
xsteam_about_ui::~xsteam_about_ui() xsteam_about_ui::~xsteam_about_ui()
{ {

View File

@ -10,8 +10,8 @@
#include <QIODevice> #include <QIODevice>
#include <QLabel> #include <QLabel>
#include <version.h> #include <version.h>
#include "sui.h"
class xsteam_about_ui :public QDialog{ class xsteam_about_ui :public sui{
Q_OBJECT Q_OBJECT
public: public:
static xsteam_about_ui *Instance() static xsteam_about_ui *Instance()
@ -23,6 +23,8 @@ public:
if (!_instance) if (!_instance)
{ {
_instance = new xsteam_about_ui(); _instance = new xsteam_about_ui();
_instance->title()->set_type(QD_CLOSE);
_instance->title()->set_title(tr("XSteam关于"));
} }
mutex.unlock(); mutex.unlock();
} }
@ -35,6 +37,7 @@ private:
const xsteam_about_ui &operator=(const xsteam_about_ui &other); const xsteam_about_ui &operator=(const xsteam_about_ui &other);
static xsteam_about_ui* _instance; static xsteam_about_ui* _instance;
static QMutex mutex; static QMutex mutex;
QWidget* m_widget={};
QVBoxLayout* m_Layout={}; QVBoxLayout* m_Layout={};
QHBoxLayout* f_Layout={}; QHBoxLayout* f_Layout={};
QTextEdit* info={}; QTextEdit* info={};

View File

@ -10,7 +10,7 @@ xsteam_set_ui::~xsteam_set_ui()
} }
void xsteam_set_ui::init_set() void xsteam_set_ui::init_set()
{ {
setWindowTitle(tr("XSteam设置")); main_qwidget=new QWidget;
main_layout = new QVBoxLayout; main_layout = new QVBoxLayout;
foot_layout = new QHBoxLayout; foot_layout = new QHBoxLayout;
body_layout = new QVBoxLayout; body_layout = new QVBoxLayout;
@ -73,7 +73,8 @@ void xsteam_set_ui::init_set()
main_layout->setStretch(0, 8); main_layout->setStretch(0, 8);
main_layout->setStretch(1, 2); main_layout->setStretch(1, 2);
main_layout->setContentsMargins(5, 5, 5, 5); main_layout->setContentsMargins(5, 5, 5, 5);
setLayout(main_layout); main_qwidget->setLayout(main_layout);
layout()->addWidget(main_qwidget);
connect_slots(); connect_slots();
} }
void xsteam_set_ui::connect_slots(){ void xsteam_set_ui::connect_slots(){

View File

@ -1,7 +1,6 @@
#ifndef XSTEAM_SET_UI_H #ifndef XSTEAM_SET_UI_H
#define XSTEAM_SET_UI_H #define XSTEAM_SET_UI_H
#include <QDialog>
#include <QMutex> #include <QMutex>
#include <QLineEdit> #include <QLineEdit>
#include <QMutexLocker> #include <QMutexLocker>
@ -15,7 +14,8 @@
#include <QLabel> #include <QLabel>
#include "xsteam_base.h" #include "xsteam_base.h"
#include "xsteam_ex.h" #include "xsteam_ex.h"
class xsteam_set_ui :public QDialog{ #include "sui.h"
class xsteam_set_ui :public sui{
Q_OBJECT Q_OBJECT
public: public:
static xsteam_set_ui *Instance() static xsteam_set_ui *Instance()
@ -27,6 +27,8 @@ public:
if (!_instance) if (!_instance)
{ {
_instance = new xsteam_set_ui(); _instance = new xsteam_set_ui();
_instance->title()->set_type(QD_CLOSE);
_instance->title()->set_title(tr("XSteam设置"));
} }
mutex.unlock(); mutex.unlock();
} }
@ -41,6 +43,7 @@ private:
static QMutex mutex; static QMutex mutex;
void init_set(); void init_set();
void connect_slots(); void connect_slots();
QWidget* main_qwidget;
QVBoxLayout* main_layout; QVBoxLayout* main_layout;
QVBoxLayout* body_layout; QVBoxLayout* body_layout;
QHBoxLayout* foot_layout; QHBoxLayout* foot_layout;

View File

@ -1,7 +1,6 @@
#ifndef XSTEAM_SRC_EDIT_UI_H #ifndef XSTEAM_SRC_EDIT_UI_H
#define XSTEAM_SRC_EDIT_UI_H #define XSTEAM_SRC_EDIT_UI_H
#include <QDialog>
#include <QMutex> #include <QMutex>
#include <QGroupBox> #include <QGroupBox>
#include <QTableView> #include <QTableView>
@ -33,6 +32,7 @@ public:
{ {
_instance = new xsteam_src_edit_ui(); _instance = new xsteam_src_edit_ui();
_instance->title()->set_type(QD_CLOSE); _instance->title()->set_type(QD_CLOSE);
_instance->title()->set_title(tr("XSteam源地址管理"));
} }
mutex.unlock(); mutex.unlock();
} }

View File

@ -2,6 +2,7 @@
xsteam_update_ui::xsteam_update_ui() xsteam_update_ui::xsteam_update_ui()
{ {
m_widget=new QWidget();
m_Layout = new QVBoxLayout(); m_Layout = new QVBoxLayout();
f_Layout =new QHBoxLayout(); f_Layout =new QHBoxLayout();
copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved.")); copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved."));
@ -15,7 +16,8 @@ xsteam_update_ui::xsteam_update_ui()
load_about(); load_about();
setWindowTitle(tr("About XSteam")); setWindowTitle(tr("About XSteam"));
m_Layout->setContentsMargins(0, 0, 0, 0); m_Layout->setContentsMargins(0, 0, 0, 0);
setLayout(m_Layout); m_widget->setLayout(m_Layout);
layout()->addWidget(m_widget);
} }
xsteam_update_ui::~xsteam_update_ui() xsteam_update_ui::~xsteam_update_ui()
{ {

View File

@ -1,7 +1,6 @@
#ifndef XSTEAM_UPDATE_UI_H #ifndef XSTEAM_UPDATE_UI_H
#define XSTEAM_UPDATE_UI_H #define XSTEAM_UPDATE_UI_H
#include <QDialog>
#include <QMutex> #include <QMutex>
#include <QMutexLocker> #include <QMutexLocker>
#include <QVBoxLayout> #include <QVBoxLayout>
@ -10,8 +9,8 @@
#include <QIODevice> #include <QIODevice>
#include <QLabel> #include <QLabel>
#include <version.h> #include <version.h>
#include "sui.h"
class xsteam_update_ui :public QDialog{ class xsteam_update_ui :public sui{
Q_OBJECT Q_OBJECT
public: public:
static xsteam_update_ui *Instance() static xsteam_update_ui *Instance()
@ -23,6 +22,8 @@ public:
if (!_instance) if (!_instance)
{ {
_instance = new xsteam_update_ui(); _instance = new xsteam_update_ui();
_instance->title()->set_type(QD_CLOSE);
_instance->title()->set_title(tr("XSteam更新"));
} }
mutex.unlock(); mutex.unlock();
} }
@ -35,6 +36,7 @@ private:
const xsteam_update_ui &operator=(const xsteam_update_ui &other); const xsteam_update_ui &operator=(const xsteam_update_ui &other);
static xsteam_update_ui* _instance; static xsteam_update_ui* _instance;
static QMutex mutex; static QMutex mutex;
QWidget* m_widget={};
QVBoxLayout* m_Layout={}; QVBoxLayout* m_Layout={};
QHBoxLayout* f_Layout={}; QHBoxLayout* f_Layout={};
QTextEdit* info={}; QTextEdit* info={};