date-chooser: Add the split-month-year property
This allows unifying the month and year selectors into a single month and year selector by setting it to false.
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
db0f07136c
commit
78931df46c
@@ -7,13 +7,18 @@
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GcalMultiChoice" id="month_choice">
|
||||
<property name="visible" bind-source="GcalDateChooser" bind-property="show-heading" bind-flags="sync-create"/>
|
||||
<property name="halign">fill</property>
|
||||
<property name="min-value">0</property>
|
||||
<property name="max-value">11</property>
|
||||
<property name="animate">False</property>
|
||||
<property name="value">0</property>
|
||||
<signal name="notify::value" handler="multi_choice_changed" swapped="yes"/>
|
||||
<binding name="visible">
|
||||
<closure type="gboolean" function="get_split_choice_visible">
|
||||
<lookup name="show-heading">GcalDateChooser</lookup>
|
||||
<lookup name="split-month-year">GcalDateChooser</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
<signal name="notify::value" handler="split_multi_choice_changed" swapped="yes"/>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">0</property>
|
||||
@@ -22,19 +27,47 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GcalMultiChoice" id="year_choice">
|
||||
<property name="visible" bind-source="GcalDateChooser" bind-property="show-heading" bind-flags="sync-create"/>
|
||||
<binding name="visible">
|
||||
<closure type="gboolean" function="get_split_choice_visible">
|
||||
<lookup name="show-heading">GcalDateChooser</lookup>
|
||||
<lookup name="split-month-year">GcalDateChooser</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
<property name="halign">fill</property>
|
||||
<property name="min-value">0</property>
|
||||
<property name="max-value">120000</property>
|
||||
<property name="min-value">1</property>
|
||||
<property name="max-value">9999</property>
|
||||
<property name="animate">False</property>
|
||||
<property name="value">0</property>
|
||||
<signal name="notify::value" handler="multi_choice_changed" swapped="yes"/>
|
||||
<signal name="notify::value" handler="split_multi_choice_changed" swapped="yes"/>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GcalMultiChoice" id="combined_choice">
|
||||
<binding name="visible">
|
||||
<closure type="gboolean" function="get_combined_choice_visible">
|
||||
<lookup name="show-heading">GcalDateChooser</lookup>
|
||||
<lookup name="split-month-year">GcalDateChooser</lookup>
|
||||
</closure>
|
||||
</binding>
|
||||
<property name="halign">fill</property>
|
||||
<!-- From January 1 (month 12) to December 9999 (month 119999) -->
|
||||
<property name="min-value">12</property>
|
||||
<property name="max-value">119999</property>
|
||||
<property name="popover">popover</property>
|
||||
<property name="animate">False</property>
|
||||
<property name="value">0</property>
|
||||
<signal name="notify::value" handler="combined_multi_choice_changed" swapped="yes"/>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="column-span">2</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid">
|
||||
<property name="row-homogeneous">True</property>
|
||||
@@ -49,4 +82,33 @@
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
|
||||
<object class="GtkPopover" id="popover">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">12</property>
|
||||
<child>
|
||||
<object class="GcalMultiChoice" id="popover_month_choice">
|
||||
<property name="min-value" bind-source="month_choice" bind-property="min-value" bind-flags="sync-create|bidirectional" />
|
||||
<property name="max-value" bind-source="month_choice" bind-property="max-value" bind-flags="sync-create|bidirectional" />
|
||||
<property name="animate" bind-source="month_choice" bind-property="animate" bind-flags="sync-create|bidirectional" />
|
||||
<property name="value" bind-source="month_choice" bind-property="value" bind-flags="sync-create|bidirectional" />
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GcalMultiChoice">
|
||||
<property name="min-value" bind-source="year_choice" bind-property="min-value" bind-flags="sync-create|bidirectional" />
|
||||
<property name="max-value" bind-source="year_choice" bind-property="max-value" bind-flags="sync-create|bidirectional" />
|
||||
<property name="animate" bind-source="year_choice" bind-property="animate" bind-flags="sync-create|bidirectional" />
|
||||
<property name="value" bind-source="year_choice" bind-property="value" bind-flags="sync-create|bidirectional" />
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="activatable"/>
|
||||
<class name="month"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
|
||||
Reference in New Issue
Block a user