aboutsummaryrefslogtreecommitdiff
path: root/main/src/ui/util
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/ui/util')
-rw-r--r--main/src/ui/util/label_hybrid.vala20
1 files changed, 12 insertions, 8 deletions
diff --git a/main/src/ui/util/label_hybrid.vala b/main/src/ui/util/label_hybrid.vala
index ab765dd1..8ca56316 100644
--- a/main/src/ui/util/label_hybrid.vala
+++ b/main/src/ui/util/label_hybrid.vala
@@ -34,13 +34,7 @@ public class EntryLabelHybrid : LabelHybrid {
get { return entry.text; }
set {
entry.text = value;
- if (visibility) {
- label.label = value;
- } else {
- string filler = "";
- for (int i = 0; i < value.length; i++) filler += entry.get_invisible_char().to_string();
- label.label = filler;
- }
+ set_label_label(value);
}
}
@@ -83,7 +77,7 @@ public class EntryLabelHybrid : LabelHybrid {
if (event.keyval == Gdk.Key.Return) {
show_label();
} else {
- label.label = entry.text;
+ set_label_label(entry.text);
}
return false;
});
@@ -93,6 +87,16 @@ public class EntryLabelHybrid : LabelHybrid {
});
}
+ private void set_label_label(string value) {
+ if (visibility) {
+ label.label = value;
+ } else {
+ string filler = "";
+ for (int i = 0; i < value.length; i++) filler += entry.get_invisible_char().to_string();
+ label.label = filler;
+ }
+ }
+
private void update_label() {
text = text;
}