[seahorse/gnome-40] datepicker: Only popdown on calendar double click



commit 6f799c368688cf9389c1f262f1ad8de4eb12bf7b
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]