diff options
Diffstat (limited to 'src-qt5')
7 files changed, 77 insertions, 7 deletions
diff --git a/src-qt5/core-utils/lumina-config/mainWindow.cpp b/src-qt5/core-utils/lumina-config/mainWindow.cpp index 566cd412..0dafc1da 100644 --- a/src-qt5/core-utils/lumina-config/mainWindow.cpp +++ b/src-qt5/core-utils/lumina-config/mainWindow.cpp @@ -11,14 +11,22 @@ #include "pages/getPage.h" #include "pages/page_main.h" +#include <QSettings> + //============= // PUBLIC //============= mainWindow::mainWindow() : QMainWindow(), ui(new Ui::mainWindow()){ ui->setupUi(this); + geomTimer = new QTimer(this); + geomTimer->setSingleShot(true); + geomTimer->setInterval(1000); //1 second + connect(geomTimer, SIGNAL(timeout()), this, SLOT(saveWinGeometry()) ); + APPSLIST = new XDGDesktopList(this, true); //keep this up to date while the app is open QTimer::singleShot(100, APPSLIST, SLOT(updateList())); //don't let this hold up the initial application loading cpage = "somerandomjunktostartwith"; + //Need to insert a spacer action in the toolbar QWidget *tmp = new QWidget(this); tmp->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); @@ -30,6 +38,9 @@ mainWindow::mainWindow() : QMainWindow(), ui(new Ui::mainWindow()){ setupIcons(); loadMonitors(); //changePage(""); //load the default main page + QSettings S("lumina-desktop","lumina-config"); + QRect geom = S.value("window_geometry", QRect()).toRect(); + if(!geom.isNull()){ this->setGeometry(geom); } } mainWindow::~mainWindow(){ @@ -58,7 +69,7 @@ void mainWindow::setupIcons(){ } void mainWindow::loadMonitors(){ - if(ui->actionMonitor->menu()==0){ + if(ui->actionMonitor->menu()==0){ ui->actionMonitor->setMenu( new QMenu(this) ); ui->actionMonitor->setWhatsThis("0"); connect( ui->actionMonitor->menu(), SIGNAL(triggered(QAction*)), this, SLOT(changeMonitor(QAction*)) ); @@ -76,7 +87,7 @@ void mainWindow::loadMonitors(){ ui->actionMonitor->setWhatsThis(tmp->whatsThis() ); } } - + } //============= @@ -114,6 +125,11 @@ void mainWindow::changePage(QString id){ //================ // PRIVATE SLOTS //================ +void mainWindow::saveWinGeometry(){ + QSettings S("lumina-desktop","lumina-config"); + S.setValue("window_geometry", this->geometry()); +} + //Page signal handling void mainWindow::pageCanSave(bool save){ ui->actionSave->setVisible(save); diff --git a/src-qt5/core-utils/lumina-config/mainWindow.h b/src-qt5/core-utils/lumina-config/mainWindow.h index 958daff9..c441de61 100644 --- a/src-qt5/core-utils/lumina-config/mainWindow.h +++ b/src-qt5/core-utils/lumina-config/mainWindow.h @@ -9,6 +9,9 @@ #include "globals.h" //#include "pages/getPage.h" +#include <QResizeEvent> +#include <QMoveEvent> + namespace Ui{ class mainWindow; }; @@ -28,11 +31,13 @@ private: Ui::mainWindow *ui; QShortcut *backShortcut, *quitShortcut; QString cpage; //current page - + QTimer *geomTimer; void changePage(QString id); private slots: + void saveWinGeometry(); + //Page signals void pageCanSave(bool); void pageSetTitle(QString); @@ -42,5 +47,17 @@ private slots: void on_actionBack_triggered(); void changeMonitor(QAction*); void quitShortcut_Triggered(); + +protected: + void resizeEvent(QResizeEvent *ev){ + if(geomTimer->isActive()){ geomTimer->stop(); } + geomTimer->start(); + QMainWindow::resizeEvent(ev); + } + void moveEvent(QMoveEvent *ev){ + if(geomTimer->isActive()){ geomTimer->stop(); } + geomTimer->start(); + QMainWindow::moveEvent(ev); + } }; #endif diff --git a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp index 6b458c24..22ee6dc4 100644 --- a/src-qt5/core/lumina-desktop/LDesktopBackground.cpp +++ b/src-qt5/core/lumina-desktop/LDesktopBackground.cpp @@ -46,7 +46,7 @@ QPixmap LDesktopBackground::setBackground(const QString& bgFile, const QString& } else { mode = Qt::KeepAspectRatio; } - if(bgImage.height() != geom.height() && bgImage.width() != geom.width() ){ bgImage = bgImage.scaled(geom.size(), mode); } + if(bgImage.height() != geom.height() && bgImage.width() != geom.width() ){ bgImage = bgImage.scaled(geom.size(), mode, Qt::SmoothTransformation); } //bgImage = bgImage.scaled(size(), mode); } diff --git a/src-qt5/core/lumina-desktop/LSession.cpp b/src-qt5/core/lumina-desktop/LSession.cpp index c1f49fc3..9ea377ba 100644 --- a/src-qt5/core/lumina-desktop/LSession.cpp +++ b/src-qt5/core/lumina-desktop/LSession.cpp @@ -10,6 +10,7 @@ #include <QTime> #include <QScreen> #include <QtConcurrent> +#include <QMimeData> #include "LXcbEventFilter.h" #include "BootSplash.h" @@ -72,6 +73,11 @@ LSession::LSession(int &argc, char ** argv) : LSingleApplication(argc, argv, "lu connect(this, SIGNAL(screenAdded(QScreen*)), this, SLOT(screensChanged()) ); connect(this, SIGNAL(screenRemoved(QScreen*)), this, SLOT(screensChanged()) ); connect(this, SIGNAL(primaryScreenChanged(QScreen*)), this, SLOT(screensChanged()) ); + + // Clipboard + ignoreClipboard = false; + qRegisterMetaType<QClipboard::Mode>("QClipboard::Mode"); + connect(QApplication::clipboard(), SIGNAL(changed(QClipboard::Mode)), this, SLOT(handleClipboard(QClipboard::Mode))); } //end check for primary process } @@ -587,6 +593,20 @@ void LSession::SessionEnding(){ stopSystemTray(); //just in case it was not stopped properly earlier } +void LSession::handleClipboard(QClipboard::Mode mode){ + if (!ignoreClipboard) { + const QMimeData *mime = QApplication::clipboard()->mimeData(mode); + if (!mime) { return; } + if (mime->hasText()) { QMetaObject::invokeMethod(this, "storeClipboard", Qt::QueuedConnection, Q_ARG(QString, mime->text()), Q_ARG(QClipboard::Mode, mode)); } + } +} + +void LSession::storeClipboard(QString text, QClipboard::Mode mode){ + ignoreClipboard = true; + QApplication::clipboard()->setText(text, mode); + ignoreClipboard = false; +} + //=============== // SYSTEM ACCESS //=============== diff --git a/src-qt5/core/lumina-desktop/LSession.h b/src-qt5/core/lumina-desktop/LSession.h index a25f3c15..824eede7 100644 --- a/src-qt5/core/lumina-desktop/LSession.h +++ b/src-qt5/core/lumina-desktop/LSession.h @@ -21,6 +21,7 @@ #include <QMediaPlayer> #include <QThread> #include <QUrl> +#include <QClipboard> #include "Globals.h" #include "AppMenu.h" @@ -141,6 +142,8 @@ private: int VersionStringToNumber(QString version); + bool ignoreClipboard; // flag for (handle/store)Clipboard + public slots: void StartLogout(); void StartShutdown(bool skipupdates = false); @@ -170,6 +173,10 @@ private slots: void SessionEnding(); + // Clipboard + void handleClipboard(QClipboard::Mode mode); + void storeClipboard(QString text, QClipboard::Mode mode); + signals: //System Tray Signals void VisualTrayAvailable(); //new Visual Tray Plugin can be registered diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp index 789b3990..a6e05000 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine-qtplugin/lthemeengineplatformtheme.cpp @@ -7,6 +7,7 @@ #include <QTimer> #include <QIcon> #include <QRegExp> +#include <QWindow> #ifdef QT_WIDGETS_LIB #include <QStyle> diff --git a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp index cb491aa6..9ffe39f8 100644 --- a/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp +++ b/src-qt5/core/lumina-theme-engine/src/lthemeengine/lthemeengine.cpp @@ -61,7 +61,10 @@ QStringList lthemeengine::sharedStyleSheetPath(){ dirs << QString(getenv("XDG_CONFIG_HOME")); dirs << QString(getenv("XDG_CONFIG_DIRS")).split(":"); dirs << QString(getenv("XDG_DATA_DIRS")).split(":"); - for(int i=0; i<dirs.length(); i++){ dirs[i].append("/lthemeengine/qss/"); } + for(int i=0; i<dirs.length(); i++){ + if (!dirs[i].endsWith("/")){ dirs[i].append("/"); } + dirs[i].append("lthemeengine/qss/"); + } if(dirs.isEmpty()){ dirs << LTHEMEENGINE_DATADIR"/lthemeengine/qss/"; } //no XDG settings - use the hardcoded path return dirs; } @@ -75,7 +78,10 @@ QStringList lthemeengine::sharedDesktopStyleSheetPath(){ dirs << QString(getenv("XDG_CONFIG_HOME")); dirs << QString(getenv("XDG_CONFIG_DIRS")).split(":"); dirs << QString(getenv("XDG_DATA_DIRS")).split(":"); - for(int i=0; i<dirs.length(); i++){ dirs[i].append("/lthemeengine/desktop_qss/"); } + for(int i=0; i<dirs.length(); i++){ + if (!dirs[i].endsWith("/")){ dirs[i].append("/"); } + dirs[i].append("lthemeengine/desktop_qss/"); + } if(dirs.isEmpty()){ dirs << LTHEMEENGINE_DATADIR"/lthemeengine/desktop_qss/"; } //no XDG settings - use the hardcoded path return dirs; } @@ -89,7 +95,10 @@ QStringList lthemeengine::sharedColorSchemePath(){ dirs << QString(getenv("XDG_CONFIG_HOME")); dirs << QString(getenv("XDG_CONFIG_DIRS")).split(":"); dirs << QString(getenv("XDG_DATA_DIRS")).split(":"); - for(int i=0; i<dirs.length(); i++){ dirs[i].append("/lthemeengine/colors/"); } + for(int i=0; i<dirs.length(); i++){ + if (!dirs[i].endsWith("/")){ dirs[i].append("/"); } + dirs[i].append("lthemeengine/colors/"); + } if(dirs.isEmpty()){ dirs << LTHEMEENGINE_DATADIR"/lthemeengine/colors/"; } //no XDG settings - use the hardcoded path qDebug() << "Got Color Dirs:" << dirs; return dirs; |