Commit Graph

28 Commits

Author SHA1 Message Date
Carl Schwan
11e2ae62ba Add a bit more contrast to event indicator in calendar
Now make it darker on light theme and lighter on dark theme

CCBUG: 437203
2021-07-18 19:36:20 +00:00
Carl Schwan
9a8613612f Fix events appearing in year or decade view
Bug is probably caused by using a DelegateModel on a simple ListModel.
Make sure we don't even try to load the event delegate when there is no
events or it's not a DayModel

BUG: 436999
2021-05-13 00:30:26 +02:00
Carl Schwan
b3f8e96517 Add up to 5 event indicators to the DayDelegate
This commit replaces the existing triangular event indicator on calendar
days with colored dots; one per event, up to five events per day. The dots
will use the color of the event, if it has one.
2021-04-29 21:38:46 +00:00
Carl Schwan
103d8b539a Redesign the Plasma Calendar applet
* Visually this removes the lines between the day delegates in the calendar
and make it use the correct highlighting component
* Use a SwipeView for switching between the month, year, and decade view
* Makes the header optional
* Improves the documentation of the MonthView

This patch is explicitely licensed under LGPL-2.0-or-later
2021-04-23 17:35:27 +00:00
Jan Blackquill
d4ec370187 Remove hover animation from calendar
Removing hover animation from calendar tiles makes it feel more responsive
2021-01-18 19:15:48 -05:00
Andreas Cord-Landwehr
d10afb5d2a plasma-framework: Convert copyright statements to SPDX expressions 2020-08-13 19:08:54 +00:00
Carson Black
6c627ea044 Remove usage of context properties for theme and units 2020-07-27 19:54:44 +00:00
Friedrich W. H. Kossebau
67f5ad29e8 Fix PlasmaCalendar widget to not mark days with minor events
Summary:
CalendarEvents::EventData (in KDeclarative) has a property isMinor, which is
described as "If set to true, it won't be marked in the calendar grid".

This patch fulfils that promise, by introducing separate roles on the model
which explicitly report the existance of any major or any minor events at a
given day, so that the marker loader can concentrate on the major events.

Test Plan:
Using a plasmacalendar plugin which feeds events with isMinor=true the
widget now only marks days which have major events.

Reviewers: #plasma, broulik, davidedmundson

Reviewed By: #plasma, broulik, davidedmundson

Subscribers: davidedmundson, broulik, #frameworks

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D12438
2018-05-02 17:33:30 +02:00
David Edmundson
7d0b381061 Fix cannot assign undefined to double warning in DayDelegate
REVIEW: 128765
2016-08-26 12:14:26 +01:00
Martin Klapetek
18af870303 [calendar] Only show the events mark on days grid, not month or year 2016-05-02 19:51:20 -04:00
Martin Klapetek
08312b2e34 [calendar] Add a mark to days containing an event
REVIEW: 127586
2016-04-20 23:41:23 -04:00
Martin Klapetek
cff18c2cd2 [calendar] Fix calendar applet not clearing selection when hiding
This removes some old cruft that is not really used and serves
basically only as a bool property for checking if it's null and
wheter it equals the last activated date.

This can be done without it by simply resetting the current selected
date (another property) to "today".

REVIEW: 127455
BUG: 360683
2016-03-30 22:53:49 -04:00
Kai Uwe Broulik
4ebf130ee6 [Calendar] Add proper back/forward buttons and a "Today" button
This removes the custom label-based triangles and replaces them with proper ToolButtons
using proper icons. It also adds a "Today" button to return to the current day.
The tooltips on the buttons reflect the actual action ("Previous Month", "Previous Year",
"Previous Decade", depending on the zoom level).

Furthermore, the day names and week numbers now use the regular font size but they're still
visually disconnected. The day names row is hidden in the zoom levels now.

REVIEW: 126960
BUG: 336124
BUG: 348362
BUG: 358536
2016-02-08 00:07:43 +01:00
Martin Klapetek
f9d7fc87d5 [calendar] Fix binding loops 2015-11-16 11:52:55 -05:00
Kai Uwe Broulik
b61a03c048 Support pinch to zoom in the calendar
CHANGELOG: Using a pinch gesture one can now switch between the different zoom levels of the calenda

REVIEW: 124507
2015-08-04 12:44:37 +02:00
Kai Uwe Broulik
11e5ff10ae Improve calendar navigation
This adds a "Year overview" showing all 12 months in a grid, and a "Decade overview"
showing the current decade.

CHANGELOG: Calendar navigation has been significantly improved, providing a year and decade overview
REVIEW: 122488
2015-07-27 11:41:35 +02:00
Martin Klapetek
06827054f4 Replace Calendar grid with Canvas
This patch simplifies the grid a bit more by using Canvas instead of
Rectangles, so actually lowering the number of Items needed to create
the grid from 16 to just 1.

It works pretty neatly with no junctions problem at all.

REVIEW: 119283
2014-07-15 13:53:34 +02:00
Martin Klapetek
2f933387af Refactor the Calendar component a bit
Currently the grid itself is composed of 88 rectangles that draw all the
lines in a way that two big rect draws the whole two topmost horizontal
and leftmost vertical border lines and then each day rectangle is
drawing small bottom and right rect.

This patch reduces it to 13 rects only where one rect draws the whole
frame around the grid and then 1px wide/high rects draw the inner lines.
Results in much cleaner & simple code.

Plus there's a small refactor on the id names so it makes more sense.

This does not require any additional changes in the applets.

REVIEW: 119232
2014-07-12 13:52:34 +02:00
Martin Klapetek
9f0765b002 Make sure we update the calendar on date change
This introduces new property on MonthView - "today". This property is
updated by dataengine (or can be a timer too, but we already get signals
from dataengine every 30 seconds to update the clock) and is never
updated by the code itself.

Furthermore, the DayDelegate is now bound to it, so when "today"
changes, the selection rectangle in the calendar should also change.

And finally, the selected item in the grid is cleared if MonthView's
date property is cleared (which is second part of this patch, to the
applet itself).

REVIEW: 118277
2014-05-26 13:40:47 +02:00
Martin Klapetek
2bd7101314 Calendar QML imports cleanup 2014-05-13 17:51:43 +02:00
Martin Klapetek
a4b08b0db3 Fix calendar font sizing
Reviewed-by: Sebastian Kügler
2014-05-13 17:44:45 +02:00
Martin Klapetek
247e829332 Proper if-else {} style 2014-05-12 19:21:06 +02:00
Sebastian Kügler
13ec787302 Improved contrast for highlighted and today's delegate 2014-02-21 01:22:24 +01:00
Sebastian Kügler
84b6e6a245 Adjustments for theme.textColor
textColor is now used from the theme, there it is made grey, similar
effect, less code, more consistency.
2013-12-28 01:05:09 +01:00
Martin Klapetek
c29773656e Make isToday compare actual dates
So we don't have to construct awkward strings everytime.
2013-11-27 00:23:41 +01:00
Sebastian Kügler
4337daa38e Various layout improvements 2013-11-13 05:28:42 +01:00
Sebastian Kügler
6134503899 Navigation improvements
- fix today highlighting
- click on month name opens menu to switch month
- jump to today works
2013-11-12 04:53:50 +01:00
Sebastian Kügler
19db9c9663 Add calendar QML components to the Plugin
This allows us to keep minimal API, since the calendar view and import
really belong together. Also makes it a lot easier to provide a separate
Calendar Plasmoid.
2013-11-12 03:40:52 +01:00