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
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
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
1cab5278f1
style: smoother selection background
2016-12-14 17:11:11 -02:00
Georges Basile Stavracas Neto
ffaf7153d7
week-header: implement event creation
2016-12-14 17:00:11 -02:00
Georges Basile Stavracas Neto
55d9232b0c
quick-add-popover: fix creation of timed events
...
On week view, we want to create events that span 1 day, but with
different hours. The current code of Quick Add popover, however,
doesn't support that, as the only test case up to now was month
and year views - both not making use of timed events.
Fix that by adding the necessary comparisons, adapting the strings
and allowing events with the same date but different times.
2016-12-13 20:19:28 -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
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
112b82c179
utils: add utility to unref datetimes
2016-12-09 14:45:45 -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
23010afa1a
window: fix today button sensitivitiness on week view
2016-12-08 19:20:45 -02:00
Georges Basile Stavracas Neto
7e53c433b7
week-view: center grid on date change
2016-12-08 19:14:03 -02:00
Georges Basile Stavracas Neto
c1ab1c2d3b
week-header, week-grid: remove duplicate code
2016-12-08 18:53:34 -02:00
Georges Basile Stavracas Neto
7a6ca3d711
week-view: simplify code
2016-12-08 18:34:06 -02:00
Georges Basile Stavracas Neto
b8a297fdde
week-header: small ui fix
...
Add 2px at the bottom so events don't overlap with the
bottom line.
2016-12-08 18:31:01 -02:00
Georges Basile Stavracas Neto
36f716ebf4
week-view: reimplement editing events
2016-12-08 18:23:25 -02:00
Georges Basile Stavracas Neto
5238e6ff9d
week-header: don't rearrange events if week didn't change
2016-12-08 17:50:30 -02:00
Georges Basile Stavracas Neto
f98a465612
week-header: don't set a minimum content height
2016-12-08 16:40:00 -02:00
Georges Basile Stavracas Neto
f7658bede2
week-header: fix various issues with dates
...
When breaking and merging event widgets, the start
and end dates must be updated to reflect the current
widget state.
2016-12-08 16:39:02 -02:00
Georges Basile Stavracas Neto
e474ac1902
week-header: redraw the whole background on draw()
2016-12-08 16:21:08 -02:00
Georges Basile Stavracas Neto
6e3b4a5f04
week-header: don't leak overflow labels when expanded
2016-12-08 16:20:10 -02:00
Georges Basile Stavracas Neto
21c9f721ae
week-header: properly propagate height when expanded
2016-12-08 16:10:46 -02:00
Georges Basile Stavracas Neto
3f4715fd4a
week-header: batch fix overflow management
...
It's getting close to be completely working.
2016-12-08 16:04:07 -02:00
Georges Basile Stavracas Neto
13906a3000
week-header: fix all-day events, add comments
2016-12-08 16:00:39 -02:00
Georges Basile Stavracas Neto
74ac2d83ee
week-view: fix active and current date handling
...
The active date is the visible date, while the current date
is today. We shouldn't confuse those two.
2016-12-08 14:18:37 -02:00
Georges Basile Stavracas Neto
6fc89fb626
week-header: remove needless margin
2016-12-08 03:14:40 -02:00
Georges Basile Stavracas Neto
e897f38eee
week-header: simplify event addition
2016-12-08 03:09:35 -02:00
Georges Basile Stavracas Neto
7e68588cfb
week-header: rework drawing model
2016-12-08 03:09:35 -02:00
Georges Basile Stavracas Neto
f50a258f05
week-header: fix initial overflow check
2016-12-08 03:09:35 -02:00
Georges Basile Stavracas Neto
1c48d0a543
week-header: fix date handling
2016-12-08 03:09:35 -02:00
Georges Basile Stavracas Neto
e5407d8c72
week-grid, week-header: special-case today when drawing
...
The week grid should display a horizontal strip on the today
column, and the week header should draw the week day labels
with a custom color.
2016-12-08 03:09:35 -02:00
Georges Basile Stavracas Neto
1c048fb538
week-grid, week-header: improve rendering of vertical lines
2016-12-07 22:56:10 -02:00
Georges Basile Stavracas Neto
336e584099
week-grid: implement event handling
...
This is the glorious commit where Week grid starts
showing and handing events.
2016-12-07 21:31:30 -02:00
Georges Basile Stavracas Neto
29ad51b19a
project: introduce GcalRangeTree
...
In order to correctly implement the week grid, we must
have a fast and optimized data structure to handle date
intervals.
This commit introduces, then, GcalRangeTree. The range tree
is an augmented AVL tree designed to handle intervals (i.e.
ranges) rather than single-dimensional keys.
It is a very good struct since common operations like insert
and removal are O(log n). It also is optimized for the ranges
we work on, so the nodes only take up the absolutely minimum
space required.
2016-12-07 21:27:25 -02:00
Georges Basile Stavracas Neto
c93d634454
week-view: add events to the grid when needed
2016-12-07 17:02:47 -02:00
Georges Basile Stavracas Neto
8a9a58419a
week-grid: add stub add_event() and remove_event()
2016-12-07 17:02:14 -02:00
Georges Basile Stavracas Neto
54ff4eefc3
week-header: reimplement header expansion and collapsing
2016-12-03 01:40:10 -02:00
Georges Basile Stavracas Neto
4a7754c677
week-header: fix merging events
2016-12-03 00:04:06 -02:00
Georges Basile Stavracas Neto
adc4bbae9e
week-header: simplify event removal
2016-12-02 21:05:54 -02:00
Georges Basile Stavracas Neto
e6ccc0e6e4
week-header: lots of cleanups and fixes
...
I'm simply too tired to split them off in separate commits,
so let me explain here. This commit:
* Remove debug messages
* Fixes many off-by-n and const-mistakes
* Simplifies the code
2016-12-02 18:22:49 -02:00
Georges Basile Stavracas Neto
922e7ce542
week-header: remove unecessary code
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
18b788c997
week-header: rename function
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
ab50b0d039
week-header: rewrite event moving method
...
This method could've avoided an infinite loop case all this time,
and I didn't realize it.
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
1903474ca6
week-header: make event removal more robust
...
The current code does not move the remaining events up and,
when changing the week header various times, it ends up
showing completely bogus events at bogus positions.
Fix that by properly moving events up when removing them.
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
392c310f55
week-header: refactor event moving
...
Instead of passing the position of the widget in the
UI, pass the position of the widget in the model.
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
3b885d2874
week-header: fix style
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
2bc8f85ce8
week-header: simplify and extend moving column events
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
de36d449ed
week-header: don't allow negative widths
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
92ba507b9e
week-header: implement merging of consecultive events
...
When an event is placed in the same row consecultively, we must
guarantee that it's only one widget.
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
bb0e927fc2
week-grid: style cleanup
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
f4f2527e69
week-header: remove unused code
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
6e318f3463
week-header: start moving to use another event storage
...
Instead of using a single, giant GList to store all the available
events, use an array of sorted GLists.
This commit adds temporary debug messages, beware the huge output.
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
c66029d49f
window: fix week view range
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
1cf46abfed
week-view: don't set the subscriber range twice
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
2e7c6c8c58
week-header: visual improvements
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
12da2c44e7
week-view: improve drawing of the week grid
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
39076d1aaf
style: update hour sidebar padding
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
16a2d64874
week-header: simplify background drawing code
...
By moving the drawing area to a separate place, we're
able to avoid having to manually calculate the sidebar
width.
Also, because we can, the drawing code was simplified a
little bit by moving the bottom border to CSS.
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
2298379e51
week-header: reorganize widgets
...
Instead of a box inside the overlay, put the overlay inside the
box.
2016-12-01 23:48:54 -02:00
Georges Basile Stavracas Neto
154a01f4c1
week-view, week-grid: various fixed
...
This commit is a rebase, compile-warning remover and a
misbehaviour fixer too.
2016-12-01 23:48:53 -02:00
Georges Basile Stavracas Neto
a43df17b08
week-header: turn into a GtkGrid
...
If the header is a GtkScrolledWindow, all the content
(including the top labels and week names) are scrolled.
This is a wrong behavior, since only the events should
be scrollable.
Fix that by making GcalWeekHeader a GtkGrid, and adding
the scrolled window in the correct position.
2016-12-01 23:48:53 -02:00
Georges Basile Stavracas Neto
591d8af5e4
theme: add a nice transition on the month chooser widget
2016-10-03 19:56:42 -03:00
Georges Basile Stavracas Neto
65c619b433
edit-dialog: also set top and bottom margins
...
It looks like the cursor at the "Notes" section of the
edit dialog has no vertical space to breath, and it's
a little bit annoying as it runs away from the expected
position.
Fix that by adding a small margin at the top and the bottom
of the text view at the "Notes" section.
2016-10-03 19:37:08 -03:00
Georges Basile Stavracas Neto
6967c520c9
manager: make all calendars offline-sync
...
This prevents downloading the same calendar (which can be huge)
over and over, saving us some bandwidth.
https://bugzilla.gnome.org/show_bug.cgi?id=764623
2016-10-03 14:10:45 -03:00
Georges Basile Stavracas Neto
3d3dddf815
manager: avoid deep nesting
...
Use an early return rather than deep nesting to improve the
code legibility.
https://bugzilla.gnome.org/show_bug.cgi?id=764623
2016-10-03 14:10:35 -03:00
Georges Basile Stavracas Neto
7d3cd7f727
month-view: queue redraw on scroll
...
If we scroll to a month that has no event widget to
display, the redraw is not dispatched and looks like
Calendar is broken.
Fix that by always queuing a redraw.
2016-10-02 08:19:19 -03:00
Georges Basile Stavracas Neto
050bdd37d2
Bump 3.22.1 release
2016-10-01 20:58:25 -03:00
Georges Basile Stavracas Neto
23cc46a01a
event: fix comparison if event is today
...
Since the end times are open-ended, we have to consider the very second
before the actual end time.
https://bugzilla.gnome.org/show_bug.cgi?id=772104
2016-10-01 20:43:37 -03:00
Georges Basile Stavracas Neto
159da57e46
quick-add-popover: always set seconds to 0
...
https://bugzilla.gnome.org/show_bug.cgi?id=772104
2016-10-01 20:35:48 -03:00
Georges Basile Stavracas Neto
e8dbe48baa
quick-add-popover: focus "Create" button after selecting an agenda
...
So that the keyboard flow is smooth and clean.
https://bugzilla.gnome.org/show_bug.cgi?id=770714
2016-10-01 20:15:14 -03:00
Georges Basile Stavracas Neto
152f6ff8b7
month-view: use G_DECLARE_FINAL_TYPE
...
Instead of using the old GLib boilerplate code, use the new
utilities and simplify the code a little bit. This also allows
us to remove the private field of month view.
2016-10-01 19:56:01 -03:00
Georges Basile Stavracas Neto
a2edfd48b6
subscriber-view: add an autoptr cleanup function
...
So that we can use G_DECLARE_{FINAL,DERIVABLE}_TYPE() utility macros.
2016-10-01 19:54:54 -03:00
Georges Basile Stavracas Neto
62aa66b8da
year-view: implement scrolling to change year
...
Following the previous work on month view, this commit
implements scrolling capabilities to Year view. We do
this not only with the :scroll-event, but also using the
:edge-overshot signal of GtkScrolledWindow.
2016-10-01 19:16:18 -03:00
Georges Basile Stavracas Neto
eb7ad4959b
month-view: allow changing months with scrolling
...
It is very natural and intuitive to try and change the current date
by scrolling. The current implementation of the Month view, however,
blatantly ignores scroll events.
Fix that by hearing to the scrolling events and changing the month
when the scroll is enough.
2016-10-01 19:15:54 -03: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
81b178acff
search-view: fix segfault
2016-09-28 21:04:51 -03:00
Georges Basile Stavracas Neto
be3833b977
quick-add-popover: only increase day on single day events
2016-09-28 01:11:14 -03:00
Georges Basile Stavracas Neto
653fb86d16
quick-add-popover: fix single all-day events
2016-09-28 01:02:45 -03:00
Georges Basile Stavracas Neto
a8f4346e1c
edit-dialog: setup the correct label when selecting a calendar
...
Since now we manually manage the headerbar title and subtitle, setting
them via GtkHeaderBar API won't have any effect.
Fix that by directly setting the subtitle label.
https://bugzilla.gnome.org/show_bug.cgi?id=771565
2016-09-28 00:34:23 -03:00
Georges Basile Stavracas Neto
1e1452810e
quick-add-popover: only today events are timed
...
Everything else is all day.
https://bugzilla.gnome.org/show_bug.cgi?id=770713
2016-09-28 00:29:52 -03:00
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
e79bdfb933
search-view: fix time label
...
We want to show "All day" when the event is all day, not
when it ~isn't~ all day.
https://bugzilla.gnome.org/show_bug.cgi?id=771677
2016-09-27 23:16:20 -03:00
Georges Basile Stavracas Neto
4582ade21d
edit-dialog: sync time and date widgets' sizing
...
So the time widgets don't grow over the date widgets and break
the vertical layout of the edit dialog.
https://bugzilla.gnome.org/show_bug.cgi?id=771440
2016-09-27 22:48:27 -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
Georges Basile Stavracas Neto
10391ae6a9
manager: setup default calendar on event creation
...
When an event is successfully created, make that the default source.
https://bugzilla.gnome.org/show_bug.cgi?id=771570
2016-09-27 22:35:48 -03:00
Georges Basile Stavracas Neto
df13ac2a59
quick-add-popover: track default calendar
...
Update the selected calendar when the default one changes.
https://bugzilla.gnome.org/show_bug.cgi?id=771570
2016-09-27 22:30:11 -03:00
Georges Basile Stavracas Neto
dfdcb7c29c
manager: add ::default-calendar property
...
This property acts as a proxy to ESourceRegistry::default-calendar
and will be used by future patches to track when the default calendar
changes.
https://bugzilla.gnome.org/show_bug.cgi?id=771570
2016-09-27 22:28:59 -03:00
Georges Basile Stavracas Neto
97f8979c53
month-view: hide overflow popover on drag and drop
...
When the user starts a drag operation from the overflow popover,
it should hide itself, otherwise it can block dropping the event
below it. Currently, this is not what happens.
Fix that by making the overflow popover a drag and drop target,
and hide it when it detects drag movement.
https://bugzilla.gnome.org/show_bug.cgi?id=771663
2016-09-27 21:48:07 -03:00
Georges Basile Stavracas Neto
a76d40d290
quick-add-popover: only show writable calendars
...
There is no reason to display read-only calendars, since the
user can't add any events on it.
Fix that by only showing writable calendars.
https://bugzilla.gnome.org/show_bug.cgi?id=768324
2016-09-27 21:30:43 -03:00
Georges Basile Stavracas Neto
9da6896105
manager: remove unused ::source-activated signal
...
We're not using it anymore, no need to keep it here.
https://bugzilla.gnome.org/show_bug.cgi?id=768324
2016-09-27 21:29:49 -03:00
Georges Basile Stavracas Neto
3ef45ccf9f
quick-add-popover: focus the summary entry when shown
...
So the user can start typing right away.
2016-09-27 21:20:45 -03:00