mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
color
This commit is contained in:
parent
1bf9edb063
commit
7a893fbe9f
@ -318,7 +318,19 @@ def uisetting(self):
|
||||
name="buttoncolorbutton",
|
||||
parent=self,
|
||||
),
|
||||
"",
|
||||
D_getcolorbutton(
|
||||
globalconfig,
|
||||
"buttoncolor_1",
|
||||
callback=lambda: selectcolor(
|
||||
self,
|
||||
globalconfig,
|
||||
"buttoncolor_1",
|
||||
self.buttoncolorbutton_1,
|
||||
callback=lambda: gobject.baseobject.translation_ui.refreshtooliconsignal.emit(),
|
||||
),
|
||||
name="buttoncolorbutton_1",
|
||||
parent=self,
|
||||
),
|
||||
"",
|
||||
("工具按钮大小", 4),
|
||||
(
|
||||
|
@ -16,14 +16,6 @@ from gui.edittext import edittrans
|
||||
from gui.dialog_savedgame import browserdialog, dialog_savedgame_integrated
|
||||
|
||||
|
||||
def contrastcolor(color):
|
||||
color = QColor(globalconfig["buttoncolor"])
|
||||
r, g, b, a = color.getRgb()
|
||||
|
||||
r, g, b = [hex((_ + 128) % 256)[2:] for _ in (r, g, b)]
|
||||
return f"#{r}{g}{b}"
|
||||
|
||||
|
||||
class QUnFrameWindow(resizableframeless):
|
||||
displayglobaltooltip = pyqtSignal(str)
|
||||
displayres = pyqtSignal(dict)
|
||||
@ -261,7 +253,7 @@ class QUnFrameWindow(resizableframeless):
|
||||
for name in self.buttons:
|
||||
if name in colorstate:
|
||||
color = (
|
||||
contrastcolor(globalconfig["buttoncolor"])
|
||||
globalconfig["buttoncolor_1"]
|
||||
if colorstate[name]
|
||||
else globalconfig["buttoncolor"]
|
||||
)
|
||||
@ -579,7 +571,7 @@ class QUnFrameWindow(resizableframeless):
|
||||
None,
|
||||
flags=Qt.WindowType.FramelessWindowHint
|
||||
| Qt.WindowType.WindowMinimizeButtonHint,
|
||||
poslist=globalconfig["transuigeo"]
|
||||
poslist=globalconfig["transuigeo"],
|
||||
) # 设置为顶级窗口,无边框
|
||||
icon = getExeIcon(sys.argv[0]) #'./LunaTranslator.exe')# QIcon()
|
||||
# icon.addPixmap(QPixmap('./files/luna.png'), QIcon.Normal, QIcon.On)
|
||||
|
@ -475,9 +475,10 @@
|
||||
"accept_use_unicode_start": 0,
|
||||
"accept_use_unicode_end": 65535,
|
||||
"premtsimiuse": false,
|
||||
"buttoncolor": "#001f9f",
|
||||
"buttoncolor": "#FF69B4",
|
||||
"buttoncolor2": "#FF69B4",
|
||||
"buttoncolor3": "#afafaf",
|
||||
"buttoncolor_1": "#afafaf",
|
||||
"premtsimi2": 100,
|
||||
"ocrrangecolor": "#000000",
|
||||
"ocrrangewidth": 2,
|
||||
|
Loading…
x
Reference in New Issue
Block a user