issues/723

This commit is contained in:
恍兮惚兮 2024-05-07 16:44:22 +08:00
parent 9b7aa7edb8
commit aa6b2140de
2 changed files with 11 additions and 21 deletions

View File

@ -106,20 +106,14 @@ class Textbrowser:
self.textbrowser.setStyleSheet( self.textbrowser.setStyleSheet(
"border-width: 0;\ "border-width: 0;\
border-style: outset;\ border-style: outset;\
border-top: 0px solid #e8f3f9;\ color: rgba(0, 0, 0, 0);\
color: white;\ background-color: rgba(0, 0, 0, 0)"
\
background-color: rgba(%s, %s, %s, %s)"
% (0, 0, 0, 0)
) )
self.textbrowserback.setStyleSheet( self.textbrowserback.setStyleSheet(
"border-width: 0;\ "border-width: 0;\
border-style: outset;\ border-style: outset;\
border-top: 0px solid #e8f3f9;\ color: rgba(0, 0, 0, 0);\
color: white;\ background-color: rgba(0, 0, 0, 0)"
\
background-color: rgba(%s, %s, %s, %s)"
% (0, 0, 0, 0)
) )
self.textcursor = self.textbrowser.textCursor() self.textcursor = self.textbrowser.textCursor()
@ -266,14 +260,7 @@ class Textbrowser:
self.movep(0, self.savey) self.movep(0, self.savey)
if globalconfig["zitiyangshi"] == 3: if globalconfig["zitiyangshi"] == 3:
self.textbrowser.show()
self.textbrowserback.show()
self.showyinyingtext(color, b1, b2) self.showyinyingtext(color, b1, b2)
self.textbrowser.hide()
self.textbrowserback.hide()
else:
self.textbrowser.show()
self.textbrowserback.show()
def getcurrpointer(self): def getcurrpointer(self):
return self.textcursor.position() return self.textcursor.position()

View File

@ -8,7 +8,7 @@ from traceback import print_exc
from PyQt5.QtCore import Qt, pyqtSignal from PyQt5.QtCore import Qt, pyqtSignal
import qtawesome import qtawesome
from PyQt5.QtCore import pyqtSignal, Qt, QSize from PyQt5.QtCore import pyqtSignal, Qt, QSize
from PyQt5.QtGui import QCursor from PyQt5.QtGui import QCursor, QColor
from PyQt5.QtWidgets import QLabel, QPushButton, QSystemTrayIcon from PyQt5.QtWidgets import QLabel, QPushButton, QSystemTrayIcon
import gobject import gobject
from myutils.wrapper import threader, trypass from myutils.wrapper import threader, trypass
@ -219,7 +219,10 @@ class QUnFrameWindow(resizableframeless):
elif globalconfig["zitiyangshi"] == 0: elif globalconfig["zitiyangshi"] == 0:
self.translate_text.simplecharformat(color) self.translate_text.simplecharformat(color)
elif globalconfig["zitiyangshi"] == 3: elif globalconfig["zitiyangshi"] == 3:
self.translate_text.simplecharformat(color) # hide后无法重新计算布局。设置和背景相同的颜色和alpha来模拟hide
c = QColor(globalconfig["backcolor"])
c.setAlpha(globalconfig["transparent"] * (not self.backtransparent) / 100)
self.translate_text.simplecharformat(c)
if iter_context: if iter_context:
iter_res_status, iter_context_class = iter_context iter_res_status, iter_context_class = iter_context