time-selector: limit to 11 hours when using 12h format
This commit is contained in:
committed by
Erick Pérez Castellanos
parent
37a38b6acb
commit
de04c78cc0
@@ -104,6 +104,7 @@ gcal_time_selector_constructed (GObject *object)
|
|||||||
GcalTimeSelectorPrivate *priv;
|
GcalTimeSelectorPrivate *priv;
|
||||||
GtkWidget *grid;
|
GtkWidget *grid;
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
|
GtkAdjustment *adj;
|
||||||
|
|
||||||
GSettings *settings;
|
GSettings *settings;
|
||||||
gchar *clock_format;
|
gchar *clock_format;
|
||||||
@@ -154,6 +155,13 @@ gcal_time_selector_constructed (GObject *object)
|
|||||||
gtk_container_add (GTK_CONTAINER (priv->popover), grid);
|
gtk_container_add (GTK_CONTAINER (priv->popover), grid);
|
||||||
g_object_bind_property (priv->popover, "visible", object, "active", G_BINDING_BIDIRECTIONAL);
|
g_object_bind_property (priv->popover, "visible", object, "active", G_BINDING_BIDIRECTIONAL);
|
||||||
|
|
||||||
|
/* maximum of 11 for 12h format */
|
||||||
|
if (! priv->format_24h)
|
||||||
|
{
|
||||||
|
adj = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON (priv->hour_spin));
|
||||||
|
gtk_adjustment_set_upper (adj, 11.0);
|
||||||
|
}
|
||||||
|
|
||||||
/* signals */
|
/* signals */
|
||||||
g_signal_connect (priv->hour_spin, "output", G_CALLBACK (on_output), object);
|
g_signal_connect (priv->hour_spin, "output", G_CALLBACK (on_output), object);
|
||||||
g_signal_connect (priv->minute_spin, "output", G_CALLBACK (on_output), object);
|
g_signal_connect (priv->minute_spin, "output", G_CALLBACK (on_output), object);
|
||||||
|
|||||||
Reference in New Issue
Block a user