diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arctica-greeter.vala | 34 | ||||
-rw-r--r-- | src/greeter-list.vala | 10 | ||||
-rw-r--r-- | src/main-window.vala | 39 | ||||
-rw-r--r-- | src/menubar.vala | 12 | ||||
-rw-r--r-- | src/prompt-box.vala | 47 | ||||
-rw-r--r-- | src/session-list.vala | 9 | ||||
-rw-r--r-- | src/settings.vala | 3 | ||||
-rw-r--r-- | src/shutdown-dialog.vala | 4 | ||||
-rw-r--r-- | src/toggle-box.vala | 13 | ||||
-rw-r--r-- | src/user-list.vala | 29 |
10 files changed, 163 insertions, 37 deletions
diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 3f119c4..e193140 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -720,6 +720,16 @@ public class ArcticaGreeter : Object } } + private static void enable_tap_to_click () + { + try { + Process.spawn_command_line_sync("/usr/bin/arctica-greeter-enable-tap-to-click", null, null, null); + } + catch (Error e){ + warning ("Error while enabling tap-to-click: %s", e.message); + } + } + private static void activate_numlock () { try { @@ -897,6 +907,9 @@ public class ArcticaGreeter : Object } } + /* Enable touchpad tap-to-click */ + enable_tap_to_click (); + Gtk.init (ref args); Ido.init (); @@ -910,14 +923,29 @@ public class ArcticaGreeter : Object debug ("Setting GTK+ settings"); var settings = Gtk.Settings.get_default (); var value = AGSettings.get_string (AGSettings.KEY_THEME_NAME); - if (value != "") + if (value != ""){ + debug ("Setting GTK theme: %s", value); settings.set ("gtk-theme-name", value, null); + } value = AGSettings.get_string (AGSettings.KEY_ICON_THEME_NAME); - if (value != "") + if (value != ""){ + debug ("Setting icon theme: %s", value); settings.set ("gtk-icon-theme-name", value, null); + } + value = AGSettings.get_string (AGSettings.KEY_CURSOR_THEME_NAME); + if (value != "") { + debug ("Setting cursor theme: %s", value); + settings.set ("gtk-cursor-theme-name", value, null); + } + var int_value = AGSettings.get_integer (AGSettings.KEY_CURSOR_THEME_SIZE); + if (int_value != 0) { + debug ("Settings cursor theme size: %d", int_value); + settings.set ("gtk-cursor-theme-size", int_value, null); + } value = AGSettings.get_string (AGSettings.KEY_FONT_NAME); - if (value != "") + if (value != ""){ settings.set ("gtk-font-name", value, null); + } var double_value = AGSettings.get_double (AGSettings.KEY_XFT_DPI); if (double_value != 0.0) settings.set ("gtk-xft-dpi", (int) (1024 * double_value), null); diff --git a/src/greeter-list.vala b/src/greeter-list.vala index 98c8b48..c574778 100644 --- a/src/greeter-list.vala +++ b/src/greeter-list.vala @@ -155,7 +155,7 @@ public abstract class GreeterList : FadableBox /* When we swap out a scrolling entry, make sure to hide its * image button, else it will appear in the tab chain. */ if (_scrolling_entry != null) - _scrolling_entry.set_options_image (null); + _scrolling_entry.set_options_image (null, null); _scrolling_entry = value; } } @@ -295,8 +295,12 @@ public abstract class GreeterList : FadableBox } string accessible_text = null; - if (selected_entry != null && selected_entry.label != null) - accessible_text = _("Enter password for %s").printf (selected_entry.label); + if (selected_entry != null && selected_entry.label != null) { + if (secret) + accessible_text = _("Enter password for %s").printf (selected_entry.label); + else + accessible_text = _("Enter your username"); + } var prompt = selected_entry.add_prompt (text, accessible_text, secret); if (mode != Mode.SCROLLING) diff --git a/src/main-window.vala b/src/main-window.vala index d7fe6f0..5dd5a9a 100644 --- a/src/main-window.vala +++ b/src/main-window.vala @@ -363,19 +363,26 @@ public class MainWindow : Gtk.Window if (stack.top () is UserList) { var user_list = stack.top () as UserList; - if (!user_list.show_hidden_users) + var shift_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK; + var control_mask = Gdk.ModifierType.SHIFT_MASK | Gdk.ModifierType.MOD1_MASK; + var alt_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK; + if (((event.keyval == Gdk.Key.Shift_L || event.keyval == Gdk.Key.Shift_R) && (event.state & shift_mask) == shift_mask) || + ((event.keyval == Gdk.Key.Control_L || event.keyval == Gdk.Key.Control_R) && (event.state & control_mask) == control_mask) || + ((event.keyval == Gdk.Key.Alt_L || event.keyval == Gdk.Key.Alt_R) && (event.state & alt_mask) == alt_mask)) { - var shift_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.MOD1_MASK; - var control_mask = Gdk.ModifierType.SHIFT_MASK | Gdk.ModifierType.MOD1_MASK; - var alt_mask = Gdk.ModifierType.CONTROL_MASK | Gdk.ModifierType.SHIFT_MASK; - if (((event.keyval == Gdk.Key.Shift_L || event.keyval == Gdk.Key.Shift_R) && (event.state & shift_mask) == shift_mask) || - ((event.keyval == Gdk.Key.Control_L || event.keyval == Gdk.Key.Control_R) && (event.state & control_mask) == control_mask) || - ((event.keyval == Gdk.Key.Alt_L || event.keyval == Gdk.Key.Alt_R) && (event.state & alt_mask) == alt_mask)) - { - debug ("Hidden user key combination detected"); - user_list.show_hidden_users = true; + debug ("Hidden user key combination detected"); + user_list.show_hidden_users = ! user_list.show_hidden_users; + return true; + } + } + else if (stack.top () is SessionList) { + // Session list is open + switch (event.keyval) { + case Gdk.Key.Escape: + case Gdk.Key.Left: + case Gdk.Key.KP_Left: + pop_list(); return true; - } } } @@ -408,16 +415,6 @@ public class MainWindow : Gtk.Window if (login_box.sensitive) top.scroll (GreeterList.ScrollTarget.DOWN); return true; - case Gdk.Key.Left: - case Gdk.Key.KP_Left: - if (shutdown_dialog != null) - shutdown_dialog.focus_prev (); - return true; - case Gdk.Key.Right: - case Gdk.Key.KP_Right: - if (shutdown_dialog != null) - shutdown_dialog.focus_next (); - return true; case Gdk.Key.F10: if (login_box.sensitive) menubar.select_first (false); diff --git a/src/menubar.vala b/src/menubar.vala index a417a03..87e0bf7 100644 --- a/src/menubar.vala +++ b/src/menubar.vala @@ -536,9 +536,17 @@ public class MenuBar : Gtk.MenuBar try { string[] argv; + string cmd; int onboard_stdout_fd; - - Shell.parse_argv ("onboard --xid", out argv); + var layout = AGSettings.get_string (AGSettings.KEY_ONSCREEN_KEYBOARD_LAYOUT); + var file = File.new_for_path ("/usr/share/onboard/layouts/%s.onboard".printf (layout)); + if (file.query_exists ()) { + cmd = "onboard --xid --layout='/usr/share/onboard/layouts/%s.onboard'".printf (layout); + } + else { + cmd = "onboard --xid"; + } + Shell.parse_argv (cmd, out argv); Process.spawn_async_with_pipes (null, argv, null, diff --git a/src/prompt-box.vala b/src/prompt-box.vala index 2180c70..a5d44bb 100644 --- a/src/prompt-box.vala +++ b/src/prompt-box.vala @@ -385,13 +385,18 @@ public class PromptBox : FadableBox queue_draw (); } - public void set_options_image (Gdk.Pixbuf? image) + public void set_options_image (Gdk.Pixbuf? image, string? tooltip) { if (option_button == null) return; option_image.pixbuf = image; + if (tooltip == null) + option_image.set_tooltip_text(""); + else + option_image.set_tooltip_text(tooltip); + if (image == null) option_button.hide (); else @@ -624,6 +629,30 @@ public class PromptBox : FadableBox { entry.visibility = false; entry.caps_lock_warning = true; + entry.button_release_event.connect ((widget, event) => { + if (event.button == 1) + show_toggle_visibility_icon (entry); + return false; + }); + entry.key_press_event.connect ((widget, event) => { + switch (event.keyval) { + case Gdk.Key.Left: + case Gdk.Key.KP_Left: + case Gdk.Key.Right: + case Gdk.Key.KP_Right: + show_toggle_visibility_icon (entry); + return false; + case Gdk.Key.F8: + if (Gdk.ModifierType.MOD1_MASK in event.state) { + entry.set_visibility (!entry.get_visibility ()); + show_toggle_visibility_icon (entry); + return true; + } + break; + } + return base.key_press_event (event); + }); + entry.icon_press.connect(entry_icon_press_cb); } entry.respond.connect (entry_activate_cb); @@ -633,6 +662,22 @@ public class PromptBox : FadableBox return entry; } + public void show_toggle_visibility_icon (Gtk.Entry entry) + { + if (entry.get_visibility ()) { + entry.set_icon_from_icon_name(Gtk.EntryIconPosition.PRIMARY, "view-conceal-symbolic"); + } + else { + entry.set_icon_from_icon_name(Gtk.EntryIconPosition.PRIMARY, "view-reveal-symbolic"); + } + } + + public void entry_icon_press_cb (Gtk.Entry entry, Gtk.EntryIconPosition position, Gdk.Event event) + { + entry.set_visibility (!entry.get_visibility ()); + show_toggle_visibility_icon (entry); + } + public Gtk.ComboBox add_combo (GenericArray<string> texts, bool read_only) { Gtk.ComboBoxText combo; diff --git a/src/session-list.vala b/src/session-list.vala index 290a7af..783206a 100644 --- a/src/session-list.vala +++ b/src/session-list.vala @@ -131,17 +131,24 @@ public class SessionList : GreeterList case "i3": case "i3-with-shmlog": return "i3_badge.png"; + case "sway": + return "sway_badge.svg"; case "lightdm-xsession": return "xsession_badge.png"; case "lxde": case "LXDE": return "lxde_badge.png"; + case "lxqt": + case "LXQt": + return "lxqt_badge.png"; case "matchbox": return "matchbox_badge.png"; case "mate": return "mate_badge.png"; case "openbox": return "openbox_badge.png"; + case "pademelon": + return "pademelon_badge.png"; case "sugar": return "sugar_badge.png"; case "surf-display": @@ -156,6 +163,8 @@ public class SessionList : GreeterList return "xmonad_badge.png"; case "icewm-session": return "icewm_badge.png"; + case "fynedesk": + return "fynedesk_badge.svg"; case "remote-login": return "remote_login_help.png"; default: diff --git a/src/settings.vala b/src/settings.vala index af753ce..9eef320 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -33,12 +33,15 @@ public class AGSettings : Object public const string KEY_THEME_NAME = "theme-name"; public const string KEY_HIGH_CONTRAST_THEME_NAME = "high-contrast-theme-name"; public const string KEY_ICON_THEME_NAME = "icon-theme-name"; + public const string KEY_CURSOR_THEME_NAME = "cursor-theme-name"; + public const string KEY_CURSOR_THEME_SIZE = "cursor-theme-size"; public const string KEY_FONT_NAME = "font-name"; public const string KEY_XFT_ANTIALIAS = "xft-antialias"; public const string KEY_XFT_DPI = "xft-dpi"; public const string KEY_XFT_HINTSTYLE = "xft-hintstyle"; public const string KEY_XFT_RGBA = "xft-rgba"; public const string KEY_ONSCREEN_KEYBOARD = "onscreen-keyboard"; + public const string KEY_ONSCREEN_KEYBOARD_LAYOUT = "onscreen-keyboard-layout"; public const string KEY_HIGH_CONTRAST = "high-contrast"; public const string KEY_BIG_FONT = "big-font"; public const string KEY_SCREEN_READER = "screen-reader"; diff --git a/src/shutdown-dialog.vala b/src/shutdown-dialog.vala index cf5e4a0..18e44b1 100644 --- a/src/shutdown-dialog.vala +++ b/src/shutdown-dialog.vala @@ -83,8 +83,8 @@ public class ShutdownDialog : Gtk.Fixed vbox.margin = BORDER_INTERNAL_SIZE; vbox.margin_top += 9; - vbox.margin_left += 20; - vbox.margin_right += 20; + vbox.margin_start += 20; + vbox.margin_end += 20; vbox.margin_bottom += 2; // This event box consumes the click events inside the vbox diff --git a/src/toggle-box.vala b/src/toggle-box.vala index 518275f..5301583 100644 --- a/src/toggle-box.vala +++ b/src/toggle-box.vala @@ -24,6 +24,7 @@ public class ToggleBox : Gtk.Box public string default_key {get; construct;} public string starting_key {get; construct;} public string selected_key {get; protected set;} + protected Gtk.Box scrolled_box; public static string font = AGSettings.get_string (AGSettings.KEY_FONT_NAME); public static string font_family = "sans"; @@ -33,6 +34,16 @@ public class ToggleBox : Gtk.Box { Object (default_key: default_key, starting_key: starting_key, selected_key: starting_key); + Gtk.ScrolledWindow scrolled_window = new Gtk.ScrolledWindow (null, null); + scrolled_box = new Gtk.Box (Gtk.Orientation.VERTICAL, 2); + add (scrolled_window); + scrolled_window.add (scrolled_box); + scrolled_window.show (); + scrolled_box.show (); + scrolled_window.set_max_content_height (210); // Show a max of 5 sessions + scrolled_window.set_propagate_natural_height (true); + scrolled_window.set_policy (Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC); + scrolled_window.set_shadow_type (Gtk.ShadowType.NONE); /* Split font family and size via regular expression. */ Regex font_regexp = new Regex ("^([[:blank:]]*)(?<font_family>[ a-zA-Z0-9]+) (?<font_size>[0-9]+)([[:blank:]]*)$"); @@ -55,7 +66,7 @@ public class ToggleBox : Gtk.Box select (item); item.show (); - add (item); + scrolled_box.add (item); } public void set_normal_button_style (Gtk.Button button) diff --git a/src/user-list.vala b/src/user-list.vala index 9f4b265..abbf576 100644 --- a/src/user-list.vala +++ b/src/user-list.vala @@ -121,8 +121,15 @@ public class UserList : GreeterList set { _default_session = value; - if (selected_entry != null) - selected_entry.set_options_image (get_badge ()); + if (selected_entry != null) { + selected_entry.set_options_image (get_badge (), value); + foreach (var session in LightDM.get_sessions ()) { + if (session.key == value) { + selected_entry.set_options_image (get_badge (), session.name); + break; + } + } + } } } @@ -136,8 +143,18 @@ public class UserList : GreeterList set { _session = value; - if (selected_entry != null) - selected_entry.set_options_image (get_badge ()); + if (selected_entry != null) { + selected_entry.set_options_image (get_badge (), value); + if (selected_entry != null) { + selected_entry.set_options_image (get_badge (), value); + foreach (var session in LightDM.get_sessions ()) { + if (session.key == value) { + selected_entry.set_options_image (get_badge (), session.name); + break; + } + } + } + } } } @@ -874,6 +891,10 @@ public class UserList : GreeterList } e.background = background; e.is_active = is_active; + if ( session == null) + { + session = default_session; + } e.session = ArcticaGreeter.validate_session(session); e.label = label; e.set_show_message_icon (has_messages); |