date-selector: show Day, Month and Year labels according to it's position
This commit is contained in:
committed by
Erick Pérez Castellanos
parent
71913eed41
commit
bfc6e37595
@@ -18,7 +18,8 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">1</property>
|
<property name="top_attach">2</property>
|
||||||
|
<property name="width">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
@@ -82,7 +83,8 @@
|
|||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">0</property>
|
<property name="left_attach">0</property>
|
||||||
<property name="top_attach">0</property>
|
<property name="top_attach">1</property>
|
||||||
|
<property name="width">3</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
|
|||||||
@@ -337,6 +337,7 @@ gcal_date_selector_constructed (GObject *object)
|
|||||||
{
|
{
|
||||||
GcalDateSelectorPrivate *priv;
|
GcalDateSelectorPrivate *priv;
|
||||||
GtkWidget *grid;
|
GtkWidget *grid;
|
||||||
|
GtkWidget *label;
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
|
|
||||||
GSettings *settings;
|
GSettings *settings;
|
||||||
@@ -390,6 +391,11 @@ gcal_date_selector_constructed (GObject *object)
|
|||||||
g_object_ref (priv->entries[DAY]);
|
g_object_ref (priv->entries[DAY]);
|
||||||
g_free (entry_name);
|
g_free (entry_name);
|
||||||
|
|
||||||
|
label = gtk_label_new (_("Day"));
|
||||||
|
gtk_widget_show (label);
|
||||||
|
gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
|
||||||
|
gtk_grid_attach (GTK_GRID (grid), label, priv->day_pos, 0, 1, 1);
|
||||||
|
|
||||||
/* month entry */
|
/* month entry */
|
||||||
entry_name = g_strdup_printf ("entry%d", priv->month_pos);
|
entry_name = g_strdup_printf ("entry%d", priv->month_pos);
|
||||||
|
|
||||||
@@ -398,6 +404,11 @@ gcal_date_selector_constructed (GObject *object)
|
|||||||
g_object_ref (priv->entries[MONTH]);
|
g_object_ref (priv->entries[MONTH]);
|
||||||
g_free (entry_name);
|
g_free (entry_name);
|
||||||
|
|
||||||
|
label = gtk_label_new (_("Month"));
|
||||||
|
gtk_widget_show (label);
|
||||||
|
gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
|
||||||
|
gtk_grid_attach (GTK_GRID (grid), label, priv->month_pos, 0, 1, 1);
|
||||||
|
|
||||||
/* year entry */
|
/* year entry */
|
||||||
entry_name = g_strdup_printf ("entry%d", priv->year_pos);
|
entry_name = g_strdup_printf ("entry%d", priv->year_pos);
|
||||||
|
|
||||||
@@ -409,6 +420,11 @@ gcal_date_selector_constructed (GObject *object)
|
|||||||
|
|
||||||
g_free (entry_name);
|
g_free (entry_name);
|
||||||
|
|
||||||
|
label = gtk_label_new (_("Year"));
|
||||||
|
gtk_widget_show (label);
|
||||||
|
gtk_style_context_add_class (gtk_widget_get_style_context (label), "dim-label");
|
||||||
|
gtk_grid_attach (GTK_GRID (grid), label, priv->year_pos, 0, 1, 1);
|
||||||
|
|
||||||
/* signals and properties */
|
/* signals and properties */
|
||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user