mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-03 01:42:20 +08:00
优化UI
This commit is contained in:
parent
fe4143a3f7
commit
6578af935e
@ -3,8 +3,6 @@
|
||||
ProgressLoad::ProgressLoad(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
m_progess=new QWidget(this);
|
||||
m_progess->setStyleSheet("background-color:#999999");
|
||||
setStyleSheet("background-color:#000000");
|
||||
m_progess->move(0,0);
|
||||
m_progess->show();
|
||||
timer=new QTimer;
|
||||
@ -22,3 +20,13 @@ void ProgressLoad::setValue(int v)
|
||||
value=v;
|
||||
m_progess->setFixedWidth(width()/100*value);
|
||||
}
|
||||
|
||||
void ProgressLoad::setTheme(bool dark, QColor color)
|
||||
{
|
||||
if(dark){
|
||||
m_progess->setStyleSheet("background-color:282828");
|
||||
}else {
|
||||
m_progess->setStyleSheet("background-color:FFFFFF");
|
||||
}
|
||||
setStyleSheet("background-color:"+color.name());
|
||||
}
|
||||
|
@ -9,6 +9,7 @@ class ProgressLoad : public QWidget
|
||||
public:
|
||||
explicit ProgressLoad(QWidget *parent = nullptr);
|
||||
void setValue(int v);
|
||||
void setTheme(bool dark,QColor color);
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 4.8.2, 2020-08-26T09:27:42. -->
|
||||
<!-- Written by QtCreator 4.8.2, 2020-08-26T19:58:03. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
@ -293,19 +293,20 @@
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">spark-store</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:/home/maicss/git/spark/spark-store/spark-store.pro</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">spark-store.pro</value>
|
||||
<value type="QString" key="RunConfiguration.Arguments"></value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default"></value>
|
||||
<value type="QString" key="RunConfiguration.WorkingDirectory.default">/home/maicss/git/spark/build-spark-store-unknown-Debug</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
|
23
widget.cpp
23
widget.cpp
@ -38,9 +38,7 @@ Widget::Widget(DBlurEffectWidget *parent) :
|
||||
initConfig();
|
||||
manager = new QNetworkAccessManager(this);//下载管理
|
||||
m_loadweb=ui->progressload;
|
||||
// m_loadweb->setParent(nullptr);
|
||||
m_loadweb->show();
|
||||
m_loadweb->setValue(50);
|
||||
|
||||
connect(ui->menu_main,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(0);});
|
||||
connect(ui->menu_network,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(1);});
|
||||
@ -174,23 +172,6 @@ void Widget::initUI()
|
||||
left_list[13]=ui->menu_download;
|
||||
|
||||
|
||||
//初始化web加载动画
|
||||
// QHBoxLayout *m_weblayout=new QHBoxLayout;
|
||||
// m_weblayout->addWidget(m_loadweb);
|
||||
// m_weblayout->addWidget(m_loaderror);
|
||||
// m_loadweb->hide();
|
||||
// m_loadweb->setParent(ui->webEngineView);
|
||||
// m_loaderror->hide();
|
||||
// m_loadweb->start();
|
||||
// m_loadweb->setMaximumSize(50,50);
|
||||
// m_loadweb->setMinimumSize(50,50);
|
||||
// m_loadweb->setTextVisible(false);
|
||||
// m_loaderror->setPixmap(QIcon::fromTheme("dialog-error").pixmap(50,50));
|
||||
// m_loaderror->setAlignment(Qt::AlignCenter);
|
||||
|
||||
// ui->webEngineView->setLayout(m_weblayout);
|
||||
// ui->stackedWidget->setLayout(m_weblayout);
|
||||
|
||||
ui->label_show->hide();
|
||||
|
||||
}
|
||||
@ -289,7 +270,7 @@ void Widget::setTheme(bool isDark,QColor color)
|
||||
ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active.svg"));
|
||||
}
|
||||
main_color=color;
|
||||
|
||||
m_loadweb->setTheme(themeIsDark,color);
|
||||
updateUI();
|
||||
if(ui->stackedWidget->currentIndex()==0){
|
||||
chooseLeftMenu(nowMenu);
|
||||
@ -344,6 +325,7 @@ void Widget::updateUI()
|
||||
left_list[i]->setStyleSheet("color:#252525;border:0px");
|
||||
}
|
||||
}
|
||||
|
||||
left_list[nowMenu]->setStyleSheet("color:#FFFFFF;background-color:"+main_color.name()+";border-radius:8;border:0px");
|
||||
switch (nowMenu) {
|
||||
case 0:
|
||||
@ -409,6 +391,7 @@ void Widget::chooseLeftMenu(int index)
|
||||
darkurl+="dark"+tmp[tmp.size()-1];
|
||||
ui->webEngineView->setUrl(darkurl);
|
||||
qDebug()<<darkurl;
|
||||
|
||||
}else {
|
||||
ui->webEngineView->setUrl(menuUrl[index]);
|
||||
|
||||
|
17
widget.ui
17
widget.ui
@ -421,6 +421,8 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>901</width>
|
||||
<height>849</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -716,7 +718,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>370</width>
|
||||
<width>867</width>
|
||||
<height>325</height>
|
||||
</rect>
|
||||
</property>
|
||||
@ -846,8 +848,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>903</width>
|
||||
<height>786</height>
|
||||
<width>687</width>
|
||||
<height>830</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_23">
|
||||
@ -1135,17 +1137,20 @@
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>10</height>
|
||||
<height>3</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>10</height>
|
||||
<height>3</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTipDuration">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">background-color:#000000</string>
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
x
Reference in New Issue
Block a user