Skip to content

Commit

Permalink
Merge branch 'master' into lenemter/support-dark-mode
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit authored Jan 29, 2024
2 parents dada4a6 + 9f5bede commit 7c5fcfe
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
15 changes: 15 additions & 0 deletions compositor/WindowManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ namespace GreeterCompositor {
public override void start () {
show_stage ();

unowned var background_actor = system_background.background_actor;
background_actor.opacity = 0;
background_actor.save_easing_state ();
background_actor.set_easing_duration (1000);
background_actor.set_easing_mode (Clutter.AnimationMode.EASE);
background_actor.opacity = 255;
background_actor.restore_easing_state ();

ui_group.opacity = 0;
ui_group.save_easing_state ();
ui_group.set_easing_duration (1000);
ui_group.set_easing_mode (Clutter.AnimationMode.EASE);
ui_group.opacity = 255;
ui_group.restore_easing_state ();

unowned Meta.Display display = get_display ();
display.gl_video_memory_purged.connect (() => {
refresh_background ();
Expand Down
4 changes: 2 additions & 2 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ public int main (string[] args) {
var gnome_settings_daemon = new Greeter.SettingsDaemon ();
gnome_settings_daemon.start ();

Gtk.init (ref args);

Greeter.SubprocessSupervisor compositor;
Greeter.SubprocessSupervisor portals;
Greeter.SubprocessSupervisor wingpanel;
Expand All @@ -45,6 +43,8 @@ public int main (string[] args) {
critical (e.message);
}

Gtk.init (ref args);

var window = new Greeter.MainWindow ();
window.show_all ();

Expand Down
3 changes: 3 additions & 0 deletions src/Cards/UserCard.vala
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,9 @@ public class Greeter.UserCard : Greeter.BaseCard {
settings_daemon_settings.set_enum ("prefer-dark-schedule", settings_act.prefer_dark_schedule);
settings_daemon_settings.set_value ("prefer-dark-schedule-from", settings_act.prefer_dark_schedule_from);
settings_daemon_settings.set_value ("prefer-dark-schedule-to", settings_act.prefer_dark_schedule_to);

var touchscreen_settings = new GLib.Settings ("org.gnome.settings-daemon.peripherals.touchscreen");
touchscreen_settings.set_boolean ("orientation-lock", settings_act.orientation_lock);
}

private void set_night_light_settings () {
Expand Down
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
1 change: 1 addition & 0 deletions src/PantheonAccountsServicePlugin.vala
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ interface Pantheon.SettingsDaemon.AccountsService : Object {
public abstract string document_font_name { owned get; set; }
public abstract string font_name { owned get; set; }
public abstract string monospace_font_name { owned get; set; }
public abstract bool orientation_lock { get; set; }

/* Prefer Dark Schedule (part of interface settings)*/
public abstract Coordinates prefer_dark_last_coordinates { get; set; }
Expand Down

0 comments on commit 7c5fcfe

Please sign in to comment.