kopia lustrzana https://github.com/corrscope/corrscope
Add tooltips to color pickers
rodzic
59df0641f8
commit
8af5c438cd
|
|
@ -324,10 +324,12 @@ class BoundColorWidget(BoundWidget, qw.QWidget):
|
||||||
# Setup checkbox
|
# Setup checkbox
|
||||||
if self.optional:
|
if self.optional:
|
||||||
self.check = _ColorCheckBox(self, self.text)
|
self.check = _ColorCheckBox(self, self.text)
|
||||||
|
self.check.setToolTip("Enable/Disable Color")
|
||||||
layout.addWidget(self.check)
|
layout.addWidget(self.check)
|
||||||
|
|
||||||
# Setup colored button.
|
# Setup colored button.
|
||||||
self.button = _ColorButton(self, self.text)
|
self.button = _ColorButton(self, self.text)
|
||||||
|
self.button.setToolTip("Pick Color")
|
||||||
layout.addWidget(self.button)
|
layout.addWidget(self.button)
|
||||||
|
|
||||||
# override BoundWidget
|
# override BoundWidget
|
||||||
|
|
@ -437,7 +439,8 @@ class _ColorButton(qw.QPushButton):
|
||||||
self.curr_color = color
|
self.curr_color = color
|
||||||
|
|
||||||
if color.isValid():
|
if color.isValid():
|
||||||
qss = f"background: {color.name()};"
|
# Tooltips inherit our styles. Don't change their background.
|
||||||
|
qss = f"{obj_name(self)} {{ background: {color.name()}; }}"
|
||||||
else:
|
else:
|
||||||
qss = ""
|
qss = ""
|
||||||
|
|
||||||
|
|
|
||||||
Ładowanie…
Reference in New Issue