Commit Graph
100 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto 7dd42d4186 event-widget: add .timed style class to timed events
Another CSS tool for us to play with.
2017-09-14 13:26:28 -03:00
Georges Basile Stavracas Neto f42d5d0598 event-widget: add .vertical and .horizontal style classes
Depending on the GtkOrientation passed to it, just like the regular
behavior of GTK widgets. This way, we can have a finer control over
CSS selectors.
2017-09-14 13:26:28 -03:00
Georges Basile Stavracas Neto a853376629 event-widget: turn into a GtkBin subclass
The current GcalEventWidget implementation is a direct
GtkWidget subclass, which means we have to take care of
all the implementation details such as raising GdkWindows
and managing the drawing all by ourselves.

The event widget, however, can be easily described through
a GtkBuilder file. This would simplify the implementation
and makes us maintain less code.

Fix that by making GcalEventWidget a GtkBin subclass.
2017-09-14 13:26:28 -03:00
Georges Basile Stavracas Neto b3cfbe3d31 event-widget: update style 2017-09-14 13:26:28 -03:00
Georges Basile Stavracas Neto 72a3bb4168 quick-add-popover, event-widget: add translator comments
https://bugzilla.gnome.org/show_bug.cgi?id=784645
2017-07-10 22:57:00 -03:00
Abdullahi Usman 0a02a1269b event-widget : Add/rework new event sort function
The overflow layout used to display "Other X events" text when
there is no enough space to accomodate more events.

But due to the way the events were sorted, some events are folded to
'Other events' popover even when the cell has enough space to accomodate
the event(s) or when it is not required to be folded.

We rework how the events will be sorted.  First, the events are sorted by their
start dates(starting with the closest).  But if two or more events have same start date
then they are sorted according to their lengths.  And still if they have same start
date and length then they are sorted according to their modified times(the closest first).

https://bugzilla.gnome.org/show_bug.cgi?id=778478
2017-06-23 04:17:26 -03:00
Georges Basile Stavracas Neto a647033847 project: remove unused variables 2017-05-22 21:57:24 -03:00
Mohammed Sadiq be731fcae7 event-widget: fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=782566
2017-05-15 17:28:25 -03:00
Georges Basile Stavracas Neto f9454b6a8a event-widget: properly escape event description
When we escape first, then truncate, we might end up truncating at
the middle of a special character sequence, breaking the markup.

Fix that by escaping after truncating.
2017-05-08 21:26:21 -03:00
Georges Basile Stavracas Neto dff41ebef5 event-widget: fix previous commit 2017-04-18 09:43:42 -03:00
Georges Basile Stavracas Neto 5b44a34407 event-widget: escape event location
https://bugzilla.gnome.org/show_bug.cgi?id=781434
2017-04-18 09:38:44 -03:00
Georges Basile Stavracas Neto 662373141b event-widget: correctly ellipsize descripton tooltip
https://bugzilla.gnome.org/show_bug.cgi?id=781185
2017-04-12 21:04:42 -03:00
Georges Basile Stavracas Neto 6c784d03c4 event-widget: escape summary and description 2017-04-11 10:38:29 -03:00
Novi-Novi 21eba8ea0a event-widget: show tooltip with event details
In month view and year view, when the mouse is hovering over
an event, nothing is shown. A tooltip with the event information
would be much more useful in this scenario.

Fix that by showing a tooltip displaying the event's title, time
and date, and, if present, the location and notes of the event. Long
notes are truncated and ellipsized.

https://bugzilla.gnome.org/show_bug.cgi?id=774952
2017-04-11 09:50:15 -03:00
Yash Singh 26ecf3c161 event-widget: assign display-text in appropriate format to event-widget
Earlier the height of event-widget with duration of 30 mins or less exceeded
the desired space in week-grid. As height available was not checked beforehand,
this resulted in some event-widgets getting height assigned which was more
than the height available.

This patch fixes the erroneous assignment of event-widget's height by first
comparing the required height with the available height. If the required
height exceeds the available height, then the display-text is given as a
single-line for the widget to fit properly.

https://bugzilla.gnome.org/show_bug.cgi?id=778070
2017-03-23 19:58:04 -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 d5825bbd35 project: override log domains
This way, we can have more useful debug spils.
2017-03-17 10:14:25 -03:00
Georges Basile Stavracas Neto e406f93239 event-widget: escape event summary
Now that we may set event markups, we have
to be careful to escape the event summary
and make sure that we always pass a valid
markup.
2017-03-06 21:56:11 -03:00
Georges Basile Stavracas Neto 4974e03216 event-widget: properly draw dnd icon
Instead of using a pixbuf and relying on the underlying GdkWindow,
simply perform a custom draw() over a manually created cairo context
and avoid nasty crashes.
2017-01-17 11:24:22 -02:00
Georges Basile Stavracas Neto 4074bee50e event-widget: implement GtkOrientable
So that we can control how much information, and how this
information is displayed, depending on the widget orientation.
2016-12-15 17:02:51 -02:00
Georges Basile Stavracas Neto ab3b80f3b9 event-widget: factor out clock format function
This function will be used by other pieces of code later. We also gain
a tiny performance improvement, as only one GSetting is ever created.
2016-12-13 20:17:28 -02:00
Georges Basile Stavracas Neto 55b21874a7 event-widget: propagate scrolling event
When the event widget's GdkWindow receives an event scroll,
the event is lost because it doesn't handle it. It should,
however, propagate the scroll event so that the container
is able to properly parse it.

Fix that by making GcalEventWidget listen and propagate
scrolled events.
2016-10-01 18:32:24 -03:00
Georges Basile Stavracas Neto 08fcf33a28 event-widget: don't DnD read-only events
Read-only events can't be moved, so don't allow it.

https://bugzilla.gnome.org/show_bug.cgi?id=771116
2016-09-14 14:10:13 -03:00
Georges Basile Stavracas Neto 7844122dd2 event-widget: avoid crash when retrieving the DnD pixbuf
Since we're storing the GdkWindow relative to the event widget,
it's usually safer to create a pixbuf of the widget *after* it's
drawn, and not while it's being drawed.

This commit moves the pixbuf retrieval code to the draw-begin
implementation, so we only create the pixbuf when actually
using it.
2016-07-06 15:57:19 -03:00
Georges Basile Stavracas Neto dc65a9e906 event-widget: use a gint for date compare 2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto b90d356c7b event-widget: set a proper icon for drag n' drop 2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto f980bbc638 event-widget: setup itself as a drag source
Ideally, every single view will support drag and drop. So
let's just assume that and make the event widget set itself
as a drag source, and let each view set itself as a drag
target.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 96de78d9af trivial: style fix 2016-05-21 18:53:16 -03:00
Monique Faria c49dae00bc event-widget: fade out past events
When an event is earlier than the current date, it gets faded out.

Every event from the same calendar showed the same shade of color, either it was an old, current or forward event. That could be tricky for the user to identify which ones were already over.

Now, events that are earlier thant the current date are half transparent to allow the user to easily track where the current date/time is.

https://bugzilla.gnome.org/show_bug.cgi?id=746267
2016-03-14 19:49:41 -03:00
Georges Basile Stavracas Neto 7d3e125012 event-widget: remove obsolete comment 2016-03-09 12:07:05 -03:00
Georges Basile Stavracas Neto 7be1dd95fa event-widget: draw icons at the end of the widget
Instead of breaking the vertical alignment of events by
drawing icons both at the start and end of the widget,
only draw them by the end.

This commit also improves drawing for RTL locales.
2016-03-01 00:16:49 -03:00
Georges Basile Stavracas Neto 5227f3fcdc event-widget: show start time when event is timed
We differentiate all day events from timed events by their
ordering, but we don't give any visual clues of this
differentiation.

Fix that by adding the start time of the event when it's a
timed event.

https://bugzilla.gnome.org/show_bug.cgi?id=753131
2016-02-29 23:24:14 -03:00
Georges Basile Stavracas Neto d84be66d70 event-widget: bring back alarm icon 2016-02-29 22:20:52 -03:00
Georges Basile Stavracas Neto e067e8cf73 event-widget: disconnect from event's signals on finalize
When we finalize, we remove the event. Normally this means
that the event also gets finalized, as the widget almost
always holds the only reference to the event.

However, there are some rare cases where we finalize the widget
but not the event. If the event the updates the color or the
summary, we try to redraw the finalized widget and crash.

Fix that by disconnecting the signals when finalizing the widget.
2016-02-22 00:02:59 -03:00
Georges Basile Stavracas Neto 21aa8ecde4 event-widget: simplify rendering code 2016-02-18 04:02:46 -02:00
Georges Basile Stavracas Neto bf95aad2ca event-widget: remove old colors when applying new ones
For the sake of safety and correctness, remove the old color's
CSS before applying the new color's one.
2016-02-16 15:09:11 -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
Georges Basile Stavracas Neto 2ded8b3147 event-widget: drop unused function 2016-02-14 12:17:37 -02:00
Georges Basile Stavracas Neto f001fb48b7 event-widget: turn into a final class 2016-01-19 19:12:13 -02:00
Georges Basile Stavracas Neto ef9868a0d7 event-widget: port to css nodes
This commit add a css name, and use the style
context's state flags as well.
2016-01-04 16:27:40 -02:00
Erick Pérez Castellanos 636df18f64 event-widget: convert date/time to local timezone 2015-03-16 12:37:43 -04:00
Erick Pérez Castellanos c7563da2d0 app: handle calendars colours better
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=745487
2015-03-06 11:32:32 -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 4c7a99e7bf event-widget: handle timezone properly 2015-02-16 09:31:21 -05:00
Erick Pérez Castellanos cb0571987a event-widget: properly handle timezone
For now, we're going to convert every widget time into our timezone
without question. Further along the way, when we have a more complete
edit-dialog we can handle this in a less strict manner.
2015-02-16 09:31:20 -05:00
Erick Pérez Castellanos eb8d16bbc7 event-widget: fix size requisition
Size requisition previously add margin to the size requested. Margin
should be taken into account outside of the widget. Moving margin to the
container and use border, which previously was not used.
2015-02-16 09:31:19 -05:00
Erick Pérez Castellanos 16d77a6718 Revert "event-widget: hardcode padding-top/bottom at 4px"
This reverts commit 554ef1d80b.
2015-02-13 09:12:15 -05:00
Erick Pérez Castellanos b1df382ee3 app: use get_color_name_from_source() 2015-02-06 09:21:36 -05:00
Erick Pérez Castellanos 554ef1d80b event-widget: hardcode padding-top/bottom at 4px
This is necessary in order to properly style slanted edges on widgets
who need it on both start and end.
2015-01-22 13:31:08 -05:00