menu: Fix sub menu gap. (#1006)
<img width="334" alt="image" src="https://github.com/user-attachments/assets/1f1a9515-f52d-4171-9e53-56d18f923be0" />
This commit is contained in:
parent
9aa593ce0b
commit
dfa3c9a29e
1 changed files with 4 additions and 4 deletions
|
|
@ -813,10 +813,10 @@ impl PopupMenu {
|
|||
)
|
||||
.when(hovered, |this| {
|
||||
let (anchor, left) =
|
||||
if window.bounds().size.width - bounds.origin.x < max_width {
|
||||
(Corner::TopRight, -px(12.))
|
||||
if max_width + bounds.origin.x > window.bounds().size.width {
|
||||
(Corner::TopRight, -px(14.))
|
||||
} else {
|
||||
(Corner::TopLeft, bounds.size.width + px(4.))
|
||||
(Corner::TopLeft, bounds.size.width)
|
||||
};
|
||||
|
||||
let is_bottom_pos =
|
||||
|
|
@ -829,7 +829,7 @@ impl PopupMenu {
|
|||
div()
|
||||
.occlude()
|
||||
.when(is_bottom_pos, |this| this.bottom_0())
|
||||
.when(!is_bottom_pos, |this| this.top(-px(4.)))
|
||||
.when(!is_bottom_pos, |this| this.top_neg_1())
|
||||
.left(left)
|
||||
.child(menu.clone()),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue