Added access to toggle rect for inheritors of Ui::SettingsButton.
This commit is contained in:
parent
580e6a561f
commit
49d9a020a3
2 changed files with 6 additions and 0 deletions
|
|
@ -832,6 +832,10 @@ QRect SettingsButton::toggleRect() const {
|
|||
return { QPoint(left, top), size };
|
||||
}
|
||||
|
||||
QRect SettingsButton::maybeToggleRect() const {
|
||||
return _toggle ? toggleRect() : QRect(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
int SettingsButton::resizeGetHeight(int newWidth) {
|
||||
return _padding.top() + _st.height + _padding.bottom();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -289,6 +289,8 @@ protected:
|
|||
void paintText(Painter &p, bool over, int outerw) const;
|
||||
void paintToggle(Painter &p, int outerw) const;
|
||||
|
||||
[[nodiscard]] QRect maybeToggleRect() const;
|
||||
|
||||
private:
|
||||
void setText(QString &&text);
|
||||
QRect toggleRect() const;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue