Correct corner radius of popups to match inner rounded things

This commit is contained in:
Henrik Rydgård committed 2026-10-29 15:12:55 +01:00
1 parent 37fa5896c1
commit d09a9ffa11
3 files changed
+6 -1

No files matched your search

+1
View File
@@ -189,6 +189,7 @@ void PopupScreen::CreateViews() {
root_->Add(box_);
box_->SetBG(dc.GetTheme().popupStyle.background);
box_->SetHasDropShadow(hasDropShadow_);
box_->SetRadiusFactor(1.44f);
// Since we scale a bit, make the dropshadow bleed past the edges.
box_->SetDropShadowExpand(std::max(g_display.dp_xres, g_display.dp_yres));
box_->SetSpacing(0.0f);
+2 -1
View File
@@ -188,7 +188,8 @@ void ViewGroup::Draw(UIContext &dc) {
}
if (roundCorners_ != RoundCorners::None) {
dc.FillRoundRect(bg_, bounds_, dc.GetTheme().choiceRoundRadius, roundCorners_);
// Surrounding round rects (like windows) need a bigger radius to look right.
dc.FillRoundRect(bg_, bounds_, dc.GetTheme().choiceRoundRadius * radiusFactor_, roundCorners_);
} else {
dc.FillRect(bg_, bounds_);
}
+3
View File
@@ -100,6 +100,7 @@ public:
void SetDropShadowExpand(float s) { dropShadowExpand_ = s; }
void SetExclusiveTouch(bool exclusive) { exclusiveTouch_ = exclusive; }
void SetClickableBackground(bool clickableBackground) { clickableBackground_ = clickableBackground; }
void SetRadiusFactor(float factor) { radiusFactor_ = factor; }
void SetClip(bool clip) { clip_ = clip; }
std::string DescribeLog() const override { return "ViewGroup: " + View::DescribeLog(); }
@@ -107,6 +108,7 @@ public:
void Recurse(std::function<void(View *)> func) override;
protected:
std::string DescribeListUnordered(std::string_view heading) const;
std::string DescribeListOrdered(std::string_view heading) const;
@@ -118,6 +120,7 @@ protected:
View *defaultFocusView_ = nullptr;
Drawable bg_;
float dropShadowExpand_ = 0.0f;
float radiusFactor_ = 1.0f;
bool hasDropShadow_ = false;
bool clickableBackground_ = false;
bool clip_ = false;