date-chooser: add date chooser widget

This is mainly a copy-paste from an old branch authored
by Matthias Clasen. The code style was updated to match
Calendar's one, and the theming was improved a little bit.
This commit is contained in:
Georges Basile Stavracas Neto
2016-07-23 17:47:11 -03:00
parent 4880c68347
commit c2dca8a3dc
12 changed files with 2085 additions and 0 deletions
+2
View File
@@ -51,10 +51,12 @@ EXTRA_DIST= \
shell-search-provider-dbus-interfaces.xml \
ui/alarm-row.ui \
ui/calendar-row.ui \
ui/date-chooser.ui \
ui/date-selector.ui \
ui/edit-dialog.ui \
ui/help-overlay.ui \
ui/menus.ui \
ui/multi-choice.ui \
ui/quick-add-popover.ui \
ui/search-view.ui \
ui/source-dialog.ui \
+2
View File
@@ -3,8 +3,10 @@
<gresource prefix="/org/gnome/calendar">
<file alias="alarm-row.ui" compressed="true" preprocess="xml-stripblanks">ui/alarm-row.ui</file>
<file alias="calendar-row.ui" compressed="true" preprocess="xml-stripblanks">ui/calendar-row.ui</file>
<file alias="date-chooser.ui" compressed="true" preprocess="xml-stripblanks">ui/date-chooser.ui</file>
<file alias="date-selector.ui" compressed="true" preprocess="xml-stripblanks">ui/date-selector.ui</file>
<file alias="edit-dialog.ui" compressed="true" preprocess="xml-stripblanks">ui/edit-dialog.ui</file>
<file alias="multi-choice.ui" compressed="true" preprocess="xml-stripblanks">ui/multi-choice.ui</file>
<file alias="online-account-row.ui" compressed="true" preprocess="xml-stripblanks">ui/online-account-row.ui</file>
<file alias="quick-add-popover.ui" compressed="true" preprocess="xml-stripblanks">ui/quick-add-popover.ui</file>
<file alias="search-view.ui" compressed="true" preprocess="xml-stripblanks">ui/search-view.ui</file>
+31
View File
@@ -290,3 +290,34 @@ button:checked:not(:backdrop) .calendar-color-image,
.sources-button:not(:backdrop):not(:disabled) .calendar-color-image {
-gtk-icon-shadow: 0 1px alpha(black, 0.1);
}
/* Date chooser */
datechooser .weeknum,
datechooser .weekday {
color: alpha(@theme_fg_color, 0.55);;
font-size: 80%;
}
navigator button {
padding: 0;
}
navigator label {
font-weight: bold;
}
datechooser day {
color: @theme_fg_color;
min-width: 32px;
min-height: 32px;
}
datechooser day.other-month {
color: @theme_insensitive_fg_color;
}
datechooser day:selected {
color: @theme_selected_fg_color;
background-color: @theme_selected_bg_color;
border-radius: 50%;
}
+54
View File
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<requires lib="gtk+" version="3.16"/>
<template class="GcalDateChooser" parent="GtkBin">
<child>
<object class="GtkGrid">
<property name="visible">True</property>
<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"/>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GcalMultiChoice" id="year_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">120000</property>
<property name="animate">False</property>
<property name="value">0</property>
<signal name="notify::value" handler="multi_choice_changed" swapped="yes"/>
</object>
<packing>
<property name="left-attach">1</property>
<property name="top-attach">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid">
<property name="visible">True</property>
<property name="row-homogeneous">True</property>
<property name="column-homogeneous">True</property>
</object>
<packing>
<property name="left-attach">0</property>
<property name="top-attach">1</property>
<property name="width">2</property>
</packing>
</child>
</object>
</child>
</template>
</interface>
+71
View File
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface domain="gtk30">
<requires lib="gtk+" version="3.16"/>
<template class="GcalMultiChoice" parent="GtkBox">
<property name="visible">True</property>
<child>
<object class="GtkButton" id="down_button">
<property name="visible">True</property>
<property name="relief">none</property>
<signal name="button-press-event" handler="button_press_cb"/>
<signal name="button-release-event" handler="button_release_cb"/>
<signal name="clicked" handler="button_clicked_cb"/>
<style>
<class name="image-button"/>
<class name="back-button"/>
<class name="circular"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">pan-start-symbolic</property>
</object>
</child>
</object>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
</object>
<packing>
<property name="name">label1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
</object>
<packing>
<property name="name">label2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="up_button">
<property name="visible">True</property>
<property name="relief">none</property>
<signal name="button-press-event" handler="button_press_cb"/>
<signal name="button-release-event" handler="button_release_cb"/>
<signal name="clicked" handler="button_clicked_cb"/>
<style>
<class name="image-button"/>
<class name="forward-button"/>
<class name="circular"/>
</style>
<child>
<object class="GtkImage">
<property name="visible">True</property>
<property name="icon_name">pan-end-symbolic</property>
</object>
</child>
</object>
</child>
</template>
</interface>