year-view: Remove hardcoded values
Improve year-view code, removing hardcoded values. year-view have hardcoded values for grid cell sizes (width and height). Those values need to be recalculated every time a change in font or any other style are changed. Sidebar width was also hardcoded instead of getting its value directly from the ui file. That would prevent it from drawing the content accordingly when ui file is changed. This patch fixes those two issues by retrieving those values from CSS or ui files. This patch also adds code to resize and redraw the window when show-week-numbers property is changed. Popover mode was also changed and now sidebar will always be shown when show-week-numbers is set or when there is space for only 3 or less columns. https://bugzilla.gnome.org/show_bug.cgi?id=753533
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
32a3a8f530
commit
97d8859574
@@ -89,6 +89,7 @@ calendar-view.second-view-header {
|
||||
}
|
||||
|
||||
.year-navigator.days {
|
||||
padding: 5px;
|
||||
color: @theme_fg_color;
|
||||
font: 9;
|
||||
}
|
||||
|
||||
+24
-10
@@ -6,17 +6,31 @@
|
||||
<class name="year-view"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkDrawingArea" id="navigator">
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="visible">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK|GDK_BUTTON_MOTION_MASK|GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK|GDK_STRUCTURE_MASK</property>
|
||||
<signal name="draw" handler="draw_navigator" object="GcalYearView" swapped="yes"/>
|
||||
<signal name="button-press-event" handler="navigator_button_press_cb" object="GcalYearView" swapped="yes"/>
|
||||
<signal name="button-release-event" handler="navigator_button_release_cb" object="GcalYearView" swapped="yes"/>
|
||||
<signal name="motion-notify-event" handler="navigator_motion_notify_cb" object="GcalYearView" swapped="yes"/>
|
||||
<style>
|
||||
<class name="year-navigator"/>
|
||||
</style>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<property name="visible">True</property>
|
||||
<property name="shadow_type">none</property>
|
||||
<property name="vexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkDrawingArea" id="navigator">
|
||||
<property name="visible">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="events">GDK_POINTER_MOTION_MASK|GDK_BUTTON_MOTION_MASK|GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK|GDK_STRUCTURE_MASK</property>
|
||||
<signal name="draw" handler="draw_navigator" object="GcalYearView" swapped="yes"/>
|
||||
<signal name="button-press-event" handler="navigator_button_press_cb" object="GcalYearView" swapped="yes"/>
|
||||
<signal name="button-release-event" handler="navigator_button_release_cb" object="GcalYearView" swapped="yes"/>
|
||||
<signal name="motion-notify-event" handler="navigator_motion_notify_cb" object="GcalYearView" swapped="yes"/>
|
||||
<style>
|
||||
<class name="year-navigator"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
|
||||
Reference in New Issue
Block a user