dropdown_button: Fix incorrect rounded when ghost button selected (#1011)
| Before | After | | - | - | | <img width="218" alt="SCR-20250625-psed" src="https://github.com/user-attachments/assets/873db4e9-d169-4273-bee9-58332b41c00f" /> | <img width="222" alt="SCR-20250625-prxz" src="https://github.com/user-attachments/assets/48f8cb35-cd67-47ac-bbb9-2739e1aa16b9" /> |
This commit is contained in:
parent
692ee83b61
commit
f7d536531d
1 changed files with 7 additions and 7 deletions
|
|
@ -109,9 +109,9 @@ impl Selectable for DropdownButton {
|
|||
|
||||
impl RenderOnce for DropdownButton {
|
||||
fn render(self, _: &mut Window, _: &mut App) -> impl IntoElement {
|
||||
let is_ghost = self
|
||||
let rounded = self
|
||||
.variant
|
||||
.map(|variant| variant.is_ghost())
|
||||
.map(|variant| variant.is_ghost() && !self.selected)
|
||||
.unwrap_or(false);
|
||||
|
||||
div()
|
||||
|
|
@ -124,9 +124,9 @@ impl RenderOnce for DropdownButton {
|
|||
.rounded(self.rounded)
|
||||
.border_corners(Corners {
|
||||
top_left: true,
|
||||
top_right: is_ghost,
|
||||
top_right: rounded,
|
||||
bottom_left: true,
|
||||
bottom_right: is_ghost,
|
||||
bottom_right: rounded,
|
||||
})
|
||||
.border_edges(Edges {
|
||||
left: true,
|
||||
|
|
@ -146,15 +146,15 @@ impl RenderOnce for DropdownButton {
|
|||
.icon(IconName::ChevronDown)
|
||||
.rounded(self.rounded)
|
||||
.border_edges(Edges {
|
||||
left: is_ghost,
|
||||
left: rounded,
|
||||
top: true,
|
||||
right: true,
|
||||
bottom: true,
|
||||
})
|
||||
.border_corners(Corners {
|
||||
top_left: is_ghost,
|
||||
top_left: rounded,
|
||||
top_right: true,
|
||||
bottom_left: is_ghost,
|
||||
bottom_left: rounded,
|
||||
bottom_right: true,
|
||||
})
|
||||
.selected(self.selected)
|
||||
|
|
|
|||
Loading…
Reference in a new issue