From 9ab11ccb36b7d03a3a24ebcd18d2f13b03fc3682 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 14 Oct 2022 11:58:30 +0400 Subject: [PATCH] Add full-text-width accessor for SettingsButton. --- ui/widgets/buttons.cpp | 4 ++++ ui/widgets/buttons.h | 1 + 2 files changed, 5 insertions(+) diff --git a/ui/widgets/buttons.cpp b/ui/widgets/buttons.cpp index 817e42c..bd49ebe 100644 --- a/ui/widgets/buttons.cpp +++ b/ui/widgets/buttons.cpp @@ -765,6 +765,10 @@ const style::SettingsButton &SettingsButton::st() const { return _st; } +int SettingsButton::fullTextWidth() const { + return _text.maxWidth(); +} + void SettingsButton::paintEvent(QPaintEvent *e) { Painter p(this); diff --git a/ui/widgets/buttons.h b/ui/widgets/buttons.h index 89c32cf..bacae3d 100644 --- a/ui/widgets/buttons.h +++ b/ui/widgets/buttons.h @@ -274,6 +274,7 @@ public: void setPaddingOverride(style::margins padding); [[nodiscard]] const style::SettingsButton &st() const; + [[nodiscard]] int fullTextWidth() const; protected: int resizeGetHeight(int newWidth) override;