aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/desktop-plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lumina-desktop/desktop-plugins')
-rw-r--r--lumina-desktop/desktop-plugins/LDPlugin.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/lumina-desktop/desktop-plugins/LDPlugin.h b/lumina-desktop/desktop-plugins/LDPlugin.h
index 9660a85c..38cfa433 100644
--- a/lumina-desktop/desktop-plugins/LDPlugin.h
+++ b/lumina-desktop/desktop-plugins/LDPlugin.h
@@ -8,7 +8,7 @@
// Simply subclass this when creating a new plugin to enable correct
// visibility and usage within the desktop window
//===========================================
-// WARNING: Do *not* setup a custom context menu for plugins!
+// WARNING: Do *not* setup a custom context menu for the entire plugins area!
// This can prevent access to the general desktop context menu if
// the plugin was maximized to fill the desktop area!
//===========================================
@@ -58,6 +58,27 @@ public:
settings->sync();
}
}
+
+ virtual void scalePlugin(double xscale, double yscale){
+ //This can be re-implemented in the subclassed plugin as necessary
+ // Example: If there are icons in the plugin which should also be re-scaled
+
+ int val = settings->value("location/width",0).toInt();
+ if(val>0){ val = qRound(val*xscale); }
+ settings->setValue("location/width",val);
+
+ val = settings->value("location/height",0).toInt();
+ if(val>0){ val = qRound(val*yscale); }
+ settings->setValue("location/height",val);
+
+ val = settings->value("location/x",0).toInt();
+ if(val>0){ val = qRound(val*xscale); }
+ settings->setValue("location/x",val);
+
+ val = settings->value("location/y",0).toInt();
+ if(val>0){ val = qRound(val*yscale); }
+ settings->setValue("location/y",val);
+ }
public slots:
virtual void LocaleChange(){
@@ -74,4 +95,4 @@ signals:
};
-#endif \ No newline at end of file
+#endif
bgstack15