| 131 | // ============================================================================ |
| 132 | |
| 133 | ThreeStateButton::ThreeStateButton(QWidget *parent) |
| 134 | : ToolbarButton(parent) |
| 135 | { |
| 136 | // Not using Qt's checkable - we manage state ourselves |
| 137 | setCheckable(false); |
| 138 | |
| 139 | // Set object name for QSS styling |
| 140 | setObjectName("ThreeStateButton"); |
| 141 | |
| 142 | // Handle click signal to cycle states |
| 143 | // (mousePressEvent is not called by QPushButton::click()) |
| 144 | connect(this, &QPushButton::clicked, this, [this]() { |
| 145 | setState((m_state + 1) % 3); |
| 146 | }); |
| 147 | } |
| 148 | |
| 149 | void ThreeStateButton::setState(int state) |
| 150 | { |