Skip to content

Commit a020ec2

Browse files
committed
add hotkey item to settings page
1 parent 738369b commit a020ec2

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

src/app/pages/settings.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,24 @@ impl Shelly {
827827
.into(),
828828
)
829829
.into(),
830+
tuple_row(
831+
shellcommand_hint_text(theme.clone(), "Hotkey"),
832+
text_input_cell(self.hotkey.clone().unwrap_or("".to_string()), &theme, "Hotkey")
833+
.on_input({
834+
let shell = shell.clone();
835+
move |input| {
836+
let old = shell.clone();
837+
let mut new = old.clone();
838+
new.hotkey = Some(input);
839+
Message::SetConfig(SetConfigFields::ShellCommands(Editable::Update {
840+
old,
841+
new,
842+
}))
843+
}
844+
})
845+
.into(),
846+
)
847+
.into(),
830848
tuple_row(
831849
Button::new("Delete")
832850
.on_press(Message::SetConfig(SetConfigFields::ShellCommands(
@@ -837,7 +855,7 @@ impl Shelly {
837855
move |_, _| delete_button_style(&theme)
838856
})
839857
.into(),
840-
notice_item(theme.clone(), "Icon path is optional"),
858+
notice_item(theme.clone(), "Icon path and hotkey are optional"),
841859
)
842860
.into(),
843861
])

0 commit comments

Comments
 (0)