Skip to content

Commit

Permalink
AbstractOnboardingView: replace skip all with back on non-welcome vie…
Browse files Browse the repository at this point in the history
…ws (#238)
  • Loading branch information
danirabbit authored Sep 13, 2024
1 parent 697006a commit b3fa6cb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,16 @@ public class Onboarding.MainWindow : Gtk.ApplicationWindow {

navigation_view.get_next_page.connect (get_next_page);

var back_action = new SimpleAction ("back", null);
back_action.activate.connect (() => navigation_view.pop ());

var next_action = new SimpleAction ("next", null);
next_action.activate.connect (action_next);

var skip_action = new SimpleAction ("skip", null);
skip_action.activate.connect (action_skip);

add_action (back_action);
add_action (next_action);
add_action (skip_action);
}
Expand Down
17 changes: 11 additions & 6 deletions src/Views/AbstractOnboardingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,35 @@ public abstract class Onboarding.AbstractOnboardingView : Adw.NavigationPage {
valign = CENTER
};

var skip_button = new Gtk.Button.with_label (_("Skip All")) {
action_name = "win.skip"
};
var back_button = new Gtk.Button ();

var next_button = new Gtk.Button.with_label (_("Next")) {
action_name = "win.next"
};
next_button.add_css_class (Granite.STYLE_CLASS_SUGGESTED_ACTION);

var buttons_group = new Gtk.SizeGroup (BOTH);
buttons_group.add_widget (skip_button);
buttons_group.add_widget (back_button);
buttons_group.add_widget (next_button);

var action_area = new Gtk.CenterBox () {
start_widget = back_button,
center_widget = levelbar,
end_widget = next_button,
vexpand = true,
valign = END
};
action_area.add_css_class ("dialog-action-area");

if (!(this is FinishView)) {
action_area.start_widget = skip_button;
if (this is WelcomeView) {
back_button.label = _("Skip All");
back_button.action_name = "win.skip";
} else {
back_button.label = _("Back");
back_button.action_name = "win.back";
}

if (this is FinishView) {
next_button.label = _("Get Started");
}

Expand Down

0 comments on commit b3fa6cb

Please sign in to comment.