Automatically switch to dark mode when a screen is connected

parent 103db27e
......@@ -109,15 +109,16 @@ public class Remotely.Window : Gtk.ApplicationWindow {
});
display.vnc_disconnected.connect(() => {
connect_stack.set_visible_child_name("host");
vnc_stack.set_visible_child_name("new-connection");
connection_revealer.set_reveal_child(false);
show_new_connection_page();
});
display.vnc_initialized.connect(() => {
vnc_stack.set_visible_child_name("connection");
connection_revealer.set_reveal_child(true);
update_zoom_mode();
var gtk_settings = Gtk.Settings.get_default ();
gtk_settings.gtk_application_prefer_dark_theme = true;
});
display.vnc_auth_credential.connect((authlist) => {
......@@ -126,24 +127,31 @@ public class Remotely.Window : Gtk.ApplicationWindow {
display.vnc_auth_failure.connect((error) => {
show_notification("Authentication error");
vnc_stack.set_visible_child_name("new-connection");
show_new_connection_page();
});
display.vnc_error.connect((error) => {
show_notification(error);
vnc_stack.set_visible_child_name("new-connection");
connection_revealer.set_reveal_child(false);
show_new_connection_page();
});
display.vnc_auth_unsupported.connect(() => {
show_notification("Authentication is not supported");
vnc_stack.set_visible_child_name("new-connection");
show_notification("Authentication method is not supported");
show_new_connection_page();
});
this.size_allocate.connect(() => {
update_zoom_mode();
});
}
private void show_new_connection_page(){
vnc_stack.set_visible_child_name("new-connection");
connect_stack.set_visible_child_name("host");
connection_revealer.set_reveal_child(false);
var gtk_settings = Gtk.Settings.get_default ();
gtk_settings.gtk_application_prefer_dark_theme = false;
}
[GtkCallback]
......
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