mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-12 00:59:41 +01:00
Correct corner radius of popups to match inner rounded things
This commit is contained in:
1 parent
37fa5896c1
commit
d09a9ffa11
3 files changed
+6
-1
No files matched your search
@@ -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);
|
||||
|
||||
@@ -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_);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user