diff options
author | Ken Moore <moorekou@gmail.com> | 2015-10-08 09:16:34 -0400 |
---|---|---|
committer | Ken Moore <moorekou@gmail.com> | 2015-10-08 09:16:34 -0400 |
commit | f2e7539354da61ff2fd03ccfb58acae8b89aa097 (patch) | |
tree | d42fabdf0bd5a1ca0f3c5b30ffff63aa32739c76 /lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h | |
parent | Get rid of an extra empty grid space between desktop items. (diff) | |
download | lumina-f2e7539354da61ff2fd03ccfb58acae8b89aa097.tar.gz lumina-f2e7539354da61ff2fd03ccfb58acae8b89aa097.tar.bz2 lumina-f2e7539354da61ff2fd03ccfb58acae8b89aa097.zip |
Commit a couple fixes:
1) Make sure the calendar desktop plugin updates the date occasionally.
2) Add the framework for a custom-painted Toolbutton for the applauncher plugin. This will be used to ensure font outlines in the near future.
3) Another small adjustment for new window geometries - run the overall adjustment first - then re-check and see if the window is off the top of the screen before trying the fallback movement routine.
Diffstat (limited to 'lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h')
-rw-r--r-- | lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h b/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h index 796bc42d..e9652e17 100644 --- a/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h +++ b/lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h @@ -11,22 +11,40 @@ #include <QCalendarWidget> #include <QVBoxLayout> +#include <QDate> +#include <QTimer> #include "../LDPlugin.h" class CalendarPlugin : public LDPlugin{ Q_OBJECT +private: + QCalendarWidget *cal; + QTimer *timer; + public: CalendarPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID){ this->setLayout( new QVBoxLayout()); this->layout()->setContentsMargins(0,0,0,0); cal = new QCalendarWidget(this); + cal->setSelectionMode(QCalendarWidget::NoSelection); this->layout()->addWidget(cal); this->setInitialSize( cal->sizeHint().width(), cal->sizeHint().height() ); + timer = new QTimer(this); + timer->setInterval(1800000); //30 minute refresh timer + timer->start(); + QTimer::singleShot(0,this, SLOT(updateDate()) ); } - ~CalendarPlugin(){} + ~CalendarPlugin(){ timer->stop(); } -private: - QCalendarWidget *cal; +private slots: + void updateDate(){ + if(cal->selectedDate() != QDate::currentDate()){ + cal->setSelectedDate(QDate::currentDate()); + cal->showSelectedDate(); + } + } + + }; #endif |