diff options
| author | Robert Tari <robert@tari.in> | 2025-04-28 14:47:51 +0200 |
|---|---|---|
| committer | Robert Tari <robert@tari.in> | 2025-04-28 14:47:51 +0200 |
| commit | 652c4d74d88b6fbf1a4921bc868e06fa3711992b (patch) | |
| tree | bd1b86c23bab6000ca901287151002b164d74cf5 | |
| parent | c6e07588ec722bbb178c943f10784cba0bda83a2 (diff) | |
| download | arctica-greeter-652c4d74d88b6fbf1a4921bc868e06fa3711992b.tar.gz arctica-greeter-652c4d74d88b6fbf1a4921bc868e06fa3711992b.tar.bz2 arctica-greeter-652c4d74d88b6fbf1a4921bc868e06fa3711992b.zip | |
Allow error label to be displayed below the login entry
| -rw-r--r-- | data/org.ArcticaProject.arctica-greeter.gschema.xml | 4 | ||||
| -rw-r--r-- | src/prompt-box.vala | 14 | ||||
| -rw-r--r-- | src/settings.vala | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/data/org.ArcticaProject.arctica-greeter.gschema.xml b/data/org.ArcticaProject.arctica-greeter.gschema.xml index 38be872..d2ed4e4 100644 --- a/data/org.ArcticaProject.arctica-greeter.gschema.xml +++ b/data/org.ArcticaProject.arctica-greeter.gschema.xml @@ -335,5 +335,9 @@ <default>1</default> <summary>The vertical offset of the logo from the edge of the screen in grid units.</summary> </key> + <key name="error-below-entry" type="b"> + <default>false</default> + <summary>Whether to display the error label below the login entry.</summary> + </key> </schema> </schemalist> diff --git a/src/prompt-box.vala b/src/prompt-box.vala index 4c8087e..fb3d4ab 100644 --- a/src/prompt-box.vala +++ b/src/prompt-box.vala @@ -559,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 (); diff --git a/src/settings.vala b/src/settings.vala index 414020d..b65bac5 100644 --- a/src/settings.vala +++ b/src/settings.vala @@ -98,6 +98,7 @@ 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 static bool get_boolean (string key) { |
