Commit Graph
145 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto f1069c96d6 event: implement GInitable
Since the event creation can fail, lets make it a GInitable
so that we can fail during initialization.

https://bugzilla.gnome.org/show_bug.cgi?id=763166
2016-09-28 00:07:28 -03:00
Georges Basile Stavracas Neto 81873994da views: protect against invalid drop
If the user tries to drop a e.g. file, GNOME Calendar crashes
immediately.

While the desired behavior would be checking if that's an ics file,
lets just not crash for now.

https://bugzilla.gnome.org/show_bug.cgi?id=771680
2016-09-27 22:41:17 -03:00
Ernestas Kulik 04617fc06b year-view: fix dnd
Currently, the end date is set by calling gcal_event_set_date_end() with
new_start instead of new_end, which is incorrect.

With the former issue fixed, the difference evaluates to one less than
required when dragging to a later date. This can be fixed by calculating
the drop date by adding to the start date and adding the difference.

This commit fixes both issues.

https://bugzilla.gnome.org/show_bug.cgi?id=769470
2016-08-11 19:05:01 +03:00
Georges Basile Stavracas Neto dfdaa3a590 year-view: simplify empty sidebar list calculation 2016-07-05 23:55:33 -03:00
Isaque Galdino 3dbe4addeb year-view: Popover position
Year view was placing popover to mouse click (x,y) position. That was a
little odd because sometimes popover was placed above the selected day.

This patch address that by placing popover always out of the day box.

When selecting the whole month or more than one day, popover will also
be placed out of the month box. reducing the chance to cover selected
days.

https://bugzilla.gnome.org/show_bug.cgi?id=743306
2016-06-17 18:00:32 -03:00
Iain Lane 9b358eb0ba year-view: Use the new schema from gsettings-desktop-schemas
So that we don't have to depend on GNOME shell.

https://bugzilla.gnome.org/show_bug.cgi?id=764001
2016-05-31 14:18:13 -03:00
Georges Basile Stavracas Neto 1c90791d3b year-view: fix hover & dnd drawing on RTL locales 2016-05-21 19:06:15 -03:00
Georges Basile Stavracas Neto 88730dbafb year-view: don't render DnD when it leaves 2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 82c7918b15 year-view: implement the ::drag-drop operation
This magical commit finally implements the Drag and Drop
on Year view, enabling users to drop events from the sidebar
to the year navigator.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 44f5cbe607 year-view: render DnD selector on hover
This commit adds the ability to render a DnD square
to give visual feedback for the hover operation.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto c7d92e9f37 year-view: make the year navigator a DnD dest
This way, we can drop events at the widget.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 9c150de822 year-view: don't cancel selection while dragging
This breaks the users' expectations that the navigator
will keep the selected dates. The old behavior was hazardous
for users with disabilities.

https://bugzilla.gnome.org/show_bug.cgi?id=762462
2016-05-20 22:18:34 -03:00
Georges Basile Stavracas Neto 6a8a4dfad0 year-view: add hover effect to the navigator
The current implementation of the Year navigator gives
absolutely no clue that the days are actually selectable,
which may confuse some users.

A simple way to inform the user that the Year navigator
is actually interactive is the hovering effect.

Fix the lack of feedback by adding the hover effect to the
year navigator.

https://bugzilla.gnome.org/show_bug.cgi?id=762462
2016-05-20 22:09:00 -03:00
Isaque Galdino f32fd7d2f6 year-view: Reduce maximum of month columns
The view had a maximum of 6 month columns, leading to a huge amount of
vertical spaces, so it was requested to reduce that.

The maximum number of columns was reduced to 4, so the view will have a
maximum 4x3 months layout.

https://bugzilla.gnome.org/show_bug.cgi?id=753533
2016-05-20 12:07:11 -03:00
Georges Basile Stavracas Neto a83e8dd972 year-view: calculate number of rows on-the-fly
Instead of adding another field to the structure and
do many pointer lookups, calculate the number of rows
on the fly.
2016-05-19 09:57:42 -03:00
Isaque Galdino 3ead41b83f year-view: show all month's events
User requested when clicking month's name, all month's events are shown
in the sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=755394
2016-05-17 11:28:08 -03:00
Isaque Galdino 97d8859574 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
2016-05-16 12:03:39 -03:00
Isaque Galdino 32c5c824e3 year-view: Read show-weekdate from GNOME Shell
Year view always shows week numbers and by design team the default show
not display them.

This patch adds support to read "show week numbers" setting from GNOME
Shell (org.gnome.shell.calendar::show-weekdate) and to change year-view
accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=763251
2016-03-14 16:57:45 -03:00
fosero 465d786ae8 year-view: criticals on last day of month events
Adding 1 to the day variable at the end of the month results in an
invalid datetime, use g_date_time_add_days instead.

https://bugzilla.gnome.org/show_bug.cgi?id=763015
2016-03-14 16:54:54 -03:00
Isaque Galdino 8af0e6f84e year-view: Week numbers shown in big dark squares
Design team testing with GNOME continuous, complained about week numbers
being shown in big dark squares. According to them, these wreck the
layout of the view.

Design team listed the issues, comparing to gnome-shell calendar as:
 * The containing boxes are larger in Calendar.
 * The background of the boxes has more contrast with the background (it
should be a lot lighter in Calendar).
 * Week numbers are an option in the shell, and are off by default.

This patches fixes the two first items: week numbers box' size and
color. Option to set on/off week numbers will be implemented in a future
patch.

https://bugzilla.gnome.org/show_bug.cgi?id=763251
2016-03-10 23:29:06 -03:00
Georges Basile Stavracas Neto 34a6ac389a view: update interface code
This commit updates GcalView interface to use
modern GLib API and, consequently, removes tons
of obsolete code.
2016-03-09 14:19:04 -03:00
Isaque Galdino d7daa8fe29 year-view: Week numbers overlapping view edge
In some conditions when window is narrower than taller, week numbers
overlaps the view edge. That problem started after we added a
background to week numbers and moved it a little farther from the days.
The whole drawing function didn't take in account the space used by the
week numbers.

To fix that we had to move the whole drawing area and start to count the
space for the week numbers. We also had to change the logic to find the
day and month based on x,y coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=763251
2016-03-09 11:19:52 -03:00
Isaque Galdino 03b2ac9845 year-view: today button not working
Today button in the headerbar was not working when pressed in the
current year.

Button logic to update side panel was only triggered if there was a
change in the chosen year.

Fixed to update side panel whenever date is changed.

https://bugzilla.gnome.org/show_bug.cgi?id=762463
2016-03-02 01:06:52 -03:00
Isaque Galdino 1e2a0d1a3d year-view: Change week numbers style
Week numbers in year view was using a small and very light style and
that was making difficult for users to be able to read it.

After a few conversation with gnome-design team, they proposed the best
approach it would be to use the same style as gnome-shell panel does.

The week numbers style was changed to be as close as possible to the
gnome-shell panel.

https://bugzilla.gnome.org/show_bug.cgi?id=759354
2016-02-22 00:04:08 -03:00
Georges Basile Stavracas Neto beac852401 year-view: adjust hours to local timezone
The same principle of month view's overflow popover.
2016-02-18 04:13:34 +01:00
Georges Basile Stavracas Neto 3c0c3646f4 utils: use GDateTime to build component
As part of our epic journey to GDateTime, and to
prepare ground for the future work, use GDateTime
as arguments for building the ECalComponent.
2016-02-16 11:54:35 -02:00
Georges Basile Stavracas Neto 5d96c11c55 year-view: only apply widget dates to multiday events
Single day events won't ever show slanted edges.
2016-02-16 03:47:31 +01:00
Georges Basile Stavracas Neto 7a6a13d7e0 event: fix timezone handling
Using libical with libecal means that the dates
are always stored as UTF dates, and we receive the
timezone as the ECalComponentDateTime::tzid value.

This fact was net being considered when adding date
support on GcalEvent, and was causing various issues
when displaying dates.

Fix that by properly handling timezones in GcalEvent.
2016-02-15 20:42:47 -02:00
Georges Basile Stavracas Neto 8511285525 year-view: move comparing function from gcal-event-widget.c
The compare_for_single_day() method is reproducing the
same functionality from gcal_event_compare(), and the only
consumer is the Year View. So, for now, simplify the
comparing function and put it in year view file.

Also, this commit vastly improves and documents the year
view's algorithm to add events to the sidebar list.
2016-02-14 12:17:37 -02:00
Georges Basile Stavracas Neto 0ec0ea8121 event-widget: use GcalEvent internally
This saves a lot of code, and is much saner to maintain.
2016-02-14 12:17:37 -02:00
Isaque Galdino 9646d4f543 year-view: Fix for 01-01-2017 date
Previous fix was considering Jan 1st and Dec 31st to find the week
number, using ISO 8601 standard, and that was causing an issue with some
dates like Jan 1st, 2017 which was displaying week# 52 instead of
week #1.

The issue happened because ISO 8601 always consider Monday as the first
weekday, so as Jan 1st, 2017 is a Sunday, it' still considered week# 52
and not week# 1.

After checking GtkCalendar code I noticed it uses the same ISO 8601
standard but instead of using Jan 1st or Dec 31st, it always get the
week number based on the last day of that week, taking account if the
week starts on Sunday or Monday, depending on the locale. In our
example, using a calendar based on Sunday, Jan 1st, 2017 is the first
day of the week and Jan 7th, 2017 is the last one. Therefore I changed
week number code to always use the last day of the week.

https://bugzilla.gnome.org/show_bug.cgi?id=757622
2016-02-02 14:44:04 -02:00
Isaque Galdino e8c75cea32 year-view: Added visual clue for days with events
Year view didn't have hints for days with events and this feature was
requested to be added to gnome-calendar.

This is an old request but in the past gnome-design team though it would
be better to keep the layout simple without hints for days with events.
Now with the changes in gnome-shell calendar and in order to keep them
in sync, this feature was added to gnome-calendar.

In order to implement this code we had to add a few css styles and a
code to add a small circle below everyday with events. Although
gnome-shell calendar uses an svg image with a 3x3 dot, we chose to use a
pango function to draw the dot.

https://bugzilla.gnome.org/show_bug.cgi?id=743317
2016-01-29 22:51:12 -02:00
Georges Basile Stavracas Neto f9101b9bc8 year-view: turn into a final class 2016-01-19 20:45:05 -02:00
Isaque Galdino c4853dd855 gnome-calendar: Fix week #s in year view
Changed year view to use ISO 8601 standard to display the week #s
correctly when showing first and last weeks.

Year view was always starting week #s as 1, based on Jan 1st, and it
kept count the weeks until Dec 31st. But according to ISO 8601 standard,
that's not always true, i.e. Jan 1st 2016, is still in the 53th week of
2015, while Dec 31st 2014 is already in the 1st week of 2015.

Now the code is using ISO 8601 GDate function to get the correct week
number for the first and the last weeks of the year only. Other weeks
continue to use the same logic.

More about ISO 6801: https://en.wikipedia.org/wiki/ISO_8601#Week_dates

https://bugzilla.gnome.org/show_bug.cgi?id=757622
2016-01-19 18:09:30 -02:00
Georges Basile Stavracas Neto 5b8a26ec71 year-view: port to css nodes
Mainly by removing the gtk_widget_get_state_flags()
calls.
2016-01-04 16:50:40 -02:00
Erick Perez Castellanos cb25af0164 year-view: Get selected date before hiding popover
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=757931
2015-12-21 22:53:33 -06:00
Erick Perez Castellanos 5f6bd95750 Fix gcal_manager_is_client_writable() semantics
Fix all the calls to it accordingly.
2015-10-07 08:39:51 -05:00
Georges Basile Stavracas Neto d3a806a684 year-view: improve font rendering
By using doubles instead of integers, we give a very
fluid resize effect for year view.
2015-07-15 23:55:08 -03:00
Erick Pérez Castellanos 46c67688e1 year-view: set sidebar range timezone 2015-03-16 12:41:11 -04:00
Erick Pérez Castellanos 15604b13d8 year-view: fix sidebar headers 2015-02-16 09:31:21 -05:00
Erick Pérez Castellanos 8f1b118abb event-widget: fix events with no end date 2015-02-16 09:31:21 -05:00
Erick Pérez Castellanos 8fadbaa760 misc: fix various memory leaks 2015-02-16 09:31:20 -05:00
Erick Pérez Castellanos 44411f233a year-view: impl comp added properly
Previously we updated the sidebar completely, removing every children
and add it again after it. There's no need of it, if we provide a
sort_func to the ListBox and add only the component received
2015-02-16 09:31:20 -05:00
Erick Pérez Castellanos d32b9435f2 year-view: wrap add_class in save/restore block 2015-01-30 12:40:22 -05:00
Erick Pérez Castellanos 08b37bf8ea views: remove unused code 2015-01-29 00:01:10 -05:00
Erick Pérez Castellanos 86d5a23ddd app: initial current date marking work 2015-01-28 15:18:53 -05:00
Erick Pérez Castellanos 0d74fcc87f year-view: properly update active-date property 2015-01-27 23:09:32 -05:00
Erick Pérez Castellanos c8339d333d year-view: fix marking and placing of events 2015-01-27 23:07:44 -05:00
Erick Pérez Castellanos fa2f300362 app: move view subscription to GcalWindow
Initialize :manager property first and :active-date later. Allocate
::active_date instance on instance init vfunc.
2015-01-27 22:37:44 -05:00
Erick Pérez Castellanos 6d2dfdf9a1 app: update date when change in views
year-view: update date on selection
2015-01-27 19:10:28 -05:00