Skip to content

Commit

Permalink
Merge branch 'master' into lenemter/compositor-animate-launch
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Jan 29, 2024
2 parents 2858ec0 + d5132de commit 7b5b97c
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
}

current_card.wrong_credentials ();

carousel.interactive = true;
}

private async void load_users () {
Expand Down Expand Up @@ -541,6 +543,10 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
int next_delta = 0;
weak GLib.Binding? binding = null;
private void switch_to_card (Greeter.UserCard user_card) {
if (!carousel.interactive) {
return;
}

if (next_delta != index_delta) {
return;
}
Expand Down Expand Up @@ -617,17 +623,28 @@ public class Greeter.MainWindow : Gtk.ApplicationWindow {
critical (e.message);
}
}

carousel.interactive = false;
carousel.scroll_to (current_card);
}

private void go_previous (GLib.SimpleAction action, GLib.Variant? parameter) {
unowned Greeter.UserCard? next_card = (Greeter.UserCard) user_cards.peek_nth (index_delta - 1);
if (!carousel.interactive) {
return;
}

unowned Greeter.UserCard? next_card = user_cards.peek_nth (index_delta - 1);
if (next_card != null) {
carousel.scroll_to (next_card);
}
}

private void go_next (GLib.SimpleAction action, GLib.Variant? parameter) {
unowned Greeter.UserCard? next_card = (Greeter.UserCard) user_cards.peek_nth (index_delta + 1);
if (!carousel.interactive) {
return;
}

unowned Greeter.UserCard? next_card = user_cards.peek_nth (index_delta + 1);
if (next_card != null) {
carousel.scroll_to (next_card);
}
Expand Down

0 comments on commit 7b5b97c

Please sign in to comment.