menu: Fix scrollbar can't drag to bottom of scrollable PopupMenu. (#984)
| Before | After | |--| -- | | <img width="166" alt="image" src="https://github.com/user-attachments/assets/883eb78b-9ea3-4f1b-b01e-81fbbbdd39ed" /> | <img width="166" alt="image" src="https://github.com/user-attachments/assets/9ba551aa-5d9e-49ed-adfa-3da6c654f0c4" />| Ref #979 but not fix.
This commit is contained in:
parent
1752d3e2b4
commit
4c87c72f60
1 changed files with 3 additions and 3 deletions
|
|
@ -897,7 +897,6 @@ impl Render for PopupMenu {
|
||||||
.popover_style(cx)
|
.popover_style(cx)
|
||||||
.text_color(cx.theme().popover_foreground)
|
.text_color(cx.theme().popover_foreground)
|
||||||
.relative()
|
.relative()
|
||||||
.p_1()
|
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
.id("items")
|
.id("items")
|
||||||
|
|
@ -908,6 +907,7 @@ impl Render for PopupMenu {
|
||||||
})
|
})
|
||||||
.child(
|
.child(
|
||||||
v_flex()
|
v_flex()
|
||||||
|
.p_1()
|
||||||
.gap_y_0p5()
|
.gap_y_0p5()
|
||||||
.min_w(rems(8.))
|
.min_w(rems(8.))
|
||||||
.when_some(self.min_width, |this, min_width| this.min_w(min_width))
|
.when_some(self.min_width, |this, min_width| this.min_w(min_width))
|
||||||
|
|
@ -924,9 +924,9 @@ impl Render for PopupMenu {
|
||||||
self.menu_items
|
self.menu_items
|
||||||
.iter()
|
.iter()
|
||||||
.enumerate()
|
.enumerate()
|
||||||
// Skip last separator
|
// Ignore last separator
|
||||||
.filter(|(ix, item)| {
|
.filter(|(ix, item)| {
|
||||||
!(*ix == items_count - 1 && item.is_separator())
|
!(*ix + 1 == items_count && item.is_separator())
|
||||||
})
|
})
|
||||||
.map(|(ix, item)| {
|
.map(|(ix, item)| {
|
||||||
self.render_item(ix, item, item_state, window, cx)
|
self.render_item(ix, item, item_state, window, cx)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue