[seahorse/bugfix/datepicker-only-popdown-on-double-click] datepicker: Only popdown on calendar double click




commit 26d917fe5d7aa9632cfdd7959d090a2c2fc1de8e
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Sun Jul 25 12:39:19 2021 +0200

    datepicker: Only popdown on calendar double click
    
    Don't popdown the popover which contains the GtkCalendar on the
    "day-selected" signal, as this is also emitted on each time you change
    the month/year.
    
    Instead, use the "day-selected-double-click" instead, which is a better
    fit.
    
    Fixes https://gitlab.gnome.org/GNOME/seahorse/-/issues/331

 common/datepicker.vala | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/common/datepicker.vala b/common/datepicker.vala
index 40c828d3..2183492c 100644
--- a/common/datepicker.vala
+++ b/common/datepicker.vala
@@ -72,6 +72,7 @@ public class Seahorse.DatePicker : Gtk.Box {
         this.calendar.show_day_names = true;
         this.calendar.show_heading = true;
         this.calendar.day_selected.connect(on_calendar_day_selected);
+        this.calendar.day_selected_double_click.connect(on_calendar_day_selected_double_click);
         this.calendar_popover.add(this.calendar);
     }
 
@@ -101,6 +102,9 @@ public class Seahorse.DatePicker : Gtk.Box {
         calendar.get_date(out y, out m, out d);
         // Note: GtkCalendar's months are [0,11] while GDateTime uses [1,12]
         this.datetime = new DateTime.utc((int) y, (int) m + 1, (int) d, 0, 0, 0);
+    }
+
+    private void on_calendar_day_selected_double_click(Gtk.Calendar calendar) {
         this.calendar_popover.popdown();
     }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]