Commit aca427aa authored by Alexander Mikhaylenko's avatar Alexander Mikhaylenko

Clean up buttons

Use with_label() instead of a manually created label, make the headerbar ones translatable, add mnenonics everywhere.
parent 9d335887
...@@ -48,17 +48,17 @@ impl WelcomePageWidget { ...@@ -48,17 +48,17 @@ impl WelcomePageWidget {
actions_container.set_halign(gtk::Align::Center); actions_container.set_halign(gtk::Align::Center);
actions_container.set_margin_top(36); actions_container.set_margin_top(36);
let start_tour_btn = gtk::Button::new(); let start_tour_btn = gtk::Button::with_label(&gettext("_Take the Tour"));
start_tour_btn.add(&gtk::Label::new(Some(&gettext("Take the Tour"))));
start_tour_btn.get_style_context().add_class("suggested-action"); start_tour_btn.get_style_context().add_class("suggested-action");
start_tour_btn.set_property_height_request(40); start_tour_btn.set_property_height_request(40);
start_tour_btn.set_property_width_request(180); start_tour_btn.set_property_width_request(180);
start_tour_btn.set_use_underline(true);
start_tour_btn.set_action_name(Some("app.start-tour")); start_tour_btn.set_action_name(Some("app.start-tour"));
let skip_tour_btn = gtk::Button::new(); let skip_tour_btn = gtk::Button::with_label(&gettext("_No Thanks"));
skip_tour_btn.add(&gtk::Label::new(Some(&gettext("No Thanks"))));
skip_tour_btn.set_property_height_request(40); skip_tour_btn.set_property_height_request(40);
skip_tour_btn.set_property_width_request(180); skip_tour_btn.set_property_width_request(180);
skip_tour_btn.set_use_underline(true);
skip_tour_btn.set_action_name(Some("app.skip-tour")); skip_tour_btn.set_action_name(Some("app.skip-tour"));
actions_container.add(&skip_tour_btn); actions_container.add(&skip_tour_btn);
......
...@@ -25,8 +25,8 @@ impl PaginatorWidget { ...@@ -25,8 +25,8 @@ impl PaginatorWidget {
widget, widget,
carousel: libhandy::Carousel::new(), carousel: libhandy::Carousel::new(),
headerbar: libhandy::HeaderBar::new(), headerbar: libhandy::HeaderBar::new(),
next_btn: gtk::Button::new(), next_btn: gtk::Button::with_label(&gettext("_Next")),
close_btn: gtk::Button::new(), close_btn: gtk::Button::with_label(&gettext("_Close")),
pages: RefCell::new(Vec::new()), pages: RefCell::new(Vec::new()),
current_page: RefCell::new(0), current_page: RefCell::new(0),
}); });
...@@ -78,8 +78,8 @@ impl PaginatorWidget { ...@@ -78,8 +78,8 @@ impl PaginatorWidget {
p.current_page.replace(page_nr); p.current_page.replace(page_nr);
})); }));
let previous_btn = gtk::Button::new(); let previous_btn = gtk::Button::with_label(&gettext("_Previous"));
previous_btn.add(&gtk::Label::new(Some("Previous"))); previous_btn.set_use_underline(true);
previous_btn.set_action_name(Some("app.previous-page")); previous_btn.set_action_name(Some("app.previous-page"));
let btn_size_group = gtk::SizeGroup::new(gtk::SizeGroupMode::Horizontal); let btn_size_group = gtk::SizeGroup::new(gtk::SizeGroupMode::Horizontal);
...@@ -87,12 +87,12 @@ impl PaginatorWidget { ...@@ -87,12 +87,12 @@ impl PaginatorWidget {
btn_size_group.add_widget(&self.next_btn); btn_size_group.add_widget(&self.next_btn);
btn_size_group.add_widget(&self.close_btn); btn_size_group.add_widget(&self.close_btn);
self.next_btn.add(&gtk::Label::new(Some(&gettext("Next"))));
self.next_btn.get_style_context().add_class("suggested-action"); self.next_btn.get_style_context().add_class("suggested-action");
self.next_btn.set_use_underline(true);
self.next_btn.set_action_name(Some("app.next-page")); self.next_btn.set_action_name(Some("app.next-page"));
self.close_btn.add(&gtk::Label::new(Some(&gettext("Close"))));
self.close_btn.get_style_context().add_class("suggested-action"); self.close_btn.get_style_context().add_class("suggested-action");
self.close_btn.set_use_underline(true);
self.close_btn.set_action_name(Some("app.next-page")); self.close_btn.set_action_name(Some("app.next-page"));
let next_overlay = gtk::Overlay::new(); let next_overlay = gtk::Overlay::new();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment