mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-23 11:32:21 +08:00
优化 UI
This commit is contained in:
parent
e0639a5855
commit
f723007166
@ -38,8 +38,10 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ](DGuiApplicationHelper::ColorType themeType) {
|
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [ = ](DGuiApplicationHelper::ColorType themeType) {
|
||||||
if(themeType==DGuiApplicationHelper::DarkType){
|
if(themeType==DGuiApplicationHelper::DarkType){
|
||||||
qDebug()<<"Dark";
|
qDebug()<<"Dark";
|
||||||
|
w->setTheme(true);
|
||||||
}else {
|
}else {
|
||||||
qDebug()<<"White";
|
qDebug()<<"White";
|
||||||
|
w->setTheme(false);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// if(DGuiApplicationHelper::instance()-==DGuiApplicationHelper::ColorType::LightType){
|
// if(DGuiApplicationHelper::instance()-==DGuiApplicationHelper::ColorType::LightType){
|
||||||
|
18
widget.cpp
18
widget.cpp
@ -79,8 +79,8 @@ void Widget::initUI()
|
|||||||
//初始化分界线
|
//初始化分界线
|
||||||
QGraphicsOpacityEffect *opacityEffect_1=new QGraphicsOpacityEffect;
|
QGraphicsOpacityEffect *opacityEffect_1=new QGraphicsOpacityEffect;
|
||||||
QGraphicsOpacityEffect *opacityEffect_2=new QGraphicsOpacityEffect;
|
QGraphicsOpacityEffect *opacityEffect_2=new QGraphicsOpacityEffect;
|
||||||
opacityEffect_1->setOpacity(0.2);
|
opacityEffect_1->setOpacity(0.1);
|
||||||
opacityEffect_2->setOpacity(0.2);
|
opacityEffect_2->setOpacity(0.1);
|
||||||
ui->line1_widget->setGraphicsEffect(opacityEffect_1);
|
ui->line1_widget->setGraphicsEffect(opacityEffect_1);
|
||||||
ui->line2_widget->setGraphicsEffect(opacityEffect_2);
|
ui->line2_widget->setGraphicsEffect(opacityEffect_2);
|
||||||
|
|
||||||
@ -113,9 +113,10 @@ void Widget::initUI()
|
|||||||
m_loadweb->hide();
|
m_loadweb->hide();
|
||||||
m_loaderror->hide();
|
m_loaderror->hide();
|
||||||
m_loadweb->start();
|
m_loadweb->start();
|
||||||
m_loadweb->setMaximumSize(30,30);
|
m_loadweb->setMaximumSize(50,50);
|
||||||
|
m_loadweb->setMinimumSize(50,50);
|
||||||
m_loadweb->setTextVisible(false);
|
m_loadweb->setTextVisible(false);
|
||||||
m_loaderror->setPixmap(QIcon::fromTheme("dialog-error").pixmap(60,60));
|
m_loaderror->setPixmap(QIcon::fromTheme("dialog-error").pixmap(50,50));
|
||||||
m_loaderror->setAlignment(Qt::AlignCenter);
|
m_loaderror->setAlignment(Qt::AlignCenter);
|
||||||
|
|
||||||
ui->webView->setLayout(m_weblayout);
|
ui->webView->setLayout(m_weblayout);
|
||||||
@ -694,6 +695,15 @@ void Widget::openUrl(QUrl u)
|
|||||||
ui->webView->setUrl(app);
|
ui->webView->setUrl(app);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Widget::setTheme(bool isDark)
|
||||||
|
{
|
||||||
|
if(isDark){
|
||||||
|
ui->widget_menuList->setStyleSheet("background-color:#282828");
|
||||||
|
}else {
|
||||||
|
ui->widget_menuList->setStyleSheet("background-color:#FFFFFF");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Widget::on_pushButton_website_clicked()
|
void Widget::on_pushButton_website_clicked()
|
||||||
{
|
{
|
||||||
QDesktopServices::openUrl(QUrl(appweb));
|
QDesktopServices::openUrl(QUrl(appweb));
|
||||||
|
1
widget.h
1
widget.h
@ -41,6 +41,7 @@ public:
|
|||||||
int isdownload=false;
|
int isdownload=false;
|
||||||
void opensetting(); //打开设置页面
|
void opensetting(); //打开设置页面
|
||||||
void openUrl(QUrl);
|
void openUrl(QUrl);
|
||||||
|
void setTheme(bool);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0" rowspan="2">
|
<item row="0" column="0" rowspan="2">
|
||||||
<widget class="QWidget" name="widget" native="true">
|
<widget class="QWidget" name="widget_menuList" native="true">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>150</width>
|
<width>150</width>
|
||||||
@ -888,7 +888,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>856</width>
|
<width>440</width>
|
||||||
<height>864</height>
|
<height>864</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@ -1194,8 +1194,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>822</width>
|
<width>98</width>
|
||||||
<height>325</height>
|
<height>28</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user