From 2744f4f8cad1df2b7f3b686b5d3c3dfa49d3af48 Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 19 Oct 2015 16:53:04 -0400 Subject: Convert the desktop-plugin "applauncher" (desktop icons) to use a double-click for launching items instead of a single click. --- lumina-desktop/LSession.cpp | 4 ++-- .../desktop-plugins/applauncher/AppLauncherPlugin.cpp | 2 +- .../desktop-plugins/applauncher/OutlineToolButton.h | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'lumina-desktop') diff --git a/lumina-desktop/LSession.cpp b/lumina-desktop/LSession.cpp index cd78cce2..753cbeb9 100644 --- a/lumina-desktop/LSession.cpp +++ b/lumina-desktop/LSession.cpp @@ -436,11 +436,11 @@ void LSession::checkUserFiles(){ dset = QDir::homePath()+"/.lumina/LuminaDE/lumina-open.conf"; if(!QFile::exists(dset)){ firstrun = true; - if(QFile::exists(LOS::LuminaShare()+"defaultapps.conf")){ + /*if(QFile::exists(LOS::LuminaShare()+"defaultapps.conf")){ if( QFile::copy(LOS::LuminaShare()+"defaultapps.conf", dset) ){ QFile::setPermissions(dset, QFile::ReadUser | QFile::WriteUser | QFile::ReadOwner | QFile::WriteOwner); } - } + }*/ } //Check the fluxbox configuration files diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp index e1f55771..5f429c5f 100644 --- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp +++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp @@ -14,7 +14,7 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par button->setText("...\n..."); //Need to set something here so that initial sizing works properly button->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding); lay->addWidget(button, 0, Qt::AlignCenter); - connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) ); + connect(button, SIGNAL(DoubleClicked()), this, SLOT(buttonClicked()) ); //menu = new QMenu(this); /*int icosize = this->readSetting("iconsize",-1).toInt(); if(icosize <1){ diff --git a/lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h b/lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h index 7c8c012d..68540292 100644 --- a/lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h +++ b/lumina-desktop/desktop-plugins/applauncher/OutlineToolButton.h @@ -18,6 +18,7 @@ #include #include #include +#include class OutlineToolButton : public QToolButton{ @@ -31,7 +32,21 @@ public: } ~OutlineToolButton(){} +signals: + void DoubleClicked(); + protected: + void mouseDoubleClickEvent(QMouseEvent *ev){ + ev->accept(); + emit DoubleClicked(); + } + void mousePressEvent(QMouseEvent *ev){ + ev->ignore(); + } + void mouseReleaseEvent(QMouseEvent *ev){ + ev->ignore(); + } + void paintEvent(QPaintEvent*){ /* NOTE: This is what a standard QToolButton performs (peeked at Qt source code for this tidbit) QStylePainter p(this); -- cgit