r21868 by jghali - #14720: Text filter dialog unusable
scribus-commit
scribus-commit at lists.scribus.net
Wed Apr 5 21:15:36 UTC 2017
Author: jghali
Date: Wed Apr 5 21:15:35 2017
New Revision: 21868
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21868
Log:
#14720: Text filter dialog unusable
Modified:
trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp
trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.h
trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp
trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.h
Modified: trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21868&path=/trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.cpp Wed Apr 5 21:15:35 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: trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21868&path=/trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.h
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.h (original)
+++ trunk/Scribus/scribus/plugins/gettext/textfilter/tfdia.h Wed Apr 5 21:15:35 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: trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21868&path=/trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.cpp Wed Apr 5 21:15:35 2017
@@ -6,16 +6,18 @@
*/
#include "tffilter.h"
+#include <QBoxLayout>
+#include <QCheckBox>
+#include <QComboBox>
+#include <QFrame>
+#include <QGridLayout>
#include <QHBoxLayout>
-#include <QFrame>
+#include <QLabel>
#include <QPixmap>
-#include <QLabel>
-#include <QVBoxLayout>
-#include <QBoxLayout>
-#include <QComboBox>
#include <QPushButton>
#include <QToolTip>
-#include <QCheckBox>
+#include <QVBoxLayout>
+
#include "scribusapi.h"
#include "scribuscore.h"
#include "scribusdoc.h"
@@ -105,14 +107,13 @@
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->addWidget(enableCheck, 0, Qt::AlignTop);
actionFrame = new QFrame(this);
- layout->addWidget(actionFrame);
+ layout->addWidget(actionFrame, 0, Qt::AlignTop);
QBoxLayout* layout2 = new QVBoxLayout(actionFrame);
layout2->setMargin(0);
@@ -137,12 +138,12 @@
removeButton->setToolTip( tr("Remove this filter row"));
removeButton->setMaximumSize(QSize(25,25));
removeButton->setMinimumSize(QSize(25,25));
- layout->addWidget(removeButton);
+ layout->addWidget(removeButton, 0, Qt::AlignTop);
addButton = new QPushButton(IconManager::instance()->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->addWidget(addButton, 0, Qt::AlignTop);
connect(enableCheck, SIGNAL(toggled(bool)), this, SLOT(enableToggled(bool)));
connect(addButton, SIGNAL(clicked()), this, SLOT(addClick()));
@@ -173,6 +174,7 @@
{
currentAction = index;
getSecondCombo();
+ emit actionChanged(this);
}
void tfFilter::secondChanged(int)
Modified: trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21868&path=/trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.h
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.h (original)
+++ trunk/Scribus/scribus/plugins/gettext/textfilter/tffilter.h Wed Apr 5 21:15:35 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