From 036a3b7718f827f2092014c90e883023f125fa7d Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 22 Mar 2023 04:08:18 +0100 Subject: src/prompt-box.vala: enable line wrapping for (error) messages. Long lines were previously truncated as part of the fading label. Since PAM (error) messages are shown within the prompt box, truncating them is a really bad idea, since the user might not understand what went wrong and how it can be fixed. Enabling line wrapping makes sure that the full message is always shown - at least theoretically. Messages may still be truncated if they are long enough to overflow the prompt box itself, but this is caused by the prompt box not resizing itself correctly. Further work on that is necessary. --- src/prompt-box.vala | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/prompt-box.vala b/src/prompt-box.vala index ffce61c..6953c1b 100644 --- a/src/prompt-box.vala +++ b/src/prompt-box.vala @@ -555,6 +555,7 @@ public class PromptBox : FadableBox public void add_message (string text, bool is_error) { var label = new FadingLabel (text); + label.set_line_wrap (true); var style_ctx = label.get_style_context(); -- cgit v1.2.3 From 20836a6021de0c7f4675881e56f62b32fa78726c Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 22 Mar 2023 04:17:50 +0100 Subject: src/prompt-box.vala: set background color for error messages to pure white. While this might look ugly, it is important that error messages can be read well and a transparent background might be a bad fit with a static red text color, if the background is also quite red. --- src/prompt-box.vala | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/prompt-box.vala b/src/prompt-box.vala index 6953c1b..d925739 100644 --- a/src/prompt-box.vala +++ b/src/prompt-box.vala @@ -573,10 +573,21 @@ public class PromptBox : FadableBox } Gdk.RGBA color = { 1.0f, 1.0f, 1.0f, 1.0f }; - if (is_error) + if (is_error) { color.parse ("#df382c"); + + /* + * Overriding the background color will look ugly, but at least + * always make the text readable, which is probably important for + * error messages. + * We probably want to find a better way of handling this. + */ + Gdk.RGBA bg_color = { 1.0f, 1.0f, 1.0f, 1.0f }; + label.override_background_color (Gtk.StateFlags.NORMAL, bg_color); + } label.override_color (Gtk.StateFlags.NORMAL, color); + label.xalign = 0.0f; label.set_data ("prompt-box-is-error", is_error); -- cgit v1.2.3 From 5cc2e006692e71bf037be83e138f94273b36d4da Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 22 Mar 2023 04:19:07 +0100 Subject: src/prompt-box.vala: darken red error message text color. This improves the contrast considerably for the new static white background. --- src/prompt-box.vala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/prompt-box.vala b/src/prompt-box.vala index d925739..e1dc629 100644 --- a/src/prompt-box.vala +++ b/src/prompt-box.vala @@ -574,7 +574,7 @@ public class PromptBox : FadableBox Gdk.RGBA color = { 1.0f, 1.0f, 1.0f, 1.0f }; if (is_error) { - color.parse ("#df382c"); + color.parse ("#820900"); /* * Overriding the background color will look ugly, but at least -- cgit v1.2.3 From bb6534f7098043619991b312c2196e4c9007fa54 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 22 Mar 2023 04:33:07 +0100 Subject: src/arctica-greeter.vala: fix "this this" typo in comment. --- src/arctica-greeter.vala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index c765151..3ba2ff4 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -113,8 +113,8 @@ public class ArcticaGreeter : Object * * Making the parameter optional is a good compromise. * - * This this parameter is construct-only, initializing it by passing it to - * the GObject constructor is both the correct way to do it, and it will + * This parameter is construct-only, initializing it by passing it to the + * GObject constructor is both the correct way to do it, and it will * additionally avoid changing it in later calls of our constructor. */ public ArcticaGreeter (bool test_mode_ = false, -- cgit v1.2.3