[rkward] /: Minor simplification

Thomas Friedrichsmeier null at kde.org
Wed May 16 08:41:18 UTC 2018


Git commit 7dd0b9657d9085e51e7acbdf888fa257fe489ee1 by Thomas Friedrichsmeier.
Committed on 16/05/2018 at 08:39.
Pushed by tfry into branch 'master'.

Minor simplification

M  +1    -0    ChangeLog
M  +9    -8    rkward/plugin/rkpluginframe.cpp
M  +2    -3    rkward/plugin/rkpluginframe.h

https://commits.kde.org/rkward/7dd0b9657d9085e51e7acbdf888fa257fe489ee1

diff --git a/ChangeLog b/ChangeLog
index db45b39e..4edb8347 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,5 @@
 --- Version 0.7.1 - UNRELEASED
+- Remove a bit of unused empty space around the main area of plugin dialogs
 - Expand root level objects (esp. data.frames) by default in plugin object lists. Add button to toggle back to collapsed.
 - Allow Tab-key to advance to the next row of data in data editor
 - Fix highlighting of "trailing" rows and columns in data editor
diff --git a/rkward/plugin/rkpluginframe.cpp b/rkward/plugin/rkpluginframe.cpp
index f5cd135d..e2873e8b 100644
--- a/rkward/plugin/rkpluginframe.cpp
+++ b/rkward/plugin/rkpluginframe.cpp
@@ -2,7 +2,7 @@
                           rkpluginframe.cpp  -  description
                              -------------------
     begin                : Sat Jun 4 2011
-    copyright            : (C) 2011, 2012 by Thomas Friedrichsmeier
+    copyright            : (C) 2011-2018 by Thomas Friedrichsmeier
     email                : thomas.friedrichsmeier at kdemail.net
  ***************************************************************************/
 
@@ -31,14 +31,11 @@ RKPluginFrame::RKPluginFrame (const QDomElement &element, RKComponent *parent_co
 
 	QVBoxLayout *layout = new QVBoxLayout (this);
 	layout->setContentsMargins (0, 0, 0, 0);
-	frame = new QGroupBox (xml->i18nStringAttribute (element, "label", QString(), DL_INFO), this);
+	frame = new QGroupBox (xml->i18nStringAttribute (element, "label", QString(), DL_INFO));
 	layout->addWidget (frame);
-	layout = new QVBoxLayout (frame);
-	page = new QWidget (frame);
-	QVBoxLayout *pagelayout = new QVBoxLayout (page);
-	pagelayout->setContentsMargins (0, 0, 0, 0);
-	pagelayout->setSpacing (RKGlobals::spacingHint ());
-	layout->addWidget (page);
+
+	QVBoxLayout *inner = new QVBoxLayout (frame);
+	inner->setSpacing (RKGlobals::spacingHint ());
 
 	checked = 0;
 	if (xml->getBoolAttribute (element, "checkable", false, DL_INFO)) {
@@ -65,6 +62,10 @@ void RKPluginFrame::initCheckedProperty () {
 	connect (checked, &RKComponentPropertyBase::valueChanged, this, &RKPluginFrame::propertyChanged);
 }
 
+QWidget* RKPluginFrame::getPage () {
+	return frame;
+}
+
 RKComponentBase* RKPluginFrame::lookupComponent (const QString& identifier, QString* remainder) {
 	if ((!checked) && (identifier == "checked")) initCheckedProperty ();
 	return RKComponentBase::lookupComponent(identifier, remainder);
diff --git a/rkward/plugin/rkpluginframe.h b/rkward/plugin/rkpluginframe.h
index f4f4a4fc..f9d45fb4 100644
--- a/rkward/plugin/rkpluginframe.h
+++ b/rkward/plugin/rkpluginframe.h
@@ -2,7 +2,7 @@
                           rkpluginframe.cpp  -  description
                              -------------------
     begin                : Sat Jun 4 2011
-    copyright            : (C) 2011, 2012 by Thomas Friedrichsmeier
+    copyright            : (C) 2011-2018 by Thomas Friedrichsmeier
     email                : thomas.friedrichsmeier at kdemail.net
  ***************************************************************************/
 
@@ -35,7 +35,7 @@ public:
 	~RKPluginFrame ();
 
 /** returns the page child elements should be drawn in */
-	QWidget *getPage () { return page; };
+	QWidget *getPage ();
 	int type () { return ComponentFrame; };
 /** reimplemented to return the value of the checked property by default */
 	QVariant value (const QString &modifier=QString ());
@@ -49,7 +49,6 @@ private slots:
 private:
 	void initCheckedProperty ();
 	RKComponentPropertyBool *checked;
-	QWidget *page;
 	QGroupBox *frame;
 };
 



More information about the rkward-tracker mailing list