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