summaryrefslogtreecommitdiff
path: root/ui/clickablelabel.h
diff options
context:
space:
mode:
authorAlexander Taylor <alex@vector35.com>2024-02-05 22:38:13 -0500
committerAlexander Taylor <alex@vector35.com>2024-02-08 16:47:44 -0500
commitd349ef152d6d9b5939a2fd1de2281b1a720fc297 (patch)
tree5ae12e99b76296cb743031b33f15010aa07c7c57 /ui/clickablelabel.h
parentf3101ad23b5b15b6edb0593b9ac8a80f3319fd95 (diff)
Clickable icons now have an inactive state icon.
Diffstat (limited to 'ui/clickablelabel.h')
-rw-r--r--ui/clickablelabel.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/clickablelabel.h b/ui/clickablelabel.h
index 6051480e..5e8c2cbf 100644
--- a/ui/clickablelabel.h
+++ b/ui/clickablelabel.h
@@ -19,11 +19,11 @@
*/
struct BINARYNINJAUIAPI IconImage
{
- QImage original;
+ QImage activeOriginal, inactiveOriginal;
QImage active, activeHover;
QImage inactive, inactiveHover;
- static IconImage generate(const QImage& src);
+ static IconImage generate(const QImage& activeSrc, const QImage& inactiveSrc);
};
@@ -73,13 +73,15 @@ class BINARYNINJAUIAPI ClickableIcon : public QWidget
QTimer* m_timer;
public:
- ClickableIcon(const QImage& icon, const QSize& desiredPointSize);
+ ClickableIcon(const QImage& activeIcon, const QImage& inactiveIcon, const QSize& desiredPointSize);
+ ClickableIcon(const QImage& icon, const QSize& desiredPointSize) : ClickableIcon(icon, icon, desiredPointSize) {}
void setAllowToggle(bool canToggle);
void setActive(bool state);
bool active() const { return m_active; }
void setImage(const QImage& icon);
+ void setImage(const QImage& activeIcon, const QImage& inactiveIcon);
Q_PROPERTY(QSize desiredPointSize READ desiredPointSize WRITE setDesiredPointSize)
QSize desiredPointSize() const { return rect().size(); }
@@ -158,4 +160,4 @@ class BINARYNINJAUIAPI ClickableStateLabel : public ClickableLabel
p.fillRect(event->rect(), overlayColor);
}
}
-};
+}; \ No newline at end of file