aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2023-03-22 04:17:50 +0100
committerMihai Moldovan <ionic@ionic.de>2023-05-03 23:04:53 +0200
commit20836a6021de0c7f4675881e56f62b32fa78726c (patch)
tree1c6bb17ceaf143904eb5b822af3a6a0ff5463bbc /src
parent036a3b7718f827f2092014c90e883023f125fa7d (diff)
downloadarctica-greeter-20836a6021de0c7f4675881e56f62b32fa78726c.tar.gz
arctica-greeter-20836a6021de0c7f4675881e56f62b32fa78726c.tar.bz2
arctica-greeter-20836a6021de0c7f4675881e56f62b32fa78726c.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/prompt-box.vala13
1 files changed, 12 insertions, 1 deletions
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<bool> ("prompt-box-is-error", is_error);