diff options
-rw-r--r-- | lumina-desktop/LSession.cpp | 13 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/LDPlugin.h | 2 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp | 3 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h | 58 | ||||
-rw-r--r-- | lumina-desktop/desktop-plugins/calendar/CalendarPlugin.h | 24 | ||||
-rw-r--r-- | lumina-desktop/lumina-desktop.pro | 1 |
6 files changed, 92 insertions, 9 deletions
diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index e81cdebf..a1caf715 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -579,12 +579,17 @@ void LSession::adjustWindowGeom(WId win, bool maximize){ qDebug() << " - New Geom:" << geom << fgeom; } - if(fgeom.y() <= desk.y()){ - //This is a window on the top of the screen - use the window geom only (no frame included) - XCB->MoveResizeWindow(win, geom); - }else{ + // if(fgeom.y() <= desk.y()){ + + //}else{ //Need to use the frame origin point with the window size (for some reason - strange Fluxbox issue) XCB->MoveResizeWindow(win, QRect(fgeom.topLeft(), geom.size()) ); + //} + //For the random windows which are *still* off the top of the screen + fgeom = XCB->WindowGeometry(win, true); //re-fetch the current geometry (including frame) + if(fgeom.y() <= desk.y()){ + //This is a window off the top of the screen - use the window geom only (no frame included) + XCB->MoveResizeWindow(win, geom); } } diff --git a/lumina-desktop/desktop-plugins/LDPlugin.h b/lumina-desktop/desktop-plugins/LDPlugin.h index 6c34ab9c..f9e5a12b 100644 --- a/lumina-desktop/desktop-plugins/LDPlugin.h +++ b/lumina-desktop/desktop-plugins/LDPlugin.h @@ -1,6 +1,6 @@ //=========================================== // Lumina-DE source code -// Copyright (c) 2014, Ken Moore +// Copyright (c) 2014-2015, Ken Moore // Available under the 3-clause BSD license // See the LICENSE file for full details //=========================================== diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp index 3acb83fb..0335b650 100644 --- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp +++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp @@ -1,11 +1,12 @@ #include "AppLauncherPlugin.h" #include "../../LSession.h" +#include "OutlineToolButton.h" AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(parent, ID){ QVBoxLayout *lay = new QVBoxLayout(); this->setLayout(lay); lay->setContentsMargins(0,0,0,0); - button = new QToolButton(this); + button = new OutlineToolButton(this); button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); button->setAutoRaise(true); button->setText("...\n..."); //Need to set something here so that initial sizing works properly diff --git a/lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h b/lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h new file mode 100644 index 00000000..1e71658d --- /dev/null +++ b/lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h @@ -0,0 +1,58 @@ +//=========================================== +// Lumina-DE source code +// Copyright (c) 2015, Ken Moore +// Available under the 3-clause BSD license +// See the LICENSE file for full details +//=========================================== +// This is a simple subclass for a QToolButton with black/white text (for transparent backgrounds) +//=========================================== +#ifndef _LUMINA_DESKTOP_PLUGIN_APPLAUNCHER_OUTLINE_TOOLBUTTON_H +#define _LUMINA_DESKTOP_PLUGIN_APPLAUNCHER_OUTLINE_TOOLBUTTON_H + +#include <QToolButton> +#include <QPainter> +#include <QPainterPath> +#include <QPen> +#include <QStyle> +#include <QStyleOption> +#include <QStylePainter> +#include <QFont> + +class OutlineToolButton : public QToolButton{ + Q_OBJECT +public: + OutlineToolButton(QWidget *parent=0) : QToolButton(parent){ + QFont font = this->font(); + font.setStyleStrategy(QFont::ForceOutline);// | QFont::PreferQuality); + this->setFont(font); + } + ~OutlineToolButton(){} + +protected: + void paintEvent(QPaintEvent*){ + + //QPainter painter(this); + //QPainterPath path; + //QPen pen; + //pen.setWidth(2); + //pen.setColor(Qt::red); + //painter.setFont(this->font()); + //painter.setPen(pen); + //path.addText(10 , 60, this->font(), this->text()); //Adjust the position + //painter.drawPath(path); + QFont font = this->font(); + font.setStyleStrategy(QFont::ForceOutline);// | QFont::PreferQuality); + //This is what a QToolButton performs + QStylePainter p(this); + //p.setPen(pen); + QStyleOptionToolButton opt; + initStyleOption(&opt); + opt.font = font; //Use the font which forces outlines + //p.style()->drawControl(QStyle::CE_ToolButtonLabel, &opt, &p, this); //this does the outline underneath + p.drawComplexControl(QStyle::CC_ToolButton, opt); //This does the normal painting on top + //Now do the normal paint event over the top + //QToolButton::paintEvent(ev); + } + +}; +#endif 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 diff --git a/lumina-desktop/lumina-desktop.pro b/lumina-desktop/lumina-desktop.pro index 353324b7..43f32721 100644 --- a/lumina-desktop/lumina-desktop.pro +++ b/lumina-desktop/lumina-desktop.pro @@ -107,6 +107,7 @@ HEADERS += Globals.h \ desktop-plugins/SamplePlugin.h \ desktop-plugins/calendar/CalendarPlugin.h \ desktop-plugins/applauncher/AppLauncherPlugin.h \ + desktop-plugins/applauncher/OutlineToolButton.h \ desktop-plugins/desktopview/DesktopViewPlugin.h \ desktop-plugins/notepad/NotepadPlugin.h \ desktop-plugins/audioplayer/PlayerWidget.h \ |