Skip to content

Commit 173dd39

Browse files
committed
Gallery: revise accelerator keys
1 parent c6ff3d3 commit 173dd39

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

crates/kas-view/src/driver/config.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ impl_scope! {
4242
0, 8: "Mouse text pan:"; 1..3, 8: self.mouse_text_pan;
4343
1..3, 9: self.mouse_nav_focus;
4444
1..3, 10: self.touch_nav_focus;
45-
0, 11: "Restore default values:"; 1..3, 11: TextButton::new_msg("Reset", Msg::Reset);
45+
0, 11: "Restore default values:"; 1..3, 11: TextButton::new_msg("&Reset", Msg::Reset);
4646
};
4747
}]
4848
#[derive(Debug)]
@@ -71,10 +71,10 @@ impl driver::Driver<Config, SharedRc<Config>> for EventConfig {
7171

7272
fn make(&self) -> Self::Widget {
7373
let mouse_pan = ComboBox::from([
74-
("Never", MousePan::Never),
75-
("With Alt key", MousePan::WithAlt),
76-
("With Ctrl key", MousePan::WithCtrl),
77-
("Always", MousePan::Always),
74+
("&Never", MousePan::Never),
75+
("With &Alt key", MousePan::WithAlt),
76+
("With &Ctrl key", MousePan::WithCtrl),
77+
("Alwa&ys", MousePan::Always),
7878
]);
7979

8080
EventConfigWidget {
@@ -97,9 +97,9 @@ impl driver::Driver<Config, SharedRc<Config>> for EventConfig {
9797
.clone()
9898
.on_select(|mgr, v| mgr.push_msg(Msg::MousePan(v))),
9999
mouse_text_pan: mouse_pan.on_select(|mgr, v| mgr.push_msg(Msg::MouseTextPan(v))),
100-
mouse_nav_focus: CheckButton::new("Mouse navigation focus")
100+
mouse_nav_focus: CheckButton::new("&Mouse navigation focus")
101101
.on_toggle(|mgr, v| mgr.push_msg(Msg::MouseNavFocus(v))),
102-
touch_nav_focus: CheckButton::new("Touchscreen navigation focus")
102+
touch_nav_focus: CheckButton::new("&Touchscreen navigation focus")
103103
.on_toggle(|mgr, v| mgr.push_msg(Msg::TouchNavFocus(v))),
104104
}
105105
}

examples/gallery.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ fn widgets() -> Box<dyn SetDisabled> {
140140
#[widget] bi = Row::new_vec(vec![
141141
Button::new_msg(img_light.clone(), Item::Theme("light"))
142142
.with_color("#B38DF9".parse().unwrap())
143-
.with_keys(&[VK::L]),
143+
.with_keys(&[VK::P]),
144144
Button::new_msg(img_light, Item::Theme("blue"))
145145
.with_color("#7CDAFF".parse().unwrap())
146-
.with_keys(&[VK::L]),
146+
.with_keys(&[VK::B]),
147147
Button::new_msg(img_dark, Item::Theme("dark"))
148148
.with_color("#E77346".parse().unwrap())
149149
.with_keys(&[VK::K]),
150150
]),
151-
#[widget] cb = CheckButton::new("&Check me")
151+
#[widget] cb = CheckButton::new("Chec&k me")
152152
.with_state(true)
153153
.on_toggle(|mgr, check| mgr.push_msg(Item::Check(check))),
154154
#[widget] rb = RadioButton::new("radio button &1", radio.clone())
@@ -311,9 +311,9 @@ fn filter_list() -> Box<dyn SetDisabled> {
311311
#[derive(Debug)]
312312
struct {
313313
core: widget_core!(),
314-
#[widget] r0 = RadioButton::new_msg("none", r.clone(), SelectionMode::None).with_state(true),
315-
#[widget] r1 = RadioButton::new_msg("single", r.clone(), SelectionMode::Single),
316-
#[widget] r2 = RadioButton::new_msg("multiple", r, SelectionMode::Multiple),
314+
#[widget] r0 = RadioButton::new_msg("&n&one", r.clone(), SelectionMode::None).with_state(true),
315+
#[widget] r1 = RadioButton::new_msg("s&ingle", r.clone(), SelectionMode::Single),
316+
#[widget] r2 = RadioButton::new_msg("&multiple", r, SelectionMode::Multiple),
317317
#[widget] filter = EditBox::new("")
318318
.on_edit(move |s, mgr| filter.update(mgr, &(), s.to_string())),
319319
#[widget] list: ScrollBars<MyListView> =
@@ -543,11 +543,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
543543
core: widget_core!(),
544544
#[widget] menubar = menubar,
545545
#[widget] stack: TabStack<Box<dyn SetDisabled>> = TabStack::new()
546-
.with_title("Widgets", widgets()) //TODO: use img_gallery as logo
547-
.with_title("Text editor", editor())
548-
.with_title("List", filter_list())
549-
.with_title("Canvas", canvas())
550-
.with_title("Config", config(toolkit.event_config().clone())),
546+
.with_title("&Widgets", widgets()) //TODO: use img_gallery as logo
547+
.with_title("&Text editor", editor())
548+
.with_title("&List", filter_list())
549+
.with_title("Can&vas", canvas())
550+
.with_title("&Config", config(toolkit.event_config().clone())),
551551
}
552552
impl Widget for Self {
553553
fn handle_message(&mut self, mgr: &mut EventMgr, _: usize) {

0 commit comments

Comments
 (0)