Commit Graph
2169 Commits
Author SHA1 Message Date
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