r21867 by jghali - #14720: Text filter dialog unusable

scribus-commit scribus-commit at lists.scribus.net
Wed Apr 5 21:15:00 UTC 2017


Author: jghali
Date: Wed Apr  5 21:15:00 2017
New Revision: 21867

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21867
Log:
#14720: Text filter dialog unusable

Modified:
    branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp
    branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.h
    branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp
    branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.h

Modified: branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21867&path=/branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp	(original)
+++ branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp	Wed Apr  5 21:15:00 2017
@@ -189,6 +189,7 @@
 	else if (filters.size() == 1)
 		filters[0]->setRemovable(false);
 
+	connect(tmp, SIGNAL(actionChanged(tfFilter*)), this, SLOT(adjustVBoxSize()));
 	connect(tmp, SIGNAL(addClicked(tfFilter*)), this, SLOT(createFilterRow(tfFilter*)));
 	connect(tmp, SIGNAL(removeClicked(tfFilter*)), SLOT(removeRow(tfFilter*)));
 }
@@ -218,6 +219,7 @@
 			vbox->adjustSize();
 			if (filters.size() == 2)
 				filters[0]->setRemovable(true);
+			connect(tmp, SIGNAL(actionChanged(tfFilter*)), this, SLOT(adjustVBoxSize()));
 			connect(tmp, SIGNAL(addClicked(tfFilter*)), this, SLOT(createFilterRow(tfFilter*)));
 			connect(tmp, SIGNAL(removeClicked(tfFilter*)), this, SLOT(removeRow(tfFilter*)));
 		}
@@ -240,8 +242,14 @@
 			++it;
 		}
 	}
+	vbox->adjustSize();
 	if (filters.size() == 1)
 		filters[0]->setRemovable(false);
+}
+
+void tfDia::adjustVBoxSize()
+{
+	vbox->adjustSize();
 }
 
 void tfDia::saveTextChanged(const QString& text)

Modified: branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21867&path=/branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.h
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.h	(original)
+++ branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tfdia.h	Wed Apr  5 21:15:00 2017
@@ -44,6 +44,7 @@
 	void writeFilterRow(PrefsTable* table, int row, tfFilter* filter);
 	void storeLastFilter();
 private slots:
+	void adjustVBoxSize();
 	void saveTextChanged(const QString& text);
 	void createFilterRow(tfFilter* after);
 	void removeRow(tfFilter* tff);

Modified: branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21867&path=/branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp	(original)
+++ branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp	Wed Apr  5 21:15:00 2017
@@ -6,16 +6,17 @@
 */
 #include "tffilter.h"
 
+#include <QBoxLayout>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QFrame>
 #include <QHBoxLayout>
-#include <QFrame>
+#include <QLabel>
 #include <QPixmap>
-#include <QLabel>
+#include <QPushButton>
 #include <QVBoxLayout>
-#include <QBoxLayout>
-#include <QComboBox>
-#include <QPushButton>
 #include <QToolTip>
-#include <QCheckBox>
+
 #include "scribusapi.h"
 #include "scribuscore.h"
 #include "prefsmanager.h"
@@ -104,14 +105,15 @@
 	layout->setSpacing(0);
 
 	enableCheck = new QCheckBox(this);
-	enableCheck->setMaximumSize(QSize(25,25));
 	enableCheck->setMinimumSize(QSize(25,25));
 	enableCheck->setChecked(true);
 	enableCheck->setToolTip( tr("Disable or enable this filter row"));
 	layout->addWidget(enableCheck);
+	layout->setAlignment(enableCheck, Qt::AlignTop);
 
 	actionFrame = new QFrame(this);
 	layout->addWidget(actionFrame);
+	layout->setAlignment(actionFrame, Qt::AlignTop);
 
 	QBoxLayout* layout2 = new QVBoxLayout(actionFrame);
 	layout2->setMargin(0);
@@ -137,11 +139,13 @@
 	removeButton->setMaximumSize(QSize(25,25));
 	removeButton->setMinimumSize(QSize(25,25));
 	layout->addWidget(removeButton);
+	layout->setAlignment(removeButton, Qt::AlignTop);
 	addButton = new QPushButton(loadIcon("22/list-add.png"), 0, this);
 	addButton->setToolTip( tr("Add a new filter row"));
 	addButton->setMaximumSize(QSize(25,25));
 	addButton->setMinimumSize(QSize(25,25));
 	layout->addWidget(addButton);
+	layout->setAlignment(addButton, Qt::AlignTop);
 
 	connect(enableCheck, SIGNAL(toggled(bool)), this, SLOT(enableToggled(bool)));
 	connect(addButton, SIGNAL(clicked()), this, SLOT(addClick()));
@@ -172,6 +176,7 @@
 {
 	currentAction = index;
 	getSecondCombo();
+	emit actionChanged(this);
 }
 
 void tfFilter::secondChanged(int)

Modified: branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21867&path=/branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.h
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.h	(original)
+++ branches/Version14x/Scribus/scribus/plugins/gettext/textfilter/tffilter.h	Wed Apr  5 21:15:00 2017
@@ -90,6 +90,7 @@
 	bool isEnabled();
 	bool isRegExp();
 signals:
+	void actionChanged(tfFilter* tff);
 	void removeClicked(tfFilter* tff);
 	void addClicked(tfFilter* tff);
 private slots:




More information about the scribus-commit mailing list