Merge remote-tracking branch 'upstream/master' into local/libcosmic-path-patch
# Conflicts: # Cargo.lock # Cargo.toml # src/menu.rs # src/text_box.rs
This commit is contained in:
commit
36d66d7ef2
29 changed files with 1508 additions and 813 deletions
21
src/menu.rs
21
src/menu.rs
|
|
@ -121,6 +121,7 @@ pub fn context_menu<'a>(
|
|||
entity: segmented_button::Entity,
|
||||
) -> Element<'a, Message> {
|
||||
fn key_style(theme: &cosmic::Theme) -> TextStyle {
|
||||
// TODO use wayland popups
|
||||
let mut color = theme.cosmic().background(false).component.on;
|
||||
color.alpha *= 0.75;
|
||||
TextStyle {
|
||||
|
|
@ -147,15 +148,17 @@ pub fn context_menu<'a>(
|
|||
.on_press(Message::TabContextAction(entity, menu_action))
|
||||
};
|
||||
|
||||
widget::container(column!(
|
||||
menu_item(fl!("undo"), Action::Undo),
|
||||
menu_item(fl!("redo"), Action::Redo),
|
||||
divider::horizontal::light(),
|
||||
menu_item(fl!("cut"), Action::Cut),
|
||||
menu_item(fl!("copy"), Action::Copy),
|
||||
menu_item(fl!("paste"), Action::Paste),
|
||||
menu_item(fl!("select-all"), Action::SelectAll),
|
||||
))
|
||||
widget::container(
|
||||
cosmic::widget::menu::menu_column::MenuColumn::with_children([
|
||||
menu_item(fl!("undo"), Action::Undo).into(),
|
||||
menu_item(fl!("redo"), Action::Redo).into(),
|
||||
divider::horizontal::light().into(),
|
||||
menu_item(fl!("cut"), Action::Cut).into(),
|
||||
menu_item(fl!("copy"), Action::Copy).into(),
|
||||
menu_item(fl!("paste"), Action::Paste).into(),
|
||||
menu_item(fl!("select-all"), Action::SelectAll).into(),
|
||||
]),
|
||||
)
|
||||
.padding(1)
|
||||
//TODO: move style to libcosmic
|
||||
.style(|theme| {
|
||||
|
|
|
|||
|
|
@ -825,7 +825,7 @@ where
|
|||
let scrollbar_color = if pressed {
|
||||
// pressed_state_color, 0.5
|
||||
cosmic_theme
|
||||
.background(false)
|
||||
.background(theme.transparent)
|
||||
.component
|
||||
.pressed
|
||||
.without_alpha()
|
||||
|
|
@ -834,7 +834,7 @@ where
|
|||
} else if hover {
|
||||
// hover_state_color, 0.2
|
||||
cosmic_theme
|
||||
.background(false)
|
||||
.background(theme.transparent)
|
||||
.component
|
||||
.hover
|
||||
.without_alpha()
|
||||
|
|
@ -921,7 +921,7 @@ where
|
|||
let scrollbar_color = if pressed {
|
||||
// pressed_state_color, 0.5
|
||||
cosmic_theme
|
||||
.background(false)
|
||||
.background(theme.transparent)
|
||||
.component
|
||||
.pressed
|
||||
.without_alpha()
|
||||
|
|
@ -930,7 +930,7 @@ where
|
|||
} else if hover {
|
||||
// hover_state_color, 0.2
|
||||
cosmic_theme
|
||||
.background(false)
|
||||
.background(theme.transparent)
|
||||
.component
|
||||
.hover
|
||||
.without_alpha()
|
||||
|
|
@ -1089,11 +1089,13 @@ where
|
|||
Named::Backspace => {
|
||||
delete_modifiers(&mut editor, Motion::LeftWord, *modifiers);
|
||||
editor.action(Action::Backspace);
|
||||
editor.set_redraw(true);
|
||||
shell.capture_event();
|
||||
}
|
||||
Named::Delete => {
|
||||
delete_modifiers(&mut editor, Motion::RightWord, *modifiers);
|
||||
editor.action(Action::Delete);
|
||||
editor.set_redraw(true);
|
||||
shell.capture_event();
|
||||
}
|
||||
Named::Tab => {
|
||||
|
|
@ -1412,6 +1414,10 @@ where
|
|||
shell.publish(on_changed.clone());
|
||||
}
|
||||
}
|
||||
|
||||
if editor.redraw() {
|
||||
shell.request_redraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue