Fix context menu remaining open some more
This commit is contained in:
parent
af8a23eb62
commit
7013067582
1 changed files with 5 additions and 9 deletions
14
src/menu.rs
14
src/menu.rs
|
|
@ -29,21 +29,17 @@ macro_rules! menu_button {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn context_menu<'a>(entity: segmented_button::Entity) -> Element<'a, Message> {
|
pub fn context_menu<'a>(entity: segmented_button::Entity) -> Element<'a, Message> {
|
||||||
let menu_message = |label, message| menu_button!(widget::text(label)).on_press(message);
|
let menu_action = |label, action| {
|
||||||
|
menu_button!(widget::text(label)).on_press(Message::TabContextAction(entity, action))
|
||||||
let menu_action =
|
};
|
||||||
|label, action| menu_message(label, Message::TabContextAction(entity, action));
|
|
||||||
|
|
||||||
widget::container(column!(
|
widget::container(column!(
|
||||||
menu_action(fl!("copy"), Action::Copy),
|
menu_action(fl!("copy"), Action::Copy),
|
||||||
menu_action(fl!("paste"), Action::Paste),
|
menu_action(fl!("paste"), Action::Paste),
|
||||||
menu_action(fl!("select-all"), Action::SelectAll),
|
menu_action(fl!("select-all"), Action::SelectAll),
|
||||||
horizontal_rule(1),
|
horizontal_rule(1),
|
||||||
menu_message(fl!("new-tab"), Message::TabNew),
|
menu_action(fl!("new-tab"), Action::TabNew),
|
||||||
menu_message(
|
menu_action(fl!("settings"), Action::Settings),
|
||||||
fl!("settings"),
|
|
||||||
Message::ToggleContextPage(ContextPage::Settings)
|
|
||||||
),
|
|
||||||
))
|
))
|
||||||
.padding(1)
|
.padding(1)
|
||||||
//TODO: move style to libcosmic
|
//TODO: move style to libcosmic
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue