This commit is contained in:
Maicss 2020-08-26 19:58:42 +08:00
parent fe4143a3f7
commit 6578af935e
5 changed files with 31 additions and 33 deletions

View File

@ -3,8 +3,6 @@
ProgressLoad::ProgressLoad(QWidget *parent) : QWidget(parent) ProgressLoad::ProgressLoad(QWidget *parent) : QWidget(parent)
{ {
m_progess=new QWidget(this); m_progess=new QWidget(this);
m_progess->setStyleSheet("background-color:#999999");
setStyleSheet("background-color:#000000");
m_progess->move(0,0); m_progess->move(0,0);
m_progess->show(); m_progess->show();
timer=new QTimer; timer=new QTimer;
@ -22,3 +20,13 @@ void ProgressLoad::setValue(int v)
value=v; value=v;
m_progess->setFixedWidth(width()/100*value); 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());
}

View File

@ -9,6 +9,7 @@ class ProgressLoad : public QWidget
public: public:
explicit ProgressLoad(QWidget *parent = nullptr); explicit ProgressLoad(QWidget *parent = nullptr);
void setValue(int v); void setValue(int v);
void setTheme(bool dark,QColor color);
signals: signals:
public slots: public slots:

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!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> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@ -293,19 +293,20 @@
</valuelist> </valuelist>
<value type="int" key="PE.EnvironmentAspect.Base">2</value> <value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.CustomExecutableRunConfiguration.Executable"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">spark-store</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Executable</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></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="QString" key="RunConfiguration.Arguments"></value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</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.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value> <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory"></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> </valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value> <value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap> </valuemap>

View File

@ -38,9 +38,7 @@ Widget::Widget(DBlurEffectWidget *parent) :
initConfig(); initConfig();
manager = new QNetworkAccessManager(this);//下载管理 manager = new QNetworkAccessManager(this);//下载管理
m_loadweb=ui->progressload; m_loadweb=ui->progressload;
// m_loadweb->setParent(nullptr);
m_loadweb->show(); m_loadweb->show();
m_loadweb->setValue(50);
connect(ui->menu_main,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(0);}); connect(ui->menu_main,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(0);});
connect(ui->menu_network,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(1);}); connect(ui->menu_network,&QPushButton::clicked,[=](){Widget::chooseLeftMenu(1);});
@ -174,23 +172,6 @@ void Widget::initUI()
left_list[13]=ui->menu_download; 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(); 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")); ui->pushButton_return->setIcon(QIcon(":/icons/icons/category_active.svg"));
} }
main_color=color; main_color=color;
m_loadweb->setTheme(themeIsDark,color);
updateUI(); updateUI();
if(ui->stackedWidget->currentIndex()==0){ if(ui->stackedWidget->currentIndex()==0){
chooseLeftMenu(nowMenu); chooseLeftMenu(nowMenu);
@ -344,6 +325,7 @@ void Widget::updateUI()
left_list[i]->setStyleSheet("color:#252525;border:0px"); left_list[i]->setStyleSheet("color:#252525;border:0px");
} }
} }
left_list[nowMenu]->setStyleSheet("color:#FFFFFF;background-color:"+main_color.name()+";border-radius:8;border:0px"); left_list[nowMenu]->setStyleSheet("color:#FFFFFF;background-color:"+main_color.name()+";border-radius:8;border:0px");
switch (nowMenu) { switch (nowMenu) {
case 0: case 0:
@ -409,6 +391,7 @@ void Widget::chooseLeftMenu(int index)
darkurl+="dark"+tmp[tmp.size()-1]; darkurl+="dark"+tmp[tmp.size()-1];
ui->webEngineView->setUrl(darkurl); ui->webEngineView->setUrl(darkurl);
qDebug()<<darkurl; qDebug()<<darkurl;
}else { }else {
ui->webEngineView->setUrl(menuUrl[index]); ui->webEngineView->setUrl(menuUrl[index]);

View File

@ -421,6 +421,8 @@
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y>
<width>901</width>
<height>849</height> <height>849</height>
</rect> </rect>
</property> </property>
@ -716,7 +718,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>370</width> <width>867</width>
<height>325</height> <height>325</height>
</rect> </rect>
</property> </property>
@ -846,8 +848,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>903</width> <width>687</width>
<height>786</height> <height>830</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_23"> <layout class="QVBoxLayout" name="verticalLayout_23">
@ -1135,17 +1137,20 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>10</height> <height>3</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>10</height> <height>3</height>
</size> </size>
</property> </property>
<property name="toolTipDuration">
<number>-1</number>
</property>
<property name="styleSheet"> <property name="styleSheet">
<string notr="true">background-color:#000000</string> <string notr="true"/>
</property> </property>
</widget> </widget>
</item> </item>