diff --git a/apps/opencs/view/widget/pushbutton.cpp b/apps/opencs/view/widget/pushbutton.cpp index f23462585..d4e600794 100644 --- a/apps/opencs/view/widget/pushbutton.cpp +++ b/apps/opencs/view/widget/pushbutton.cpp @@ -72,6 +72,11 @@ CSVWidget::PushButton::PushButton (const QIcon& icon, Type type, const QString& QWidget *parent) : QPushButton (icon, "", parent), mKeepOpen (false), mType (type), mToolTip (tooltip) { + if (type==Type_Mode || type==Type_Toggle) + { + setCheckable (true); + connect (this, SIGNAL (toggled (bool)), this, SLOT (checkedStateChanged (bool))); + } setCheckable (type==Type_Mode || type==Type_Toggle); setExtendedToolTip(); } @@ -96,4 +101,9 @@ QString CSVWidget::PushButton::getBaseToolTip() const CSVWidget::PushButton::Type CSVWidget::PushButton::getType() const { return mType; +} + +void CSVWidget::PushButton::checkedStateChanged (bool checked) +{ + setExtendedToolTip(); } \ No newline at end of file diff --git a/apps/opencs/view/widget/pushbutton.hpp b/apps/opencs/view/widget/pushbutton.hpp index 35062a137..09cf22757 100644 --- a/apps/opencs/view/widget/pushbutton.hpp +++ b/apps/opencs/view/widget/pushbutton.hpp @@ -53,6 +53,10 @@ namespace CSVWidget QString getBaseToolTip() const; Type getType() const; + + private slots: + + void checkedStateChanged (bool checked); }; }