Commit Graph
154 Commits
Author SHA1 Message Date
Abdullahi Usman d9a775e2fe month-view : correct overflow label position on rtl
The overflow layout displays "Other n events" when there are too much event
that a cell can accomodate.

But on rtl languages, due to the layering out of the cell, the position of the
overflow is not renderend on the mirrored date.

We fix that by mirroring the positon of the day on which the events occur so
that the events can appear on the right day.

https://bugzilla.gnome.org/show_bug.cgi?id=777427
2017-08-22 20:57:01 -03:00
Abdullahi Usman df08daad68 month-view: improve dates calculation for RTL languages.
Month view used to calculate the event's start date and end date from
the physical layout of the month and compare it with the event's
original start date and end date to see if there is a change and then
update as necessary by either slanted start or end, when either is/are
not equal to the one in the original start and end dates.

However, the way in which the start date and end date in RTL language are
calculated must be different since the layering of the days in the weeks
are opposite.  Month view uses precalculated days number to mirror the
last week, which already chop off the days_delay number from cell_idx value.
In RTL, this cause issues such that the days are calculated wrongly and a
slanted start or end is visible.  Because the date is not the same as the
original events date, month view thinks that the view needs an update and
so tries to update the view wrongly.

We can fix this by using the cell_idx value to calculate the days and then
substracting the days_delay value after that.

https://bugzilla.gnome.org/show_bug.cgi?id=777426
2017-08-18 23:53:04 -03:00
Georges Basile Stavracas Neto 282fb5fc33 month-view: don't draw dnd highlight on empty cells
https://bugzilla.gnome.org/show_bug.cgi?id=786102
2017-08-14 23:42:49 -03:00
Alex Benishek 311195857f Move from GPL 2 to GPL 3
Right now the project contains a mix of GPL 2 and GPL 3 code.
This commit moves all of the perviously GPL 2 code to GPL 3

https://bugzilla.gnome.org/show_bug.cgi?id=752649
2017-08-10 07:16:36 -03:00
Georges Basile Stavracas Neto d11ed85a7f month-view: grey out invalid days
It should be very clear that days outside the current
month are actually not valid. The current drawing
algorithm does not differentiate that, thought, and
draws everything at the same color.

Fix that by greying out the days outside the current
month.

https://bugzilla.gnome.org/show_bug.cgi?id=763771
2017-07-30 16:03:39 +01:00
Abdullahi Usman 1360fe01e8 week-grid : seperate week's events overlaps.
The week view can display mutilple events that can partly or fully span
same time ranges.

But week view fails to make correct assumption about the width of events when
two or more events span some time ranges in which these events also span some
time ranges with other events, and whereby the number of these other events
that they span time ranges with does not coincide with the number of the events
that the other event also span.  Week view ended up calculating cells that
appears horizontally jointed up.  Also int16_compare() does not dereference the
pointer from g_ptr_array_sort() correctly and that makes it sort events
incorrectly and hence making events appears vertically jointed up.

If an event have other events in which they span some time, we calcuate its width
by taking into consideration of all the events that the other event may span
time with.  The event that has the higher number of time spans is considered.
We also save and retrieve our positions using UINT_TO_POINTER and POINTER_TO_UINT()
respectively, and then dereference the pointer from g_ptr_array_sort() correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=777416
2017-07-10 22:44:43 -03:00
Yash Singh be9da0cbda views: ask for recurrence when dropping recurrent events
While dragging and dropping a recurrent event, pop
up the recurrence-dialog to allow the user to choose
the set of events to which the changes should be
applied.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-06-14 16:18:11 -03:00
Rafal Luzynski 2263fc9478 date formats: Use g_date_time_format()
Don't hardcode month-day order, use g_date_time_format() and
mark the format string for translation and let translators choose
their preferred formats.

This patch also removes context from the existing "%B %d" date
format because it is unnecessary and this allows the format to be
reused by the patch.

https://bugzilla.gnome.org/show_bug.cgi?id=780629
2017-06-01 11:37:00 -03:00
Yash Singh 9ffa913ad4 manager: pass ECalObjModType to update and remove
Currently, GcalManager always assumes E_CAL_OBJ_MOD_THIS
when modifying or deleting events. Since we're landing
the groundwork for recurrence management, we can't assume
this anymore.

This patch, then, allows GcalManager:modify_event() and
:remove_event() receive the ECalObjModType instead of
assuming E_CAL_OBJ_MOD_THIS. However, this commit does
not add recurrence support yet, and every call to these
functions are still passing E_CAL_OBJ_MOD_THIS.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
2017-05-27 11:36:05 -03:00
Georges Basile Stavracas Neto d294ea46a5 week-header: fix drawing stray lines when managing events 2017-05-24 17:27:07 -03:00
Abdullahi Usman 9bbb12691a month-view: add margin to overflow layout
The overflow layout sit at the bottom of a cell to display "Other X events"
when there is no room to accomodate more.

The issue is that the overflow layout does not have margin property like
other views(layouts) in the cell, so instead it appears either too far from or
too close to the border depending on the text it accomodates.

We can fix this by setting the margin property.

https://bugzilla.gnome.com/show_bug.cgi?id=771581
2017-05-24 15:46:23 -03:00
Abdullahi Usman ad3e37606d month-view : adjust overflow layout and set it ellipsized at end.
The overflow layout used to display "Other X events" text when
there is no enough space to accomodate more events.

This used to get mixed-up/overlapped with the date label because the
overflow label uses whole cell width as width.

We can fix this by substracting date label width from overflow label
width to accomodate the date label.

https://bugzilla.gnome.com/show_bug.cgi?id=7771581

https://bugzilla.gnome.org/show_bug.cgi?id=771581
2017-05-22 22:05:07 -03:00
Abdullahi Usman 91408b355b month-view : add margin to overflow layout
The overflow layout sit at the bottom of a cell to display "Other X events"
when there is no room to accomodate more.

The issue is that the overflow layout does not have margin property like
other views(layouts) in the cell, so instead it appears either too far from or
too close to the border depending on the text it accomodates.

We can fix this by setting the margin property.

https://bugzilla.gnome.com/show_bug.cgi?id=7771581
2017-05-22 21:57:46 -03:00
Georges Basile Stavracas Neto a647033847 project: remove unused variables 2017-05-22 21:57:24 -03:00
Georges Basile Stavracas Neto dde6b5bf05 week-view: improve scroll timeout logic
Instead of keeping an active timeout source spamming the
console, just connect to the right signal and wait for the
week view to be visible again.
2017-05-16 17:48:25 -03:00
Georges Basile Stavracas Neto 09fe510937 views: use the new GcalClock to redraw
Instead of having each view manage it's own timeout (or
even worse, making GcalWindow manage it), use the newly
introduced GcalClock API to do that.
2017-05-16 14:57:15 -03:00
Mohammed Sadiq 4dde284170 week-header: fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=782561
2017-05-15 17:23:31 -03:00
Orkun Tezer a54e91a9b3 week-header: use g_date_time_add_days for dnd date calculation
Dnd at week header crashes with segmentation fault

The problem, calculation of dnd_date returns NULL when week_start is
in previous month.

Fix that by using g_date_time_add_days() function

https://bugzilla.gnome.org/show_bug.cgi?id=781955
2017-05-08 21:49:46 -03:00
Mohammed Sadiq 178e6a269a week-view: fix signal emission on scrolled_window
This was causing segfault in week-view

https://bugzilla.gnome.org/show_bug.cgi?id=782269
2017-05-06 12:51:25 -03:00
Kevin Lopez ec3ef0d0a3 search-view: hide if click is performed outside
Result drop down should disappear when any click is performed outside
that drop down.

https://bugzilla.gnome.org/show_bug.cgi?id=74796

https://bugzilla.gnome.org/show_bug.cgi?id=747962
2017-05-04 08:55:50 -03:00
Orkun Tezer a6e347d8f2 week-header: Move events at column after remove event from list
The Problem: When user remove 4rt fullday event, header only shows two
events and not shows 3rd fullday event

Because, we check and set visibility of event that user wants to remove
from calendar, before remove event from event list which causes 3rd
event unvisible.

Fix that with check and set visibility of event after remove event
from event list, then visibilties and overflow corretly calculated

https://bugzilla.gnome.org/show_bug.cgi?id=777423
2017-05-03 21:55:39 -03:00
Georges Basile Stavracas Neto 817325da05 month-view: simplify code 2017-04-29 12:57:06 -03:00
Georges Basile Stavracas Neto 7dc5eb5bf5 week-grid, week-header: properly initialize datetimes
Since we use autoptr on those, we may end up falling in to
the early return and mistakenly unreferencing the not
initialized new date.
2017-04-29 12:57:06 -03:00
Isaque Galdino 997e958fb9 year-view: Uninitialised values
Valgrind was reporting some "Conditional jump or move depends on
uninitialised value(s)" and "Invalid read of size 4" when hovering
year-view.

It was found some uninitialised variables in the code and they were
initialised before being used.

https://bugzilla.gnome.org/show_bug.cgi?id=781430
2017-04-21 23:24:11 -03:00
Georges Basile Stavracas Neto 9d91c11b52 year-view: simplify code
By storing the coordinates array in a local pointer,
we avoid 9 super slow full memory lookups. That matters
when we're inside the drawing function, trying to keep
60fps.
2017-04-19 16:48:51 -03:00
Georges Basile Stavracas Neto e26648a2c6 month-view: don't cancel selection on date change
https://bugzilla.gnome.org/show_bug.cgi?id=781244
2017-04-13 06:55:30 -03:00
Georges Basile Stavracas Neto aa5b963412 view: rework active-date
The current implementation is deficient in many ways, the
worst one being the it relying on GObject semi-synchronous
property emission.

This issue was exposed by the Week view code, where the active
date was updated, but delayed to reach the Week header and some
events were being added ~before~ the active date changed.

With this work, I was also able to figure out a bunch of code
that relied on this (i.e. luck) to work.
2017-04-12 20:51:23 -03:00
Georges Basile Stavracas Neto 2e84c00233 Merge branch 'wip/gbsneto/docs' 2017-04-12 15:17:37 -03:00
Georges Basile Stavracas Neto 7681b7a2da project: document classes 2017-04-12 15:17:17 -03:00
Georges Basile Stavracas Neto 57a2bf8983 week-grid, week-header: simplify code
We don't need to check whether the end date is NULL,
for GcalEvent always ensures that.
2017-04-12 15:12:03 -03:00
Georges Basile Stavracas Neto 89f142d79e week-grid: draw today indicator above events 2017-04-12 14:21:02 -03:00
Georges Basile Stavracas Neto b93fe11da8 view: cleanup unused code 2017-03-29 16:25:47 -03:00
Georges Basile Stavracas Neto 2f2867179d week-grid: fix event creation on RTL languages
On RTL languages, the calcs to detect the start and end
of the new event were wrong, leading to the weird behavior
it currently has.

Fix that by correctly calculating the start and end cells
on RTL languages.

https://bugzilla.gnome.org/show_bug.cgi?id=777429
2017-03-29 00:04:10 -03:00
Georges Basile Stavracas Neto 19b1563aab year-view: simplify code
The code in ECalDataModelSubscriber:component_changed() and
:component_removed() was actually duplicated, and we can
simplify the :component_changed() routine by simply removing
and readding the event.
2017-03-25 17:56:36 -03:00
Georges Basile Stavracas Neto a7d7726a35 year-view: optimize drawing
The current Year view drawing routine gathers events
every single time we draw the navigator. This is, to
the best case, slow to death. In fact, this is why
year view's navigator is so memory and processor
consuming.

To fix that, cache the added components and simply
query them at drawing time.
2017-03-25 11:22:22 -03:00
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