Commit Graph
1313 Commits
Author SHA1 Message Date
Georges Basile Stavracas Neto dfdaa3a590 year-view: simplify empty sidebar list calculation 2016-07-05 23:55:33 -03:00
Georges Basile Stavracas Neto 9fcb224032 window: avoid a crashing timeout
If the user quickly performs a search, open up the calendar
and close it immediately after, the timeout for showing the
event is mistakenly called after the window is destroyed and
causes Calendar to crash.

Fix that by keeping the source id tracked, and realizing it
on finalize().
2016-06-30 00:01:06 -03:00
Georges Basile Stavracas Neto 58b193f886 manager: keep the Shell's activated event alive
Currently, the user performs a search in Shell and activates
the result. That should show the edit dialog with the event
being edited, but it's not happening correctly.

Debugging the warnings generated, it was found that the event
was being unref()d and, obviously, that was not what we wanted.

Fix that by only unref()ing the events we don't want, and keeping
the wanted event alive.
2016-06-30 00:01:06 -03:00
Georges Basile Stavracas Neto 33c7031164 project: remove GbScrolledWindow
The max-content-height property was ported to GtkScrolledWindow,
which means we don't have to use a custom class anymore.
2016-06-17 18:18:38 -03:00
Isaque Galdino 3dbe4addeb year-view: Popover position
Year view was placing popover to mouse click (x,y) position. That was a
little odd because sometimes popover was placed above the selected day.

This patch address that by placing popover always out of the day box.

When selecting the whole month or more than one day, popover will also
be placed out of the month box. reducing the chance to cover selected
days.

https://bugzilla.gnome.org/show_bug.cgi?id=743306
2016-06-17 18:00:32 -03:00
Georges Basile Stavracas Neto de921ff54b source-dialog: open file when response is ok
The source dialog currently skips the file selected by
pressing the Open button.

Fix that by also considering the response of the dialog.
2016-06-01 11:59:22 -03:00
Iain Lane 9b358eb0ba year-view: Use the new schema from gsettings-desktop-schemas
So that we don't have to depend on GNOME shell.

https://bugzilla.gnome.org/show_bug.cgi?id=764001
2016-05-31 14:18:13 -03:00
Georges Basile Stavracas Neto 82b5953b76 month-view: fix invalid cell calculation 2016-05-21 19:15:14 -03:00
Georges Basile Stavracas Neto 1c90791d3b year-view: fix hover & dnd drawing on RTL locales 2016-05-21 19:06:15 -03:00
Georges Basile Stavracas Neto 5960a45d00 month-view: consider the days delay when dealing with the cell
The cell number does not consider the days delay, thus is not
the current day. To find the current day, we must remove the
days delay.
2016-05-21 19:02:39 -03:00
Georges Basile Stavracas Neto 88730dbafb year-view: don't render DnD when it leaves 2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 82c7918b15 year-view: implement the ::drag-drop operation
This magical commit finally implements the Drag and Drop
on Year view, enabling users to drop events from the sidebar
to the year navigator.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 44f5cbe607 year-view: render DnD selector on hover
This commit adds the ability to render a DnD square
to give visual feedback for the hover operation.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto c7d92e9f37 year-view: make the year navigator a DnD dest
This way, we can drop events at the widget.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto c2bf75d151 month-view: improve rendering of DnD target
This commit makes the lines always 1px.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 220d7c88bd month-view: save the event when dragged and dropped
This magical commit finally implements the Drag n' Drop
feature for Month view by changing the start and end dates
of the events according to the cell where the user drops
the event.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 1f534aa97e month-view: hold a pointer to the singleton GcalManager
It'll be used in the next commit to save the DnD'ed event.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto 982b7da02b month-view: draw a drop target background
When dragging an event, it is very important to have
a visual feedback of the possible target areas.

As such, add a gtk_render_background() call to render
the drag cell's background.
2016-05-21 18:54:47 -03:00
Georges Basile Stavracas Neto d0821d7e4d month-view: set as a drag destination
The month view will be the first one to receive
support for drag and drop. As such, it must be
set as a drag destination.
2016-05-21 18:54:47 -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 f3da1b2cec subscriber-view: iter the single day table
When we modify an event, the start date may change
and there is no way to retrieve it back. Since we're
relying on the start date to get the cell number and,
remove the widget, it leads to a crash because the
widget is not removed.

Fix that by brute-forcely search the widget in the
correct table.
2016-05-21 18:53:37 -03:00
Georges Basile Stavracas Neto 96de78d9af trivial: style fix 2016-05-21 18:53:16 -03:00
Georges Basile Stavracas Neto 46deb620e7 app-menu: add a Calendars... item in the app menu
I won't hurt to have 2 ways to access this dialog and,
appearently, the current behavior happens to bother
some users.

https://bugzilla.gnome.org/show_bug.cgi?id=762705
2016-05-20 22:33:35 -03:00
Georges Basile Stavracas Neto 9c150de822 year-view: don't cancel selection while dragging
This breaks the users' expectations that the navigator
will keep the selected dates. The old behavior was hazardous
for users with disabilities.

https://bugzilla.gnome.org/show_bug.cgi?id=762462
2016-05-20 22:18:34 -03:00
Georges Basile Stavracas Neto 6a8a4dfad0 year-view: add hover effect to the navigator
The current implementation of the Year navigator gives
absolutely no clue that the days are actually selectable,
which may confuse some users.

A simple way to inform the user that the Year navigator
is actually interactive is the hovering effect.

Fix the lack of feedback by adding the hover effect to the
year navigator.

https://bugzilla.gnome.org/show_bug.cgi?id=762462
2016-05-20 22:09:00 -03:00
Isaque Galdino f32fd7d2f6 year-view: Reduce maximum of month columns
The view had a maximum of 6 month columns, leading to a huge amount of
vertical spaces, so it was requested to reduce that.

The maximum number of columns was reduced to 4, so the view will have a
maximum 4x3 months layout.

https://bugzilla.gnome.org/show_bug.cgi?id=753533
2016-05-20 12:07:11 -03:00
Georges Basile Stavracas Neto 7553d5191f window: change check button state when a source is enabled
Instead of destroying and readding the rows, simply set the
checkbutton's active state when the source is enabled or
disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=766259
2016-05-20 11:41:22 -03:00
Georges Basile Stavracas Neto a83e8dd972 year-view: calculate number of rows on-the-fly
Instead of adding another field to the structure and
do many pointer lookups, calculate the number of rows
on the fly.
2016-05-19 09:57:42 -03:00
Georges Basile Stavracas Neto e6c9ecd7eb month-view: clear the pointer when it's not stored in place
It leaks a reference, but only happens for end date.
2016-05-18 11:57:43 -03:00
Georges Basile Stavracas Neto 12e6de6383 month-view: update comments
Many things changed during the mean time.
2016-05-18 11:51:10 -03:00
Georges Basile Stavracas Neto 266474c1e3 month-view: correctly check if dates are different
The previous commit introduced many changes in the way
the conditions are done. Unfortunately, one of these
conditions was only partially fixed.

Fix that by using the correct function to compare dates.
2016-05-18 11:27:11 -03:00
Georges Basile Stavracas Neto 692a9639a3 month-view: fix various reference issues with GDateTime
The current code does multiple needless unrefs, uses the
GDateTime API in a wrongly manner and leaks references
all around.

This causes the Calendar application to emit multiple warning
messages and in the worst case, crash immediately.

Fix that by rewriting the critical sections of the code that
deals with the start and end mark cells.

https://bugzilla.gnome.org/show_bug.cgi?id=763641
2016-05-18 11:20:00 -03:00
Isaque Galdino 3ead41b83f year-view: show all month's events
User requested when clicking month's name, all month's events are shown
in the sidebar.

https://bugzilla.gnome.org/show_bug.cgi?id=755394
2016-05-17 11:28:08 -03:00
Isaque Galdino 97d8859574 year-view: Remove hardcoded values
Improve year-view code, removing hardcoded values.

year-view have hardcoded values for grid cell sizes (width and height).
Those values need to be recalculated every time a change in font or any
other style are changed.

Sidebar width was also hardcoded instead of getting its value directly
from the ui file. That would prevent it from drawing the content
accordingly when ui file is changed.

This patch fixes those two issues by retrieving those values from CSS or
ui files.

This patch also adds code to resize and redraw the window when
show-week-numbers property is changed.

Popover mode was also changed and now sidebar will always be shown when
show-week-numbers is set or when there is space for only 3 or less
columns.

https://bugzilla.gnome.org/show_bug.cgi?id=753533
2016-05-16 12:03:39 -03:00
Isaque Galdino 5e05f99876 build: define first week day in the build script
Calendar is not handling locale correctly, e.g. user’ set language to
English (en-us) and format to Norwegian (nb-no), but Calendar assumes
English format rather than Norwegian.

Calendar code was ready to use the correct format, just like Shell and
GtkCalendar. The issue was in the build script which was setting the
correct locale variable responsible to make that code work.

This patch fixes the build script.

https://bugzilla.gnome.org/show_bug.cgi?id=762428
2016-05-08 14:30:00 -03:00
Georges Basile Stavracas Neto 48df0903e5 month-view: consider the top padding for the extra events popover
When the mouse button is released, only the bottom padding was being
taken into account to calculate whether the click was in the "Show
N events" area.

This commit fixes this issue by considering the top padding as well.

https://bugzilla.gnome.org/show_bug.cgi?id=765678
2016-05-08 14:14:56 -03:00
Thadeu Lima de Souza Cascardo c941326230 source-dialog: protect against NULL user address
e_webdav_discover_sources_finish can discover no user addresses and
return a NULL user_addresses. Check for that before calling
e_source_webdav_set_email_address.

https://bugzilla.gnome.org/show_bug.cgi?id=765170
2016-04-17 10:01:27 -03:00
Javier Sánchez Ochando 043cca24b6 window: make Today button insensitive when today is visible
When a view shows the current day, the Today button should be insensitive.
This patch makes today button sensitive only when today is not shown.

https://bugzilla.gnome.org/show_bug.cgi?id=747963
2016-03-27 11:26:39 -03:00
pandusonu2 a3cbaf1e81 month-view: selection across months
In this commit we change the data type of start_mark_cell and end_mark_cell to GDateTime from gint

Currently, the mark_cell's are gint and while moving across months, they cause a problem as they don't take the new month into consideration but the cell value of the selector.

To fix this, we changed the data type of the mark_cell's and modified all the functions dependant on it.

https://bugzilla.gnome.org/show_bug.cgi?id=763641
2016-03-26 17:31:25 -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
Anwar Sadath 14dc32891b edit-dialog: Respecting GNOME's 12/24 hour format
The edit dialog time picker didnt take into account GNOME's hour format.

The edit dialog time picker didnt take into account GNOME's hour format because the desktop settings clock-format from gcal-window was not passed to gcal-edit-dialog.

Now the data is passed through the function gcal_edit_dialog_time_format and everything works as required.

https://bugzilla.gnome.org/show_bug.cgi?id=703321
2016-03-14 17:40:22 -03:00
Isaque Galdino 32c5c824e3 year-view: Read show-weekdate from GNOME Shell
Year view always shows week numbers and by design team the default show
not display them.

This patch adds support to read "show week numbers" setting from GNOME
Shell (org.gnome.shell.calendar::show-weekdate) and to change year-view
accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=763251
2016-03-14 16:57:45 -03:00
fosero 465d786ae8 year-view: criticals on last day of month events
Adding 1 to the day variable at the end of the month results in an
invalid datetime, use g_date_time_add_days instead.

https://bugzilla.gnome.org/show_bug.cgi?id=763015
2016-03-14 16:54:54 -03:00
fosero 96d2b37fec month-view: fix end-of-month multi-day selections
Use g_date_time_add_days to add a day to the final day of the month to
fix behaviour when selecting a range up to the last day of the month.

https://bugzilla.gnome.org/show_bug.cgi?id=763015
2016-03-14 16:54:54 -03:00
fosero 2ac228a9b8 quick-add-popover: adjust end date properly
Subtracting 1 from the first day of the month leads to an invalid date
being shown: use a proper function to adjust the date.

https://bugzilla.gnome.org/show_bug.cgi?id=763015
2016-03-14 16:54:54 -03:00
fosero c67d52092c month-view: fix date adjust mishap
https://bugzilla.gnome.org/show_bug.cgi?id=763015
2016-03-14 16:54:53 -03:00
fosero 8a72bf0ce7 month-view: add selection background fill
https://bugzilla.gnome.org/show_bug.cgi?id=763217
2016-03-12 21:58:22 -03:00
fosero 0ce85f6072 month-view: cleanup multi-row selection drawing
The selection mode was drawing a number of boxes on multi-row
selections, resulting in unwanted outlines within the selection area.
This patch adds a multirow mode that just draws the outline of a
selection.

Make cell_{width,height} integers so divison lines always get drawn on
exact grid coordinates, otherwise line calculations could result in
fuzzy lines.

https://bugzilla.gnome.org/show_bug.cgi?id=763217
2016-03-12 21:58:22 -03:00