diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index ebecf62d7c..25ee1eba12 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -1163,6 +1163,9 @@ void TextView::Draw(UIContext &dc) { style.background.color &= 0x7fffffff; dc.FillRect(style.background, bounds_); } + if (frame_) { + dc.Draw()->DrawRoundRect(bounds_, dc.GetTheme().choiceRoundRadius, textColor, RoundRectStyle::OutlineThin); + } const FontStyle *style = GetTextStyle(dc, textSize_); dc.SetFontStyle(*style); diff --git a/Common/UI/View.h b/Common/UI/View.h index d6c381cccc..dbddad7079 100644 --- a/Common/UI/View.h +++ b/Common/UI/View.h @@ -1113,6 +1113,8 @@ public: void SetBullet(bool bullet) { bullet_ = bullet; } void SetPadding(Margins padding) { pad_ = padding; } void SetAlign(int align) { textAlign_ = align; } + // Draws a thin rounded outline around the view. Use padding to keep the text off it. + TextView *SetFrame(bool frame) { frame_ = frame; return this; } TextView *SetWordWrap(); bool CanBeFocused() const override { return focusable_; } @@ -1127,6 +1129,7 @@ private: bool focusable_ = false; bool clip_ = true; bool bullet_ = false; + bool frame_ = false; Margins pad_{}; }; diff --git a/UI/SettingsPage.cpp b/UI/SettingsPage.cpp index 0c94257ea7..ad35cc9ca9 100644 --- a/UI/SettingsPage.cpp +++ b/UI/SettingsPage.cpp @@ -366,7 +366,13 @@ static UI::View *CreateSettingViewInner(const SettingItem &item, I18NCat pageCat case SettingType::Hint: return parent->Add(new SettingHint(text, prevView)); case SettingType::Description: - return parent->Add(new SettingHint(text, nullptr)); + { + TextView *description = parent->Add(new TextView(text, FLAG_WRAP_TEXT, false, new LinearLayoutParams(FILL_PARENT, WRAP_CONTENT, Margins(0, 4)))); + description->SetTextSize(TextSize::Small); + description->SetPadding(Margins(12)); + description->SetFrame(true); + return description; + } case SettingType::Custom: return item.createCustom(parent); case SettingType::Link: