This commit is contained in:
恍兮惚兮 2024-04-01 12:51:53 +08:00
parent 16fcd554b6
commit 9fe684611d
23 changed files with 82 additions and 46 deletions

View File

@ -8,7 +8,7 @@ import functools
from traceback import print_exc
from myutils.config import globalconfig ,_TR
from myutils.utils import wavmp3player
from myutils.config import globalconfig
from myutils.config import static_data
from gui.settingpage1 import setTabOne,setTabOne_direct
from gui.settingpage2 import setTabTwo,settab2d
from gui.settingpage_xianshishezhi import setTabThree ,setTabThree_direct
@ -19,7 +19,6 @@ from gui.setting_lang import setTablang,setTablangd
from gui.setting_proxy import setTab_proxy
from gui.settingpage7 import setTab7 ,settab7direct
from gui.settingpage_about import setTab_about,setTab_about_dicrect
from gui.usefulwidget import rotatetab
from gui.usefulwidget import closeashidewindow
class gridwidget(QWidget):
pass
@ -187,10 +186,12 @@ class Settin(closeashidewindow) :
darklight=['light','dark'][dark]
try:
with open('./files/{}{}.qss'.format(darklight,globalconfig[darklight+'theme']),'r') as ff:
idx=globalconfig[darklight+'theme']-int(not dark)
if idx==-1:raise Exception()
with open('./files/themes/{}'.format(static_data['themes'][darklight][idx]["file"] ),'r') as ff:
style=ff.read()
except:
print_exc()
#print_exc()
style=''
style+="*{font: %spt '"%(globalconfig['settingfontsize'])+(globalconfig['settingfonttype'] )+"' ; }"
self.setStyleSheet(style)

View File

@ -9,7 +9,7 @@ from PyQt5.QtCore import Qt,QSize
from PyQt5.QtGui import QStandardItem, QStandardItemModel
from PyQt5.QtWidgets import QLabel ,QSlider, QFontComboBox ,QDialog,QGridLayout
from gui.inputdialog import multicolorset
from myutils.config import globalconfig ,_TR,_TRL ,magpie10_config
from myutils.config import globalconfig ,_TR,_TRL ,magpie10_config,static_data
from myutils.wrapper import Singleton
import qtawesome,gobject,json
from myutils.hwnd import showintab
@ -147,6 +147,8 @@ def setTabThree_lazy(self) :
def __changeshowintab(x):
gobject.baseobject.translation_ui.showintab=x
showintab(int(gobject.baseobject.translation_ui.winId()),x)
def themelist(t):
return [_['name'] for _ in static_data['themes'][t]]
uigrid=[
[('设置界面字体',4),(self.sfont_comboBox,5)],
[ ('字体大小',4),(getspinbox(1,100,globalconfig ,'settingfontsize',callback=__changefontsize),2)],
@ -167,8 +169,8 @@ def setTabThree_lazy(self) :
[('选择文本窗口中文本框只读',6),getsimpleswitch(globalconfig,'textboxreadonly',callback=lambda x:gobject.baseobject.hookselectdialog.textOutput.setReadOnly(x) )],
[],
[('明暗',6),(getsimplecombobox(_TRL(['明亮','黑暗','跟随系统']),globalconfig,'darklight',callback=lambda _: self.setstylesheet()),5)],
[('明亮',6),(getsimplecombobox(_TRL(['default','1','2']),globalconfig,'lighttheme',callback=lambda _: self.setstylesheet()),5)],
[('黑暗',6),(getsimplecombobox(_TRL(['0','1']),globalconfig,'darktheme',callback=lambda _: self.setstylesheet()),5)],
[('明亮主题',6),(getsimplecombobox(_TRL(['默认'])+themelist('light'),globalconfig,'lighttheme',callback=lambda _: self.setstylesheet()),5)],
[('黑暗主题',6),(getsimplecombobox(themelist('dark'),globalconfig,'darktheme',callback=lambda _: self.setstylesheet()),5)],
]
alleffect=['','Bicubic','Bilinear','Jinc','Lanczos','Nearest','SSimDownscaler']
downsname=magpie10_config.get('downscalingEffect',{'name':''}).get('name')

View File

@ -229,29 +229,7 @@ class resizableframeless(saveposwindow):
self._lcorner_drag = False
self._right_drag = False
self._left_drag = False
class rotatetab(QTabBar):
def tabSizeHint(self, index):
s = QTabBar.tabSizeHint(self, index)
s.transpose()
return s
def paintEvent(self, e) :
painter = QStylePainter(self)
opt = QStyleOptionTab()
for i in range(self.count()) :
self.initStyleOption(opt, i)
painter.drawControl(QStyle.CE_TabBarTabShape, opt)
painter.save()
s = opt.rect.size()
s.transpose()
r = QRect(QPoint(), s)
r.moveCenter(opt.rect.center())
opt.rect = r
c = self.tabRect(i).center()
painter.translate(c)
painter.rotate(90)
painter.translate(-c)
painter.drawControl(QStyle.CE_TabBarTabLabel, opt)
painter.restore()
class Prompt_dialog(QDialog):
def __init__(self, parent,title,info,default='' ) -> None:
super().__init__(parent)

View File

@ -1,5 +1,15 @@
{
"version":"v2.40.6",
"version":"v2.41.0",
"themes":{
"dark":[
{"file":"dark1.qss","name":"PyQtDarkTheme"},
{"file":"dark2.qss","name":"QDarkStyleSheet"}
],
"light":[
{"file":"light1.qss","name":"PyQtDarkTheme"},
{"file":"light2.qss","name":"QDarkStyleSheet"}
]
},
"language_list_show":["简体中文","日本語","English","Русский язык","Español","한국어","Français","繁體中文","Tiếng Việt","Türkçe","Polski","Українська Мова","Italiano","اللغة العربية","ภาษาไทย","བོད་སྐད།"] ,
"language_list_translator":["简体中文","日文","英文","俄语","西班牙语","韩语","法语","繁体中文","越南语","土耳其语","波兰语","乌克兰语","意大利语","阿拉伯语","泰语","藏语"],
"language_list_translator_inner":["zh", "ja", "en","ru","es","ko","fr","cht","vi","tr","pl","uk","it","ar","th","bo"],

View File

@ -731,5 +731,8 @@
"明亮": "مشرق",
"黑暗": "ظلام .",
"跟随系统": "متابعة النظام",
"明暗": "الضوء والظل"
"明暗": "الضوء والظل",
"默认": "افتراضي",
"明亮主题": "موضوع مشرق",
"黑暗主题": "موضوع الظلام"
}

View File

@ -731,5 +731,8 @@
"明亮": "明亮",
"黑暗": "黑暗",
"跟随系统": "跟隨系統",
"明暗": "明暗"
"明暗": "明暗",
"默认": "默認",
"明亮主题": "明亮主題",
"黑暗主题": "黑暗主題"
}

View File

@ -731,5 +731,8 @@
"明亮": "bright",
"黑暗": "dark",
"跟随系统": "Follow system",
"明暗": "Brightness and darkness"
"明暗": "Brightness and darkness",
"默认": "default",
"明亮主题": "Bright Theme",
"黑暗主题": "Dark Theme"
}

View File

@ -731,5 +731,8 @@
"明亮": "Brillante",
"黑暗": "Oscuridad",
"跟随系统": "Sistema de seguimiento",
"明暗": "Luz y oscuridad"
"明暗": "Luz y oscuridad",
"默认": "Predeterminado",
"明亮主题": "Temas brillantes",
"黑暗主题": "Tema oscuro"
}

View File

@ -731,5 +731,8 @@
"明亮": "Lumineux",
"黑暗": "L'obscurité",
"跟随系统": "Suivre le système",
"明暗": "Lumière et obscurité"
"明暗": "Lumière et obscurité",
"默认": "Par défaut",
"明亮主题": "Thème lumineux",
"黑暗主题": "Thème sombre"
}

View File

@ -731,5 +731,8 @@
"明亮": "luminoso",
"黑暗": "scuro",
"跟随系统": "Sistema di monitoraggio",
"明暗": "Luminosità e oscurità"
"明暗": "Luminosità e oscurità",
"默认": "default",
"明亮主题": "Tema luminoso",
"黑暗主题": "Tema scuro"
}

View File

@ -731,5 +731,8 @@
"明亮": "明るい",
"黑暗": "暗い",
"跟随系统": "フォローアップシステム",
"明暗": "明暗"
"明暗": "明暗",
"默认": "デフォルト",
"明亮主题": "明るいテーマ",
"黑暗主题": "暗いテーマ"
}

View File

@ -731,5 +731,8 @@
"明亮": "밝기",
"黑暗": "어둠",
"跟随系统": "시스템 따르기",
"明暗": "명암"
"明暗": "명암",
"默认": "기본",
"明亮主题": "밝은 테마",
"黑暗主题": "다크 테마"
}

View File

@ -731,5 +731,8 @@
"明亮": "jasne",
"黑暗": "ciemność",
"跟随系统": "System śledzenia",
"明暗": "Jasność i ciemność"
"明暗": "Jasność i ciemność",
"默认": "domyślne",
"明亮主题": "Jasny motyw",
"黑暗主题": "Ciemny motyw"
}

View File

@ -731,5 +731,8 @@
"明亮": "Яркий",
"黑暗": "Тьма.",
"跟随系统": "Следующая система",
"明暗": "Свет и тьма"
"明暗": "Свет и тьма",
"默认": "По умолчанию",
"明亮主题": "Яркая тема",
"黑暗主题": "Темная тема"
}

View File

@ -731,5 +731,8 @@
"明亮": "สดใส",
"黑暗": "ความมืด",
"跟随系统": "ติดตามระบบ",
"明暗": "ความสว่างและความมืด"
"明暗": "ความสว่างและความมืด",
"默认": "ปริยาย",
"明亮主题": "ธีมสดใส",
"黑暗主题": "ธีมมืด"
}

View File

@ -731,5 +731,8 @@
"明亮": "bright",
"黑暗": "karanlık",
"跟随系统": "Sistemi takip et",
"明暗": "Parılık ve karanlık"
"明暗": "Parılık ve karanlık",
"默认": "öntanımlı",
"明亮主题": "Işık Tema",
"黑暗主题": "Karanlık Tema"
}

View File

@ -731,5 +731,8 @@
"明亮": "яскравий",
"黑暗": "темно",
"跟随系统": "Слідкувати за системою",
"明暗": "Яскравість і темрява"
"明暗": "Яскравість і темрява",
"默认": "типовий",
"明亮主题": "Bright Theme",
"黑暗主题": "Темна тема"
}

View File

@ -731,5 +731,8 @@
"明亮": "Minh Lượng",
"黑暗": "Bóng tối",
"跟随系统": "Theo dõi hệ thống",
"明暗": "Ánh sáng và bóng tối"
"明暗": "Ánh sáng và bóng tối",
"默认": "Mặc định",
"明亮主题": "Sắc thái tươi sáng",
"黑暗主题": "Chủ đề tối"
}

View File

@ -731,5 +731,8 @@
"明亮": "",
"黑暗": "",
"跟随系统": "",
"明暗": ""
"明暗": "",
"默认": "",
"明亮主题": "",
"黑暗主题": ""
}