From 8af5c438cd5f2395039b16d0c1f71e5b26ed4dcb Mon Sep 17 00:00:00 2001 From: nyanpasu64 Date: Tue, 5 Feb 2019 01:41:39 -0800 Subject: [PATCH] Add tooltips to color pickers --- corrscope/gui/data_bind.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/corrscope/gui/data_bind.py b/corrscope/gui/data_bind.py index 820f30f..f4f0b5c 100644 --- a/corrscope/gui/data_bind.py +++ b/corrscope/gui/data_bind.py @@ -324,10 +324,12 @@ class BoundColorWidget(BoundWidget, qw.QWidget): # Setup checkbox if self.optional: self.check = _ColorCheckBox(self, self.text) + self.check.setToolTip("Enable/Disable Color") layout.addWidget(self.check) # Setup colored button. self.button = _ColorButton(self, self.text) + self.button.setToolTip("Pick Color") layout.addWidget(self.button) # override BoundWidget @@ -437,7 +439,8 @@ class _ColorButton(qw.QPushButton): self.curr_color = color 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: qss = ""