aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-06-14 18:27:45 -0400
committerKen Moore <ken@pcbsd.org>2015-06-14 18:27:45 -0400
commit5f537166a4af31db171711d9cedeb318ac7443b5 (patch)
treee08c446ab3622e709d2aa75ec10ec67a91fc195f /lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
parentRe-work quite a bit of the background procedures for desktop plugins and watc... (diff)
downloadlumina-5f537166a4af31db171711d9cedeb318ac7443b5.tar.gz
lumina-5f537166a4af31db171711d9cedeb318ac7443b5.tar.bz2
lumina-5f537166a4af31db171711d9cedeb318ac7443b5.zip
Disable some debugging and fix up the context menu on the applauncher plugins.
Diffstat (limited to 'lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp')
-rw-r--r--lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
index 5d610148..4dee95ca 100644
--- a/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
+++ b/lumina-desktop/desktop-plugins/applauncher/AppLauncherPlugin.cpp
@@ -13,11 +13,6 @@ AppLauncherPlugin::AppLauncherPlugin(QWidget* parent, QString ID) : LDPlugin(par
lay->addWidget(button, 0, Qt::AlignCenter);
connect(button, SIGNAL(clicked()), this, SLOT(buttonClicked()) );
menu = new QMenu(this);
- menu->addAction(LXDG::findIcon("zoom-in",""), tr("Increase Size"), this, SLOT(increaseIconSize()));
- menu->addAction(LXDG::findIcon("zoom-out",""), tr("Decrease Size"), this, SLOT(decreaseIconSize()));
- if( !ID.isEmpty() && ID.contains(QDir::homePath()+"/Desktop") ){
- menu->addAction(LXDG::findIcon("list-remove",""), tr("Delete File"), this, SLOT(deleteFile()) );
- }
int icosize = this->readSetting("iconsize",64).toInt();
button->setIconSize(QSize(icosize,icosize));
this->setContextMenuPolicy(Qt::CustomContextMenu);
@@ -49,7 +44,7 @@ void AppLauncherPlugin::loadButton(){
}
}else if(ok){
QFileInfo info(path);
- button->setWhatsThis(info.fileName());
+ button->setWhatsThis(info.absoluteFilePath());
if(info.isDir()){
button->setIcon( LXDG::findIcon("folder","") );
}else if(LUtils::imageExtensions().contains(info.suffix().toLower()) ){
@@ -88,6 +83,13 @@ void AppLauncherPlugin::loadButton(){
}
//qDebug() << " - Setting Button Text:" << txt;
button->setText(txt);
+ //Now setup the menu again
+ menu->clear();
+ menu->addAction(LXDG::findIcon("zoom-in",""), tr("Increase Size"), this, SLOT(increaseIconSize()));
+ menu->addAction(LXDG::findIcon("zoom-out",""), tr("Decrease Size"), this, SLOT(decreaseIconSize()));
+ if( !button->whatsThis().isEmpty() && button->whatsThis().startsWith(QDir::homePath()+"/Desktop") ){
+ menu->addAction(LXDG::findIcon("list-remove",""), tr("Delete File"), this, SLOT(deleteFile()) );
+ }
button->setFixedSize(icosize+4, icosize+8+(2*button->fontMetrics().height()) ); //make sure to adjust the button on first show.
this->setInitialSize(button->width()+4, button->height()+4);
@@ -125,6 +127,7 @@ void AppLauncherPlugin::increaseIconSize(){
icosize += 16;
button->setIconSize(QSize(icosize,icosize));
this->saveSetting("iconsize",icosize);
+
}
void AppLauncherPlugin::decreaseIconSize(){
bgstack15