From 8fdb38b99be9c588148d576c23212af765ff7302 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Tue, 19 Sep 2017 22:41:33 +0200 Subject: Use GNotification instead of libnotify --- main/src/ui/util/label_hybrid.vala | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'main/src/ui/util') 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; } -- cgit v1.2.3-70-g09d2