From 01fa69907ef5b812006bb738055aefc9bbeb422f Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Mon, 24 Aug 2026 20:39:36 +0900 Subject: [PATCH 1/2] Hide session dropdown if only single session available --- src/Widgets/SessionButton.vala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Widgets/SessionButton.vala b/src/Widgets/SessionButton.vala index 69447e3d..ae27912c 100644 --- a/src/Widgets/SessionButton.vala +++ b/src/Widgets/SessionButton.vala @@ -24,6 +24,8 @@ public class Greeter.SessionButton : Granite.Bin { has_frame = false }; + visible = iter.n_children () > 1; + child = menu_button; } } From 9584e2cf01e3b011ce5c79b46ff195e6c2119f62 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Mon, 24 Aug 2026 22:48:56 +0900 Subject: [PATCH 2/2] Avoid extra right margin --- src/Cards/UserCard.vala | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Cards/UserCard.vala b/src/Cards/UserCard.vala index 4f9a4be3..e72c46e4 100644 --- a/src/Cards/UserCard.vala +++ b/src/Cards/UserCard.vala @@ -54,14 +54,18 @@ public class Greeter.UserCard : Greeter.BaseCard { vexpand = true }; - var password_grid = new Gtk.Grid () { - column_spacing = 6, - row_spacing = 6 - }; - password_grid.attach (password_entry, 0, 0); - password_grid.attach (fingerprint_image, 1, 0); - password_grid.attach (password_session_button, 2, 0); - password_grid.attach (new Greeter.CapsLockRevealer (), 0, 1, 3); + /* + * Combine two Gtk.Boxes instead of using one Gtk.Grid to avoid column_spacing becomes extra right margin + * when only password_entry is visible in the first row. + */ + var password_hbox = new Gtk.Box (HORIZONTAL, 6); + password_hbox.append (password_entry); + password_hbox.append (fingerprint_image); + password_hbox.append (password_session_button); + + var password_box = new Gtk.Box (VERTICAL, 6); + password_box.append (password_hbox); + password_box.append (new Greeter.CapsLockRevealer ()); var login_button = new Gtk.Button.with_label (_("Log In")); login_button.add_css_class (Granite.CssClass.SUGGESTED); @@ -89,7 +93,7 @@ public class Greeter.UserCard : Greeter.BaseCard { margin_start = 24, margin_end = 24 }; - login_stack.add_named (password_grid, "password"); + login_stack.add_named (password_box, "password"); login_stack.add_named (login_button, "button"); login_stack.add_named (disabled_box, "disabled");