aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/animate-timer.vala4
-rw-r--r--src/background.vala30
-rw-r--r--src/main-window.vala40
-rw-r--r--src/menubar.vala255
-rw-r--r--src/prompt-box.vala75
-rw-r--r--src/settings.vala6
-rw-r--r--src/user-list.vala30
8 files changed, 227 insertions, 215 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bb91f59..7ddcf57 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -91,7 +91,5 @@ arctica_greeter_LDADD = \
logo_generator_LDADD = $(arctica_greeter_LDADD)
-arctica_greeter_vala.stamp: $(top_srcdir)/config.h
-
DISTCLEANFILES = \
Makefile.in
diff --git a/src/animate-timer.vala b/src/animate-timer.vala
index 9f92448..4879cb0 100644
--- a/src/animate-timer.vala
+++ b/src/animate-timer.vala
@@ -2,6 +2,7 @@
*
* Copyright (C) 2011,2012 Canonical Ltd
* Copyright (C) 2015 Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+ * Copyright (C) 2025 Robert Tari
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -18,6 +19,7 @@
* Authors: Robert Ancell <robert.ancell@canonical.com>
* Michael Terry <michael.terry@canonical.com>
* Mike Gabriel <mike.gabriel@das-netzwerkteam.de>
+ * Robert Tari <robert@tari.in>
*/
private class AnimateTimer : Object
@@ -32,7 +34,7 @@ private class AnimateTimer : Object
public const int SLOW = 1000; /* Good for animations that convey information that is only presented in the animation */
/* speed is in milliseconds */
- public unowned EasingFunc easing_func { get; private set; }
+ public unowned EasingFunc easing_func;
public int speed { get; set; }
public bool is_running { get { return timeout != 0; } }
public double progress { get; private set; }
diff --git a/src/background.vala b/src/background.vala
index bf1ca6f..07dce7e 100644
--- a/src/background.vala
+++ b/src/background.vala
@@ -173,17 +173,43 @@ class BackgroundLoader : Object
var target_aspect = (double) width / height;
var aspect = (double) image.width / image.height;
double scale, offset_x = 0, offset_y = 0;
+ string sPosition = AGSettings.get_string (AGSettings.KEY_BACKGROUND_POSITION);
+
if (aspect > target_aspect)
{
/* Fit height and trim sides */
scale = (double) height / image.height;
- offset_x = (image.width * scale - width) / 2;
+
+ if (sPosition == "center")
+ {
+ offset_x = (image.width * scale - width) / 2;
+ }
+ else if (sPosition == "top-left" || sPosition == "bottom-left")
+ {
+ offset_x = 0;
+ }
+ else if (sPosition == "top-right" || sPosition == "bottom-right")
+ {
+ offset_x = (image.width * scale - width);
+ }
}
else
{
/* Fit width and trim top and bottom */
scale = (double) width / image.width;
- offset_y = (image.height * scale - height) / 2;
+
+ if (sPosition == "center")
+ {
+ offset_y = (image.height * scale - height) / 2;
+ }
+ else if (sPosition == "top-left" || sPosition == "top-right")
+ {
+ offset_y = 0;
+ }
+ else if (sPosition == "bottom-left" || sPosition == "bottom-right")
+ {
+ offset_y = (image.height * scale - height);
+ }
}
var scaled_image = new Gdk.Pixbuf (image.colorspace, image.has_alpha, image.bits_per_sample, width, height);
diff --git a/src/main-window.vala b/src/main-window.vala
index e1e39d2..621b115 100644
--- a/src/main-window.vala
+++ b/src/main-window.vala
@@ -129,40 +129,30 @@ public class MainWindow : Gtk.Window
login_box.add (content_box);
var content_align = AGSettings.get_string(AGSettings.KEY_CONTENT_ALIGN);
- var x_align = 0.5f;
+ var x_align = Gtk.Align.CENTER;
if (content_align == "left")
{
- x_align = 0.0f;
+ x_align = Gtk.Align.START;
}
else if (content_align == "right")
{
- x_align = 1.0f;
+ x_align = Gtk.Align.END;
}
- var align = new Gtk.Alignment (x_align, 0.0f, 0.0f, 1.0f);
+ hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
+ hbox.expand = true;
+ hbox.show ();
+ hbox.halign = x_align;
+ hbox.valign = Gtk.Align.CENTER;
if (content_align == "center")
{
// offset for back button
- align.margin_end = greeter.grid_size;
+ hbox.margin_end = greeter.grid_size;
}
- align.show ();
- content_box.add (align);
-
- hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
- hbox.expand = true;
- hbox.show ();
- align.add (hbox);
-
- align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
- align.resize_mode = Gtk.ResizeMode.QUEUE;
- align.set_size_request (greeter.grid_size, -1);
- align.margin_bottom = greeter.menubar_height; /* offset for menubar at top */
- align.show ();
- hbox.add (align);
-
+ content_box.add (hbox);
back_button = new FlatButton ();
back_button.get_accessible ().set_name (_("Back"));
Gtk.button_set_focus_on_click (back_button, false);
@@ -191,8 +181,14 @@ public class MainWindow : Gtk.Window
back_button.add (image);
back_button.clicked.connect (pop_list);
-
- align.add (back_button);
+ back_button.halign = Gtk.Align.CENTER;
+ back_button.valign = Gtk.Align.CENTER;
+ back_button.hexpand = false;
+ back_button.vexpand = false;
+ back_button.resize_mode = Gtk.ResizeMode.QUEUE;
+ back_button.set_size_request (greeter.grid_size, -1);
+ back_button.margin_bottom = greeter.menubar_height;
+ hbox.add (back_button);
stack = new ListStack ();
stack.show ();
diff --git a/src/menubar.vala b/src/menubar.vala
index 8ce73d7..0ba2903 100644
--- a/src/menubar.vala
+++ b/src/menubar.vala
@@ -101,7 +101,7 @@ private class IndicatorMenuItem : Gtk.MenuItem
}
}
-public class MenuBar : Gtk.MenuBar
+public class MenuBar : Gtk.Grid
{
public Background? background { get; construct; default = null; }
public Gtk.Window? keyboard_window { get; private set; default = null; }
@@ -112,70 +112,6 @@ public class MenuBar : Gtk.MenuBar
Object (background: bg, accel_group: ag);
}
- public override bool draw (Cairo.Context c)
- {
- if (background != null)
- {
- /* Disable background drawing to see how it changes the visuals. */
- /*
- int x, y;
- background.translate_coordinates (this, 0, 0, out x, out y);
- c.save ();
- c.translate (x, y);
- background.draw_full (c, Background.DrawFlags.NONE);
- c.restore ();
- */
- }
-
- /* Get the style and dimensions. */
- var style_ctx = this.get_style_context ();
-
- var w = this.get_allocated_width ();
- var h = this.get_allocated_height ();
-
- /* Add a group. */
- c.push_group ();
-
- /* Draw the background normally. */
- style_ctx.render_background (c, 0, 0, w, h);
-
- /* Draw the frame normally. */
- style_ctx.render_frame (c, 0, 0, w, h);
-
- /* Go back to the original widget. */
- c.pop_group_to_source ();
-
- var agsettings = new AGSettings ();
- if (agsettings.high_contrast) {
- /*
- * In case the high contrast mode is enabled, do not add any
- * transparency. While the GTK theme might define one (even though
- * it better should not, given that we are also switching to a
- * high contrast theme), we certainly do not want to make the look
- * fuzzy.
- */
- c.paint ();
- }
- else {
- /*
- * And finally repaint it with additional transparency.
- * Note that most GTK styles already define a transparency for OSD
- * menus. We want to have something more transparent, but also
- * make sure that it is not too transparent, so do not choose a
- * value that is too low here - certainly not your desired final
- * alpha value.
- */
- c.paint_with_alpha (AGSettings.get_double (AGSettings.KEY_MENUBAR_ALPHA));
- }
-
- foreach (var child in get_children ())
- {
- propagate_draw (child, c);
- }
-
- return false;
- }
-
public static void add_style_class (Gtk.Widget widget)
{
/*
@@ -187,132 +123,64 @@ public class MenuBar : Gtk.MenuBar
}
private List<Indicator.Object> indicator_objects;
+ private Gtk.MenuBar pMenubar;
construct
{
+ // Assure that printf operates in C.UTF-8 locale for float-to-string conversions.
+ Intl.setlocale(LocaleCategory.NUMERIC, "C.UTF-8");
+
+ this.pMenubar = new Gtk.MenuBar ();
+ this.pMenubar.halign = Gtk.Align.END;
+ this.pMenubar.hexpand = true;
+ this.pMenubar.pack_direction = Gtk.PackDirection.RTL;
+ this.pMenubar.show ();
+ this.attach (this.pMenubar, 1, 0, 1, 1);
+ this.show ();
add_style_class (this);
-
- /* Handle high contrast background color */
- var menubar_style = new Gtk.CssProvider ();
+ Gtk.CssProvider pGridProvider = new Gtk.CssProvider ();
+ Gtk.StyleContext pGridContext = this.get_style_context ();
+ Gdk.RGBA pBackground = getBackground (pGridContext, AGSettings.KEY_MENUBAR_BGCOLOR, AGSettings.KEY_MENUBAR_ALPHA);
+ int nBackgroundRed = (int)(pBackground.red * 255.0);
+ int nBackgroundGreen = (int)(pBackground.green * 255.0);
+ int nBackgroundBlue = (int)(pBackground.blue * 255.0);
+ Gdk.RGBA pShadow = getBackground (pGridContext, AGSettings.KEY_MENUBAR_SHADOW_COLOR, AGSettings.KEY_MENUBAR_SHADOW_ALPHA);
+ int nShadowRed = (int)(pShadow.red * 255.0);
+ int nShadowGreen = (int)(pShadow.green * 255.0);
+ int nShadowBlue = (int)(pShadow.blue * 255.0);
+ string sBackground = "* {background-color: rgba(%i, %i, %i, %f); border: none; box-shadow: 0px 5px 5px -5px rgba(%i, %i, %i, %f);}".printf (nBackgroundRed, nBackgroundGreen, nBackgroundBlue, pBackground.alpha, nShadowRed, nShadowGreen, nShadowBlue, pShadow.alpha);
try
{
- menubar_style.load_from_data ("*.high_contrast { background-color: #ffffff; }", -1);
+ pGridProvider.load_from_data (sBackground + " *.high_contrast {background-color: #ffffff; color: #000000; text-shadow: none; box-shadow: none;}", -1);
}
catch (Error pError)
{
- error ("Panic: Failed adding high contrast background-color: %s", pError.message);
+ error ("Panic: Failed loading menubar grid colours: %s", pError.message);
}
- this.get_style_context ().add_provider (menubar_style,
- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
- /* Add shadow. */
- var shadow_style = new Gtk.CssProvider ();
+ pGridContext.add_provider (pGridProvider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+
+ Gtk.CssProvider pMenubarProvider = new Gtk.CssProvider ();
try
{
- Intl.setlocale(LocaleCategory.NUMERIC, "C.UTF-8");
- shadow_style.load_from_data ("* { box-shadow: 0px 0px 5px 5px rgba(0.2,0.2,0.2,%f); }".printf(AGSettings.get_double (AGSettings.KEY_MENUBAR_ALPHA)), -1);
+ pMenubarProvider.load_from_data ("* { background-color: transparent; } *.high_contrast { color: #000000; text-shadow: none; }", -1);
}
catch (Error pError)
{
- error ("Panic: Failed adding shadow: %s", pError.message);
+ error ("Panic: Failed loading menubar colours: %s", pError.message);
}
- this.get_style_context ().add_provider (shadow_style,
- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- pack_direction = Gtk.PackDirection.RTL;
+ this.pMenubar.get_style_context ().add_provider (pMenubarProvider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
if (AGSettings.get_boolean (AGSettings.KEY_SHOW_HOSTNAME))
{
- var hostname_item = new Gtk.MenuItem.with_label (Posix.utsname ().nodename);
- append (hostname_item);
- hostname_item.show ();
-
- /*
- * Even though this (menu) item is insensitive, we want its label
- * text to have the sensitive color as to not look out of place
- * and difficult to read.
- *
- * There's a really weird bug that leads to always fetch the
- * sensitive color after the widget (menuitem in this case) has
- * been set to insensitive once - at least in this constructor.
- *
- * I haven't found a way to fix that, or, for that matter, what is
- * actually causing the issue. Even waiting on the main event loop
- * until all events are processed didn't help.
- *
- * We'll work around this issue by fetching the color before
- * setting the widget to insensitive and call it proper.
- */
- var insensitive_override_style = new Gtk.CssProvider ();
-
- /*
- * First, fetch the associated GtkStyleContext and save the state,
- * we'll override the state later on.
- */
- var hostname_item_ctx = hostname_item.get_style_context ();
- hostname_item_ctx.save ();
-
- try {
- /* Get the actual color. */
- var sensitive_color = hostname_item_ctx.get_color (Gtk.StateFlags.NORMAL);
- debug ("Directly fetched sensitive color: %s", sensitive_color.to_string ());
-
- insensitive_override_style.load_from_data ("*:disabled { color: %s; }
- *.high_contrast:disabled { color: #000000; }".printf(sensitive_color.to_string ()), -1);
- }
- catch (Error e)
- {
- debug ("Internal error loading hostname menu item text color: %s", e.message);
- }
- finally {
- /*
- * Restore the context, which we might have changed through the
- * previous get_color () call.
- */
- hostname_item_ctx.restore ();
- }
-
- try {
- /* And finally override the insensitive color. */
- hostname_item_ctx.add_provider (insensitive_override_style,
- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
-
- /*
- * Just overriding the color for the Gtk.MenuItem widget
- * doesn't help, we'll also apply it to the children.
- *
- * In theory, we could just use the get_child () method to
- * fetch the only child we should ever have on that widget,
- * namely a GtkAccelLabel, but that isn't future-proof enough,
- * especially if that is ever extended into having a submenu.
- *
- * Thus, iterate over all children and override the style for
- * all of them.
- */
- if (gtk_is_container (hostname_item)) {
- var children = hostname_item.get_children ();
- foreach (Gtk.Widget element in children) {
- var child_ctx = element.get_style_context ();
- debug ("Adding override style provider to child widget %s", element.name);
- child_ctx.add_provider (insensitive_override_style,
- Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
- }
- }
- }
- catch (Error e)
- {
- debug ("Internal error overriding hostname menu item text color: %s", e.message);
- }
-
- hostname_item.set_sensitive (false);
-
- /* The below does not work, so for now we need to stick to "set_right_justified"
- hostname_item.set_hexpand (true);
- hostname_item.set_halign (Gtk.Align.END);*/
- hostname_item.set_right_justified (true);
+ Gtk.Label pLabel = new Gtk.Label (Posix.utsname ().nodename);
+ pLabel.vexpand = true;
+ pLabel.margin_start = 6;
+ pLabel.show ();
+ this.attach (pLabel, 0, 0, 1, 1);
}
/* Prevent dragging the window by the menubar */
@@ -320,7 +188,7 @@ public class MenuBar : Gtk.MenuBar
{
var style = new Gtk.CssProvider ();
style.load_from_data ("* {-GtkWidget-window-dragging: false;}", -1);
- get_style_context ().add_provider (style, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
+ this.pMenubar.get_style_context ().add_provider (style, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
catch (Error e)
{
@@ -330,6 +198,11 @@ public class MenuBar : Gtk.MenuBar
setup_indicators ();
}
+ public void select_first (bool bSearchSensitive)
+ {
+ this.pMenubar.select_first (bSearchSensitive);
+ }
+
public override void get_preferred_height (out int min, out int nat)
{
var greeter = new ArcticaGreeter ();
@@ -337,6 +210,42 @@ public class MenuBar : Gtk.MenuBar
nat = (int)Math.round(greeter.menubar_height - 8);
}
+ private Gdk.RGBA getBackground (Gtk.StyleContext pContext, string sBackgroundKey, string sAlphaKey)
+ {
+ string sBackground = AGSettings.get_string (sBackgroundKey);
+ Gdk.RGBA pBackground;
+
+ if (sBackground != "")
+ {
+ pBackground = Gdk.RGBA ();
+ pBackground.parse (sBackground);
+ }
+ else
+ {
+ bool bFound = pContext.lookup_color ("osd_bg", out pBackground);
+
+ if (!bFound)
+ {
+ bFound = pContext.lookup_color ("dark_bg_color", out pBackground);
+
+ if (!bFound)
+ {
+ pBackground = Gdk.RGBA ();
+ pBackground.parse ("#444444");
+ debug ("Failed to retrieve osd_bg and dark_bg_color for %s - falling back to #444444", sBackgroundKey);
+ }
+ else
+ {
+ debug ("Failed to retrieve osd_bg for %s - falling back to dark_bg_color", sBackgroundKey);
+ }
+ }
+ }
+
+ pBackground.alpha = AGSettings.get_double (sAlphaKey);
+
+ return pBackground;
+ }
+
private Indicator.Object? load_indicator_file (string indicator_name)
{
string dir = Config.INDICATOR_FILE_DIR;
@@ -482,7 +391,7 @@ public class MenuBar : Gtk.MenuBar
{
var index = get_indicator_index (object);
var pos = 0;
- foreach (var child in get_children ())
+ foreach (var child in this.pMenubar.get_children ())
{
if (!(child is IndicatorMenuItem))
break;
@@ -499,19 +408,19 @@ public class MenuBar : Gtk.MenuBar
var menuitem = new IndicatorMenuItem (entry);
menuitem.set_data ("indicator-object", object);
- insert (menuitem, pos);
+ this.pMenubar.insert (menuitem, pos);
}
private void indicator_removed_cb (Indicator.Object object, Indicator.ObjectEntry entry)
{
debug ("Removing indicator object %p", entry);
- foreach (var child in get_children ())
+ foreach (var child in this.pMenubar.get_children ())
{
var menuitem = (IndicatorMenuItem) child;
if (menuitem.entry == entry)
{
- remove (child);
+ this.pMenubar.remove (child);
return;
}
}
diff --git a/src/prompt-box.vala b/src/prompt-box.vala
index b102887..fb3d4ab 100644
--- a/src/prompt-box.vala
+++ b/src/prompt-box.vala
@@ -247,13 +247,12 @@ public class PromptBox : FadableBox
message_image = new CachedImage (null);
message_image.set_from_icon_name("mail-unread", Gtk.IconSize.BUTTON);
-
- var align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
- align.valign = Gtk.Align.START;
- align.set_size_request (-1, greeter.grid_size);
- align.add (message_image);
- align.show ();
- name_grid.attach (align, COL_NAME_MESSAGE, ROW_NAME, 1, 1);
+ message_image.halign = Gtk.Align.CENTER;
+ message_image.valign = Gtk.Align.START;
+ message_image.hexpand = false;
+ message_image.vexpand = false;
+ message_image.set_size_request (-1, greeter.grid_size);
+ name_grid.attach (message_image, COL_NAME_MESSAGE, ROW_NAME, 1, 1);
option_button = new FlatButton ();
var option_button_ctx = option_button.get_style_context ();
@@ -343,12 +342,12 @@ public class PromptBox : FadableBox
small_message_image = new CachedImage (null);
small_message_image.set_from_icon_name("mail-unread", Gtk.IconSize.BUTTON);
-
- var align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
- align.set_size_request (-1, greeter.grid_size);
- align.add (small_message_image);
- align.show ();
- small_name_grid.attach (align, 2, 0, 1, 1);
+ small_message_image.halign = Gtk.Align.CENTER;
+ small_message_image.valign = Gtk.Align.CENTER;
+ small_message_image.hexpand = false;
+ small_message_image.vexpand = false;
+ small_message_image.set_size_request (-1, greeter.grid_size);
+ small_name_grid.attach (small_message_image, 2, 0, 1, 1);
small_name_grid.show ();
return small_name_grid;
@@ -560,7 +559,19 @@ public class PromptBox : FadableBox
ArcticaGreeter.add_style_class (w);
last_row += 1;
- box_grid.attach (w, COL_ENTRIES_START, last_row, COL_ENTRIES_WIDTH, 1);
+ bool bErrorBelow = AGSettings.get_boolean (AGSettings.KEY_ERROR_BELOW_ENTRY);
+
+ if (has_errors && bErrorBelow)
+ {
+ Gtk.Widget pChild = box_grid.get_child_at (COL_ENTRIES_START, last_row-1);
+ box_grid.remove (pChild);
+ box_grid.attach (w, COL_ENTRIES_START, last_row-1, COL_ENTRIES_WIDTH, 1);
+ box_grid.attach (pChild, COL_ENTRIES_START, last_row, COL_ENTRIES_WIDTH, 1);
+ }
+ else
+ {
+ box_grid.attach (w, COL_ENTRIES_START, last_row, COL_ENTRIES_WIDTH, 1);
+ }
update_prompt_visibility (w);
queue_resize ();
@@ -568,7 +579,7 @@ public class PromptBox : FadableBox
public void add_message (string text, bool is_error)
{
- var label = new FadingLabel (text);
+ var label = new FadingLabel ("");
var style_ctx = label.get_style_context();
@@ -601,6 +612,40 @@ public class PromptBox : FadableBox
label.xalign = 0.0f;
label.set_data<bool> ("prompt-box-is-error", is_error);
+ // Wrap the text if needed
+ ArcticaGreeter pGreeter = new ArcticaGreeter ();
+ Pango.Context pContext = label.get_pango_context ();
+ Pango.Layout pLayout = new Pango.Layout (pContext);
+ Pango.FontDescription pDescription = null;
+ Gtk.StateFlags nFlags = style_ctx.get_state ();
+ style_ctx.get (nFlags, "font", out pDescription, null);
+ pLayout.set_font_description (pDescription);
+ StringBuilder pBuilder = new StringBuilder ();
+ string[] lWords = text.split (" ");
+ string sLine = "";
+
+ foreach (string sWord in lWords)
+ {
+ string sTest = sLine == "" ? sWord : sLine + " " + sWord;
+ pLayout.set_text (sTest, -1);
+ int nWidth = 0;
+ pLayout.get_size (out nWidth, null);
+
+ if (nWidth / Pango.SCALE > (pGreeter.grid_size * GreeterList.BOX_WIDTH - (int)(GreeterList.BORDER * pGreeter.scaling_factor_widgets * 8)) && sLine != "")
+ {
+ pBuilder.append (sLine + "\n");
+ sLine = sWord;
+ }
+ else
+ {
+ sLine = sTest;
+ }
+ }
+
+ pBuilder.append (sLine);
+ label.set_text (pBuilder.str);
+ //~Wrap the text if needed
+
attach_item (label);
if (is_error)
diff --git a/src/settings.vala b/src/settings.vala
index 414020d..2a89c38 100644
--- a/src/settings.vala
+++ b/src/settings.vala
@@ -57,6 +57,7 @@ public class AGSettings : Object
public const string KEY_PLAY_READY_SOUND = "play-ready-sound";
public const string KEY_INDICATORS = "indicators";
public const string KEY_HIDDEN_USERS = "hidden-users";
+ public const string KEY_HIDDEN_GROUPS = "hidden-groups";
public const string KEY_USER_FILTER= "user-filter";
public const string KEY_USER_FILTER_ALWAYS = "user-filter-always";
public const string KEY_GROUP_FILTER = "group-filter";
@@ -98,6 +99,11 @@ public class AGSettings : Object
public const string KEY_LOGO_POSITION = "logo-position";
public const string KEY_LOGO_OFFSET_HORIZONTAL = "logo-offset-horizontal";
public const string KEY_LOGO_OFFSET_VERTICAL = "logo-offset-vertical";
+ public const string KEY_ERROR_BELOW_ENTRY = "error-below-entry";
+ public const string KEY_MENUBAR_BGCOLOR = "menubar-bgcolor";
+ public const string KEY_BACKGROUND_POSITION = "background-position";
+ public const string KEY_MENUBAR_SHADOW_COLOR = "menubar-shadow-color";
+ public const string KEY_MENUBAR_SHADOW_ALPHA = "menubar-shadow-alpha";
public static bool get_boolean (string key)
{
diff --git a/src/user-list.vala b/src/user-list.vala
index 3936768..3abfb06 100644
--- a/src/user-list.vala
+++ b/src/user-list.vala
@@ -87,10 +87,28 @@ public class UserList : GreeterList
}
var hidden_users = AGSettings.get_strv (AGSettings.KEY_HIDDEN_USERS);
+ string[] lHiddenGroups = AGSettings.get_strv (AGSettings.KEY_HIDDEN_GROUPS);
+
if (!value)
{
foreach (var username in hidden_users)
remove_entry (username);
+
+ foreach (string sGroup in lHiddenGroups)
+ {
+ LightDM.UserList lUsers = LightDM.UserList.get_instance ();
+
+ foreach (LightDM.User pUser in lUsers.users)
+ {
+ bool bInGroup = in_group (sGroup, pUser.name);
+
+ if (bInGroup)
+ {
+ remove_entry (pUser.name);
+ }
+ }
+ }
+
return;
}
@@ -1126,6 +1144,18 @@ public class UserList : GreeterList
foreach (var username in hidden_users)
if (username == user.name)
return;
+
+ string[] lHiddenGroups = AGSettings.get_strv (AGSettings.KEY_HIDDEN_GROUPS);
+
+ foreach (string sGroup in lHiddenGroups)
+ {
+ bool bInGroup = in_group (sGroup, user.name);
+
+ if (bInGroup)
+ {
+ return;
+ }
+ }
}
var user_filter = AGSettings.get_strv (AGSettings.KEY_USER_FILTER);