Commit Graph
219 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto c2f3953dde week-header: don't attempt to add events incorrectly
One of the biggest issues of GNOME Calendar views right now
is that they rely on GObject property system to update the
active date. Even gcal_view_set_date() is just a wrapper
around GObject set.

Because GObject asynchronously updates the property by letting
the mainloop handle it, we can never be assured that all the
views had their views updated before updating the data model.

This patch temporarily adds sanity checks to GcalWeekHeader
to prevent making Calendar unusable, until we fix GcalView.
2017-03-24 22:21:24 -03:00
Yash Singh 6cc6e4f7e7 week-grid: remove unneeded usage of natural-height
As the assignment of display-text, and in turn that of event-widget's height,
is taken care of in event-widget, we no longer need to consider natural-
height, while assigning height in week-grid.

This patch fixes this issue by removing natural-height, and directly
assigning the desired value to height.

https://bugzilla.gnome.org/show_bug.cgi?id=778070
2017-03-23 19:53:46 -03:00
Jente Hidskes de2578ac54 views: use ACTION_MOVE to display correct cursor
When dragging events around, the cursors show a + as opposed to a
an arrow indicating that the event is being moved. This can confuse
users.

The fix is to tell GTK that the drag being performed is a move.

https://bugzilla.gnome.org/show_bug.cgi?id=774922
2017-03-22 22:55:50 -03:00
Georges Basile Stavracas Neto 82aa5fadb0 week-header: correctly check for updatable events
When comparing events' dates against week dates, we must
be careful to compare UTC with UTC. Otherwise, some events
will be left, specially at the first and last days.
2017-03-17 21:09:33 -03:00
Georges Basile Stavracas Neto f1b59d64d2 week-header: fix dnd at first column 2017-03-17 16:38:59 -03:00
Georges Basile Stavracas Neto 8b718ee0a0 week-view, week-header: instrument more functions 2017-03-17 16:38:28 -03:00
Georges Basile Stavracas Neto 002271ebb1 views: get rid of current date
We can easily track the current date with GDateTime API,
so we don't actually need the current date field.
2017-03-17 15:49:12 -03:00
Georges Basile Stavracas Neto 1dadd34409 week-view: instrument possibly crasher function 2017-03-17 15:06:02 -03:00
Georges Basile Stavracas Neto 339b49e7d5 views: cleanup code 2017-03-17 11:13:19 -03:00
Georges Basile Stavracas Neto d5825bbd35 project: override log domains
This way, we can have more useful debug spils.
2017-03-17 10:14:25 -03:00
Joyjit Choudhury 35b2f90cab week-view: set correct week number
In this commit, the correct week number is set in week-view.

The problem is, the week number of week-view is being set according to
the first day of the week (if the first and last day of the week
are in the same year), or the first and last day of the week
(if the first and last day are in different years).

To fix this, the week number is being set according to the middle day
of the week (according to ISO 8601 standards), resulting in correct
week numbers.

https://bugzilla.gnome.org/show_bug.cgi?id=779331
2017-03-16 20:31:37 -03:00
Georges Basile Stavracas Neto 0266202d40 week-header: continue fixing event positions 2017-03-15 09:50:51 -03:00
Georges Basile Stavracas Neto 669869cf3f week-header: fix calc of events' start and end positions
Another shot in this issue. Again.

https://bugzilla.gnome.org/show_bug.cgi?id=780051
2017-03-15 17:45:49 +05:30
Georges Basile Stavracas Neto d4ef9b22ca week-grid: consider daylight when calculating event position
There are some weird cases around the globe where the timezone
changes in the middle of the day. In GMT-8:00, for example, the
DST changes at 2:00 am. This makes the timezone of thestart of
the week different from the event's timezone, and somehow the
GLib API doesn't take that into account when calculating the
diff between two dates.

Fix that by also considering different timezones when calculating
the event start and end positions.

https://bugzilla.gnome.org/show_bug.cgi?id=780079
2017-03-15 04:52:33 -07:00
Georges Basile Stavracas Neto 39d871d2ef week-grid: disconsider reported min-width for events
Sometimes, we'll need to ignore the reported minimum sizes
to be able to set the width of events to an acceptable
size. This is the case of the week grid.

https://bugzilla.gnome.org/show_bug.cgi?id=780052
2017-03-14 20:50:53 -03:00
Georges Basile Stavracas Neto f608f8fd9d week-header: don't account first weekday twice
The auxiliary functions to calculate the week start
already takes the first weekday into account. We,
however, were considering it again when calculating
the event position.

Fix that by only considering it once, through the
get_start_of_week() function.

https://bugzilla.gnome.org/show_bug.cgi?id=780051
2017-03-14 20:27:32 -03:00
Georges Basile Stavracas Neto 0dcf86b7c2 week-header: improve drag and drop
The rudimentary drag n' drop support should also deal
with the following corner cases:

           All Day
Multiday |   TRUE   |   FALSE    |
         |----------|------------|
    TRUE |   utc    | no changes |
   FALSE |   utc    |    utc     |

https://bugzilla.gnome.org/show_bug.cgi?id=777424
2017-03-14 20:19:28 -03:00
Georges Basile Stavracas Neto c33d820387 week-grid: use a proper function to queue redraw
Same as 97698ad1c9 for the Week grid.
2017-03-14 20:17:46 -03:00
Georges Basile Stavracas Neto 180621cd91 week-view: also check for realized
Be more strict about the checks, and avoid crashes.
2017-03-14 15:53:09 -03:00
Georges Basile Stavracas Neto 97698ad1c9 week-header: use a proper function to queue redraw
We were using gtk_widget_queue_draw() as a callback to
a GTimeoutSource, which expects a boolean return type.
This is clearly wrong, and has the chance to cause
a segmentation fault.

Fix that by passing a function with the apropriate signature.

https://bugzilla.gnome.org/show_bug.cgi?id=779823
2017-03-10 08:00:39 -03:00
Georges Basile Stavracas Neto 31aa709487 week-header: fix placement of events
When the first weekday wasn't monday, we were
miscalculating the initial and final positions
of the widgets.

Fix that by properly calculating the initial and
final positions.
2017-03-05 20:32:33 -03:00
Joyjit Choudhury 06cdeb61ed week-view: set the first weekday for week-header & week-grid
In this commit, the first weekday is set for week-header & week-grid.

The issue is, the first weekday is being set only for week-view,
resulting in incorrect display of weekdays in the week-header.

To fix this, the first weekday for week-header & week-grid is set
along with that of week-view.

https://bugzilla.gnome.org/show_bug.cgi?id=779346
2017-03-02 07:20:31 -03:00
Georges Basile Stavracas Neto e69c9aa09c week-header: fix untranslated strings 2017-02-27 08:46:52 -03:00
Georges Basile Stavracas Neto ce52cdd9ce week-header: fix double dnd highlight 2017-02-14 18:00:05 -02:00
Georges Basile Stavracas Neto 7cf41f8f45 month-view: fix warning on closing overflow popover 2017-02-14 18:00:05 -02:00
Georges Basile Stavracas Neto 8f34049793 views: sync header labels' style
The Week view exposed a bug where we had different
CSS selectors for the exact same label. This made
them look inconsistent, with different colors and
paddings.

Fix that by ensuring they all use the same style
class. The Year view drawing code needed to be
reworked a little.

https://bugzilla.gnome.org/show_bug.cgi?id=778391
2017-02-09 10:28:28 -02:00
Georges Basile Stavracas Neto d63e007a7a week-grid, week-view: improve hour sidebar rendering
The hour strings are too soft and can barely be read. Fix
that by setting a stronger color.

https://bugzilla.gnome.org/show_bug.cgi?id=777420
2017-02-09 09:21:28 -02:00
Georges Basile Stavracas Neto 6c2653809b week-grid: simplify drawing function
This patch simplifies the drawing function by removing
the unused layout and font descriptions.

https://bugzilla.gnome.org/show_bug.cgi?id=777420
2017-02-09 09:21:28 -02:00
Georges Basile Stavracas Neto cdc5bde96a week-grid: make sure events span at least 1 minute
When adding an event with the same start and end dates and
times, the event effectively spans 0 minutes, leading a division
by zero and causing varius UI glitches.

Fix that by making sure events span at least 1 minute.

https://bugzilla.gnome.org/show_bug.cgi?id=777414
2017-02-01 15:06:56 -02:00
Georges Basile Stavracas Neto e119d27718 week-grid: enforce a minimum width
https://bugzilla.gnome.org/show_bug.cgi?id=777414
2017-02-01 15:06:56 -02:00
Georges Basile Stavracas Neto e74cfc0e22 project: move views to views/ folder 2017-01-17 11:28:48 -02:00
Georges Basile Stavracas Neto 7a21e1e5ac week-header: implement drag n' drop 2017-01-17 11:24:22 -02:00
Georges Basile Stavracas Neto 530aaa24c4 week-grid: implement drag n' drop 2017-01-17 11:24:22 -02:00
Georges Basile Stavracas Neto 096327e046 week-view: set the header's and grid's manager as well 2017-01-17 10:50:32 -02:00
Georges Basile Stavracas Neto 529acca239 week-grid: fix index sorting
This was causing conflicts on event overlapping calculation.
2017-01-09 18:25:55 -02:00
Georges Basile Stavracas Neto 30cb8a5020 week-header: improve rendering of selection 2016-12-15 17:32:27 -02:00
Georges Basile Stavracas Neto f013d7442e week-header: fix event margins 2016-12-15 17:09:45 -02:00
Georges Basile Stavracas Neto 9da0704e37 week-grid: set child widgets' orientation to vertical 2016-12-15 17:03:26 -02:00
Georges Basile Stavracas Neto 69ad53352d week-grid: remove unused vars 2016-12-15 17:01:20 -02:00
Georges Basile Stavracas Neto 33f1e4cd31 week-header: minor improvements on date selection 2016-12-14 17:18:48 -02:00
Georges Basile Stavracas Neto 84c411e505 week-grid: fix inversed selection on RTL languages 2016-12-14 17:11:37 -02:00
Georges Basile Stavracas Neto ffaf7153d7 week-header: implement event creation 2016-12-14 17:00:11 -02:00
Georges Basile Stavracas Neto 9a07dad0e9 week-grid: minor fixups 2016-12-13 16:29:24 -02:00
Georges Basile Stavracas Neto e8906c9e04 week-view: smoothly scroll the grid when moving to today 2016-12-13 16:29:07 -02:00
Georges Basile Stavracas Neto f134da5a1d week-view: avoid segfault when scrolling when unmapped 2016-12-13 16:29:07 -02:00
Georges Basile Stavracas Neto 343283e37a week-grid: implement event creation 2016-12-13 16:29:07 -02:00
Georges Basile Stavracas Neto 93acf26507 week-grid: properly position overlapping events
When two or more events overlap, the week grid almost
does the right thing and correctly calculates the width
of the events.

It fails, however, in calculating the position of the
events.

This commit introduces a simple yet efficient way to
position the events. It uses a temporary range tree to
efficiently store already positioned widgets, and checks
for their indexes looking for a hole to position the
new event.
2016-12-09 00:06:26 -02:00
Georges Basile Stavracas Neto bcfe13bcbc week-view: adapt view and widgets to handle RTL 2016-12-08 20:33:34 -02:00
Georges Basile Stavracas Neto 6d4f719829 week-header, week-grid: update drawing when time changes
When minutes change, the week grid should update the today strip
if it's visible and, if the day change, week header should update
the blue week name.
2016-12-08 19:33:20 -02:00
Georges Basile Stavracas Neto 7e53c433b7 week-view: center grid on date change 2016-12-08 19:14:03 -02:00