mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2024-12-29 00:24:13 +08:00
repair
This commit is contained in:
parent
2623b88082
commit
e994a82ed2
@ -1013,17 +1013,36 @@ class QUnFrameWindow(resizableframeless):
|
|||||||
print_exc()
|
print_exc()
|
||||||
|
|
||||||
def takusanbuttons(self, _type, clickfunc, tips, name, belong=None):
|
def takusanbuttons(self, _type, clickfunc, tips, name, belong=None):
|
||||||
|
if clickfunc:
|
||||||
|
button = QPushButton(self)
|
||||||
|
button.clicked.connect(functools.partial(self.callwrap, clickfunc))
|
||||||
|
else:
|
||||||
|
|
||||||
|
class __(QPushButton):
|
||||||
|
def __init__(self, p):
|
||||||
|
super().__init__(p)
|
||||||
|
self._lb = QLabel(p)
|
||||||
|
self._lb.raise_()
|
||||||
|
|
||||||
|
def hideEvent(self, _):
|
||||||
|
self._lb.hide()
|
||||||
|
|
||||||
|
def showEvent(self, _):
|
||||||
|
self._lb.show()
|
||||||
|
|
||||||
|
def moveEvent(self, event):
|
||||||
|
self._lb.move(event.pos())
|
||||||
|
|
||||||
|
def resizeEvent(self, event):
|
||||||
|
self._lb.resize(event.size())
|
||||||
|
|
||||||
|
button = __(self)
|
||||||
|
|
||||||
button = QPushButton(self)
|
|
||||||
if tips:
|
if tips:
|
||||||
button.setToolTip(_TR(tips))
|
button.setToolTip(_TR(tips))
|
||||||
if _type not in self.stylebuttons:
|
if _type not in self.stylebuttons:
|
||||||
self.stylebuttons[_type] = []
|
self.stylebuttons[_type] = []
|
||||||
self.stylebuttons[_type].append(button)
|
self.stylebuttons[_type].append(button)
|
||||||
if clickfunc:
|
|
||||||
button.clicked.connect(functools.partial(self.callwrap, clickfunc))
|
|
||||||
else:
|
|
||||||
button.lower()
|
|
||||||
|
|
||||||
button.belong = belong
|
button.belong = belong
|
||||||
self.buttons[name] = button
|
self.buttons[name] = button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user