Commit Graph
78 Commits
Author SHA1 Message Date
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
Erick Pérez Castellanos 0dd6458ae8 event-widget: fix compare function 2015-01-20 13:11:59 -05:00
Erick Pérez Castellanos d53a3570bf event-widget: added compare function
This compare function is made to sort using the same two methods used
before but together, giving priority to the longer events.
The idea is sort event properly on year-view's sidebar.
This function will probably change later.
2015-01-20 13:11:59 -05:00
Erick Pérez Castellanos 0b2367200b copyright: update year 2015-01-20 13:11:58 -05:00
Erick Pérez Castellanos 0ff177c1d8 comments: document utils functions, add FIXME 2014-12-22 21:55:55 -05:00
Erick Pérez Castellanos 4eabc0223b build: remove unneeded code
GObject type system zeroing instance private data, so initialization to
NULL and FALSE is not needed.
Misc code styles fixes.
2014-12-22 21:52:35 -05:00
Erick Pérez Castellanos 8f8bb21534 event-widget: use custom class for background colors 2014-12-22 21:41:14 -05:00
Erick Pérez Castellanos 5a36689e07 event-widget: advertise properly multiday status
When an event is marked all day, the end-date is always one day ahead of
the true end of the event, and both dates are marked as date. We need to
take this into account.
2014-12-22 14:52:34 -05:00
Erick Pérez Castellanos a08a0a66c1 event-widget: remove unused CSS tag name
Since Gtk+ parses automatically widgets' name, there's no need of custom class
2014-12-22 08:38:19 -05:00
Erick Pérez Castellanos 420e66bdb1 event-widget: add ::compare_by_start_date
This function will eventually deprecate gcal_compare_event_widget_by_date()
2014-12-20 09:10:00 -05:00
Erick Pérez Castellanos 51c7e5e2ea event-widget: add convenient API to query dates
Simply it is faster not to allocate memory when there is no need of it
2014-12-18 00:56:46 -05:00
Erick Pérez Castellanos 719a294fae event-widget: add helper API
Added GcalEventWidget::is_multiday to check if an event span more than
one day.
Added GcalEventWidget::compare_by_length which compares two event
widgets according to the duration of the events they represent.
2014-12-16 10:06:09 -05:00
Erick Pérez Castellanos 60946551b3 event-widget: add ::clone API 2014-12-16 10:06:08 -05:00
Erick Pérez Castellanos e62f48bfea events: fix handling of event with no end date
Fix the sigsegv in edit-dialog and event-widgets when there's no
end-date set.
Set a guard in Utils::gcal_dup_icaltime function.
There's still some problems with the events showing the first time but
not anymore.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=736002
2014-12-08 11:21:14 -05:00
Erick Pérez Castellanos 532a4de02e event-widget: fixed typo on method name 2014-12-05 08:17:30 -05:00
Erick Pérez Castellanos 746864e7bc event-widget: fix icons scaling, made 16x always.
Previously the scaling was made to the size of the text layout which
caused a blurriness of the icon. Making its size a multiple of 16 made
the icon preserve its sharpness.
2014-12-04 17:10:51 -05:00
Erick Pérez Castellanos c526329450 misc: code style and comments removed 2014-12-04 17:10:51 -05:00
Erick Pérez Castellanos 4c98b16c76 event-widget: render locked state of the calendar 2014-12-04 17:10:50 -05:00
Erick Pérez Castellanos 2e82b098b3 build: replace Gtk deprecated calls 2014-12-04 17:10:49 -05:00
Erick Pérez Castellanos 5a1f12ad00 event-widget: make more CSS compliant
There are some other changes:
1. Renamed widget class to "event-widget" to avoid collisions
2. Added contrasting event title coloring
3. Use gtk_render functions
2014-12-04 17:10:48 -05:00
Erick Pérez Castellanos 605cb7fc25 build: stop complaints from gcc
Gcc complaints this variable may be used uninitialized
2014-12-04 17:10:46 -05:00
Erick Pérez Castellanos 3805496dbb event-widget: fix memory leak.
According to valgrind pango leaks memory when creating a PangoLayout
using gtk_widget_create_pango_layout with a literal string.
2014-12-04 17:10:44 -05:00
Erick Pérez Castellanos c2eda0e446 event-widget: fix memory corruption
GdkRBA should not be allocated using g_new0. Used G_SLICE=debug-blocks
to find it.
2014-12-04 17:10:44 -05:00