menu: Unselect menu item when mouse move out. (#1328)
This commit is contained in:
parent
794f4d6397
commit
efe7e14e88
2 changed files with 5 additions and 7 deletions
|
|
@ -111,6 +111,9 @@ impl RenderOnce for MenuItem {
|
||||||
.items_center()
|
.items_center()
|
||||||
.justify_between()
|
.justify_between()
|
||||||
.refine_style(&self.style)
|
.refine_style(&self.style)
|
||||||
|
.when_some(self.on_mouse_enter, |this, on_mouse_enter| {
|
||||||
|
this.on_mouse_move(move |ev, window, cx| (on_mouse_enter)(ev, window, cx))
|
||||||
|
})
|
||||||
.when(!self.disabled, |this| {
|
.when(!self.disabled, |this| {
|
||||||
this.when(self.hovered, |this| {
|
this.when(self.hovered, |this| {
|
||||||
this.bg(cx.theme().accent)
|
this.bg(cx.theme().accent)
|
||||||
|
|
@ -120,9 +123,6 @@ impl RenderOnce for MenuItem {
|
||||||
this.bg(cx.theme().accent)
|
this.bg(cx.theme().accent)
|
||||||
.text_color(cx.theme().accent_foreground)
|
.text_color(cx.theme().accent_foreground)
|
||||||
})
|
})
|
||||||
.when_some(self.on_mouse_enter, |this, on_mouse_enter| {
|
|
||||||
this.on_mouse_move(move |ev, window, cx| (on_mouse_enter)(ev, window, cx))
|
|
||||||
})
|
|
||||||
.when_some(self.on_click, |this, on_click| {
|
.when_some(self.on_click, |this, on_click| {
|
||||||
this.on_mouse_down(MouseButton::Left, move |_, _, cx| {
|
this.on_mouse_down(MouseButton::Left, move |_, _, cx| {
|
||||||
cx.stop_propagation();
|
cx.stop_propagation();
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"list.head.background": "#E6E6E6",
|
"list.head.background": "#E6E6E6",
|
||||||
"muted.background": "#F3F4F5",
|
"muted.background": "#F3F4F5",
|
||||||
"muted.foreground": "#99a0a6",
|
"muted.foreground": "#99a0a6",
|
||||||
"sidebar.background": "#ECECED",
|
|
||||||
"panel.background": "#F3F4F5",
|
"panel.background": "#F3F4F5",
|
||||||
"popover.background": "#ECECED",
|
"popover.background": "#ECECED",
|
||||||
"popover.foreground": "#5C6773",
|
"popover.foreground": "#5C6773",
|
||||||
|
|
@ -238,14 +237,13 @@
|
||||||
"accent.background": "#2D2F34",
|
"accent.background": "#2D2F34",
|
||||||
"accent.foreground": "#B3B1AD",
|
"accent.foreground": "#B3B1AD",
|
||||||
"background": "#0D1016",
|
"background": "#0D1016",
|
||||||
"border": "#3d3e40",
|
"border": "#333436",
|
||||||
"ring": "#FFB454",
|
"ring": "#FFB454",
|
||||||
"foreground": "#B3B1AD",
|
"foreground": "#B3B1AD",
|
||||||
"input.border": "#2D2F34",
|
"input.border": "#2D2F34",
|
||||||
"list.active.background": "#36A3D922",
|
"list.active.background": "#36A3D922",
|
||||||
"list.active.border": "#36A3D9",
|
"list.active.border": "#36A3D9",
|
||||||
"list.even.background": "#191F2A99",
|
"list.even.background": "#191F2A99",
|
||||||
"sidebar.background": "#1F2127",
|
|
||||||
"muted.background": "#1F2430",
|
"muted.background": "#1F2430",
|
||||||
"muted.foreground": "#52514f",
|
"muted.foreground": "#52514f",
|
||||||
"panel.background": "#1F2126",
|
"panel.background": "#1F2126",
|
||||||
|
|
@ -264,7 +262,7 @@
|
||||||
"tab.active.foreground": "#B3B1AD",
|
"tab.active.foreground": "#B3B1AD",
|
||||||
"tab.active.background": "#0D1016",
|
"tab.active.background": "#0D1016",
|
||||||
"tab_bar.background": "#1F2127",
|
"tab_bar.background": "#1F2127",
|
||||||
"title_bar.background": "#313337",
|
"title_bar.background": "#1F2127",
|
||||||
"base.yellow": "#feb454",
|
"base.yellow": "#feb454",
|
||||||
"base.red": "#ef7177",
|
"base.red": "#ef7177",
|
||||||
"base.blue": "#5ac1fe",
|
"base.blue": "#5ac1fe",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue