aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.org>2017-03-02 14:46:17 +0000
committerWeblate <noreply@weblate.org>2017-03-02 14:46:17 +0000
commitebd64e4518e6aecf1254887c918de3b036b0f283 (patch)
treee9689cd7f0b76f3d8271a2e86372bac825cbbaf8 /src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
parentTranslated using Weblate (lumina_DESKTOP@lt (generated)) (diff)
parentMerge branch 'master' of github.com:trueos/lumina (diff)
downloadlumina-ebd64e4518e6aecf1254887c918de3b036b0f283.tar.gz
lumina-ebd64e4518e6aecf1254887c918de3b036b0f283.tar.bz2
lumina-ebd64e4518e6aecf1254887c918de3b036b0f283.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp')
-rw-r--r--src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp32
1 files changed, 18 insertions, 14 deletions
diff --git a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
index 545ba430..efae7b24 100644
--- a/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
+++ b/src-qt5/core/lumina-desktop/desktop-plugins/LDPlugin.cpp
@@ -16,6 +16,7 @@ LDPlugin::LDPlugin(QWidget *parent, QString id) : QFrame(parent){
settings = LSession::handle()->DesktopPluginSettings();
//Setup the plugin system control menu
menu = new QMenu(this);
+ contextM = 0;
setupMenu();
//Setup the internal timer for when to start/stop drag events
dragTimer = new QTimer(this);
@@ -33,11 +34,13 @@ LDPlugin::LDPlugin(QWidget *parent, QString id) : QFrame(parent){
void LDPlugin::setupMenu(){
menu->clear();
+ menu->setTitle(tr("Modify Item"));
+ menu->setIcon(LXDG::findIcon("preferences-desktop-icons","") );
//SPECIAL CONTEXT MENU OPTIONS FOR PARTICULAR PLUGIN TYPES
- if(PLUGID.startsWith("applauncher::")){
+ /*if(PLUGID.startsWith("applauncher::")){
menu->addAction( LXDG::findIcon("quickopen",""), tr("Launch Item"), this, SIGNAL(PluginActivated()) );
menu->addSeparator();
- }
+ }*/
//General Options
menu->addAction( LXDG::findIcon("transform-move",""), tr("Start Moving Item"), this, SLOT(slotStartMove()) );
menu->addAction( LXDG::findIcon("transform-scale",""), tr("Start Resizing Item"), this, SLOT(slotStartResize()) );
@@ -48,16 +51,17 @@ void LDPlugin::setupMenu(){
menu->addAction( LXDG::findIcon("edit-delete",""), tr("Remove Item"), this, SLOT(slotRemovePlugin()) );
}
-/*void LDPlugin::setInitialSize(int width, int height){
- //Note: Only run this in the plugin initization routine:
- // if the plugin is completely new (first time used), it will be this size
- if(settings->allKeys().filter(prefix+"location").isEmpty()){
- //Brand new plugin: set initial size
- //qDebug() << "Setting Initial Size:" << PLUGID << width << height;
- settings->setValue(prefix+"location/width",width);
- settings->setValue(prefix+"location/height",height);
- settings->sync();
+void LDPlugin::showPluginMenu(){
+ emit CloseDesktopMenu();
+ //Double check which menu should be shown
+ if(this->contextMenu()!=0){
+ //Got a special context menu for this plugin - need to layer them together
+ if(!this->contextMenu()->actions().contains(menu->menuAction())){
+ this->contextMenu()->addSeparator();
+ this->contextMenu()->addMenu(menu);
}
- //Now make sure the plugin is the saved size right away
- this->resize( settings->value(prefix+"location/width").toInt(), settings->value(prefix+"location/height").toInt());
-}*/
+ this->contextMenu()->popup( QCursor::pos() );
+ }else{
+ menu->popup( QCursor::pos() );
+ }
+}
bgstack15