mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-09-29 15:12:21 +08:00
新增 黑色模式
This commit is contained in:
parent
0e387acfb6
commit
070788d50d
14
main.cpp
14
main.cpp
@ -22,24 +22,24 @@ int main(int argc, char *argv[])
|
|||||||
int d_w=s->width();
|
int d_w=s->width();
|
||||||
int d_h=s->height();
|
int d_h=s->height();
|
||||||
if(d_w<=1366){
|
if(d_w<=1366){
|
||||||
w.setMinimumWidth(820);
|
w.setMinimumWidth(350);
|
||||||
w.resize(820,640);
|
w.resize(835,640);
|
||||||
}else if(d_w<=1920){
|
}else if(d_w<=1920){
|
||||||
w.setMinimumWidth(1140);
|
w.setMinimumWidth(1140);
|
||||||
w.resize(1140,760);
|
w.resize(1180,760);
|
||||||
}else {
|
}else {
|
||||||
w.setMinimumWidth(1140);
|
w.setMinimumWidth(1140);
|
||||||
w.resize(1140,760);
|
w.resize(1180,760);
|
||||||
}
|
}
|
||||||
if(d_h<=768){
|
if(d_h<=768){
|
||||||
w.setMinimumHeight(640);
|
w.setMinimumHeight(640);
|
||||||
w.resize(820,640);
|
w.resize(835,640);
|
||||||
}else if(d_h<=1080){
|
}else if(d_h<=1080){
|
||||||
w.setMinimumHeight(760);
|
w.setMinimumHeight(760);
|
||||||
w.resize(1140,760);
|
w.resize(1180,760);
|
||||||
}else {
|
}else {
|
||||||
w.setMinimumHeight(760);
|
w.setMinimumHeight(760);
|
||||||
w.resize(1140,760);
|
w.resize(1180,760);
|
||||||
}
|
}
|
||||||
|
|
||||||
w.show();
|
w.show();
|
||||||
|
21
widget.cpp
21
widget.cpp
@ -165,7 +165,7 @@ void Widget::initConfig()
|
|||||||
configCanSave=true; //防止出发保存配置信号
|
configCanSave=true; //防止出发保存配置信号
|
||||||
// ui->
|
// ui->
|
||||||
// menuUrl[0]="https://mp.weixin.qq.com/s/1OmCgJ13yVDSRebdgtW9fg";
|
// menuUrl[0]="https://mp.weixin.qq.com/s/1OmCgJ13yVDSRebdgtW9fg";
|
||||||
menuUrl[0]=serverUrl + "store/#";
|
menuUrl[0]=serverUrl + "store/#/";
|
||||||
menuUrl[1]=serverUrl + "store/#/network";
|
menuUrl[1]=serverUrl + "store/#/network";
|
||||||
menuUrl[2]=serverUrl + "store/#/relations";
|
menuUrl[2]=serverUrl + "store/#/relations";
|
||||||
menuUrl[3]=serverUrl + "store/#/musicandsound";
|
menuUrl[3]=serverUrl + "store/#/musicandsound";
|
||||||
@ -212,18 +212,21 @@ void Widget::setTheme(bool isDark,QColor color)
|
|||||||
{
|
{
|
||||||
if(isDark){
|
if(isDark){
|
||||||
//黑色模式
|
//黑色模式
|
||||||
|
themeIsDark=true;
|
||||||
ui->widget_menuList->setStyleSheet("background-color:#282828");
|
ui->widget_menuList->setStyleSheet("background-color:#282828");
|
||||||
ui->webView->setStyleSheet("background-color:#282828");
|
ui->webView->setStyleSheet("background-color:#282828");
|
||||||
ui->btn_openDir->setStyleSheet("color:#8B91A1;background-color:#2E2F30;border:0px");
|
ui->btn_openDir->setStyleSheet("color:#8B91A1;background-color:#2E2F30;border:0px");
|
||||||
|
// ui->webView->page()->;
|
||||||
}else {
|
}else {
|
||||||
//亮色模式
|
//亮色模式
|
||||||
|
themeIsDark=false;
|
||||||
ui->widget_menuList->setStyleSheet("background-color:#FFFFFF");
|
ui->widget_menuList->setStyleSheet("background-color:#FFFFFF");
|
||||||
ui->webView->setStyleSheet("background-color:#FFFFFF");
|
ui->webView->setStyleSheet("background-color:#FFFFFF");
|
||||||
ui->btn_openDir->setStyleSheet("color:#505050;background-color:#FBFBFB;border:0px");
|
ui->btn_openDir->setStyleSheet("color:#505050;background-color:#FBFBFB;border:0px");
|
||||||
}
|
}
|
||||||
main_color=color;
|
main_color=color;
|
||||||
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");
|
||||||
|
chooseLeftMenu(nowMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::on_webView_loadStarted()
|
void Widget::on_webView_loadStarted()
|
||||||
@ -280,7 +283,19 @@ void Widget::chooseLeftMenu(int index)
|
|||||||
}
|
}
|
||||||
left_list[index]->setStyleSheet("color:#FFFFFF;background-color:"+main_color.name()+";border-radius:8;border:0px");
|
left_list[index]->setStyleSheet("color:#FFFFFF;background-color:"+main_color.name()+";border-radius:8;border:0px");
|
||||||
if(index<=12){
|
if(index<=12){
|
||||||
|
if(themeIsDark){
|
||||||
|
QString darkurl=menuUrl[index].toString();
|
||||||
|
QStringList tmp=darkurl.split("/");
|
||||||
|
darkurl.clear();
|
||||||
|
for (int i=0;i<tmp.size()-1;i++) {
|
||||||
|
darkurl+=tmp[i]+"/";
|
||||||
|
}
|
||||||
|
darkurl+="dark"+tmp[tmp.size()-1];
|
||||||
|
ui->webView->setUrl(darkurl);
|
||||||
|
qDebug()<<darkurl;
|
||||||
|
}else {
|
||||||
ui->webView->setUrl(menuUrl[index]);
|
ui->webView->setUrl(menuUrl[index]);
|
||||||
|
}
|
||||||
ui->stackedWidget->setCurrentIndex(0);
|
ui->stackedWidget->setCurrentIndex(0);
|
||||||
}else if (index==13) {
|
}else if (index==13) {
|
||||||
ui->stackedWidget->setCurrentIndex(1);
|
ui->stackedWidget->setCurrentIndex(1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user