commit 2e744d665dcdb4eca5ddab5049bd976b135aa62b
parent d77e7cab65c416f72ff1b52fa590b24ede512e75
Author: Christian Grothoff <christian@grothoff.org>
Date: Thu, 30 Dec 2021 14:36:34 +0100
address #7080
Diffstat:
2 files changed, 73 insertions(+), 5 deletions(-)
diff --git a/contrib/anastasis_gtk_main_window.glade b/contrib/anastasis_gtk_main_window.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.38.2
+<!-- Generated with glade 3.38.2
Copyright (C) 2019-2021 Anastasis SARL
@@ -897,6 +897,8 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="hexpand">True</property>
<property name="placeholder-text" translatable="yes">Max Mustermann</property>
<signal name="changed" handler="AG_identity_changed" swapped="no"/>
+ <signal name="focus-in-event" handler="anastasis_gtk_show_on_focus_in_event_cb" object="anastasis_gtk_name_casewarning_label" swapped="yes"/>
+ <signal name="focus-out-event" handler="anastasis_gtk_hide_on_focus_out_event_cb" object="anastasis_gtk_name_casewarning_label" swapped="yes"/>
<signal name="style-updated" handler="gtk_widget_queue_draw" swapped="no"/>
</object>
<packing>
@@ -948,6 +950,22 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="anastasis_gtk_name_casewarning_label">
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes">This field is case-sensitive. You must enter
+exactly the same value during recovery.</property>
+ <attributes>
+ <attribute name="foreground" value="#81813d3d9c9c"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="pack-type">end</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -1117,6 +1135,8 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="hexpand">True</property>
<property name="placeholder-text" translatable="yes">Earth</property>
<signal name="changed" handler="AG_identity_changed" swapped="no"/>
+ <signal name="focus-in-event" handler="anastasis_gtk_show_on_focus_in_event_cb" object="anastasis_gtk_birthplace_casewarning_label" swapped="yes"/>
+ <signal name="focus-out-event" handler="anastasis_gtk_hide_on_focus_out_event_cb" object="anastasis_gtk_birthplace_casewarning_label" swapped="no"/>
<signal name="style-updated" handler="gtk_widget_queue_draw" swapped="no"/>
</object>
<packing>
@@ -1168,6 +1188,21 @@ Author: Christian Grothoff, Dennis Neufeld
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="anastasis_gtk_birthplace_casewarning_label">
+ <property name="can-focus">False</property>
+ <property name="label" translatable="yes">This field is case-sensitive. You must enter
+exactly the same value during recovery.</property>
+ <attributes>
+ <attribute name="foreground" value="#81813d3d9c9c"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -2545,7 +2580,7 @@ identify your secret later.</property>
</child>
</object>
<packing>
- <property name="expand">False</property>
+ <property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
@@ -3584,9 +3619,6 @@ select a different provider or backup version.</property>
<property name="position">0</property>
</packing>
</child>
- <child>
- <placeholder/>
- </child>
</object>
</child>
</object>
diff --git a/src/anastasis/anastasis-gtk_helper.c b/src/anastasis/anastasis-gtk_helper.c
@@ -446,3 +446,39 @@ AG_expand_name (const char *name,
}
return NULL;
}
+
+
+/**
+ * Show widget on focus-in event.
+ *
+ * @param w widget to show (called with 'swapped' true!)
+ * @param event the event
+ * @param widget the widget being focused on
+ * @return FALSE
+ */
+bool
+anastasis_gtk_show_on_focus_in_event_cb (GtkWidget *w,
+ GdkEvent *event,
+ GtkWidget *widget)
+{
+ gtk_widget_show (w);
+ return FALSE;
+}
+
+
+/**
+ * Hide widget on focus-out event.
+ *
+ * @param w widget to show (called with 'swapped' true!)
+ * @param event the event
+ * @param widget the widget being focused on
+ * @return FALSE
+ */
+bool
+anastasis_gtk_hide_on_focus_out_event_cb (GtkWidget *w,
+ GdkEvent *event,
+ GtkWidget *widget)
+{
+ gtk_widget_hide (w);
+ return FALSE;
+}