1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Some more Export dialogs polishing

This commit is contained in:
Martin Tůma 2020-10-07 08:57:24 +02:00
parent 454e725587
commit 69384ca315
2 changed files with 12 additions and 5 deletions

View File

@ -12,7 +12,8 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent)
{
QFontMetrics fm(QApplication::font());
_edit = new QLineEdit();
_edit->setMinimumWidth(fm.boundingRect(QDir::homePath()).width());
_edit->setMinimumWidth(fm.averageCharWidth() * (QDir::homePath().length()
+ 12));
#ifdef Q_OS_WIN32
_button = new QPushButton("...");
_button->setMaximumWidth(_button->sizeHint().width() / 2);

View File

@ -10,12 +10,10 @@ MarginsWidget::MarginsWidget(QWidget *parent) : QWidget(parent)
_left = new QSpinBox();
_right = new QSpinBox();
#ifdef Q_OS_WIN32
_top->setMaximumWidth(_top->sizeHint().width());
_bottom->setMaximumWidth(_bottom->sizeHint().width());
_left->setMaximumWidth(_left->sizeHint().width());
_right->setMaximumWidth(_right->sizeHint().width());
#endif // W_OS_WIN32
QGridLayout *layout = new QGridLayout();
layout->addWidget(_top, 0, 0, 1, 2, Qt::AlignCenter);
@ -41,6 +39,11 @@ void MarginsWidget::setUnits(const QString &units)
_bottom->setSuffix(UNIT_SPACE + units);
_left->setSuffix(UNIT_SPACE + units);
_right->setSuffix(UNIT_SPACE + units);
_top->setMaximumWidth(_top->sizeHint().width());
_bottom->setMaximumWidth(_bottom->sizeHint().width());
_left->setMaximumWidth(_left->sizeHint().width());
_right->setMaximumWidth(_right->sizeHint().width());
}
QMargins MarginsWidget::value() const
@ -57,12 +60,10 @@ MarginsFWidget::MarginsFWidget(QWidget *parent) : QWidget(parent)
_left = new QDoubleSpinBox();
_right = new QDoubleSpinBox();
#ifdef Q_OS_WIN32
_top->setMaximumWidth(_top->sizeHint().width());
_bottom->setMaximumWidth(_bottom->sizeHint().width());
_left->setMaximumWidth(_left->sizeHint().width());
_right->setMaximumWidth(_right->sizeHint().width());
#endif // Q_OS_WIN32
QGridLayout *layout = new QGridLayout();
layout->addWidget(_top, 0, 0, 1, 2, Qt::AlignCenter);
@ -88,6 +89,11 @@ void MarginsFWidget::setUnits(const QString &units)
_bottom->setSuffix(UNIT_SPACE + units);
_left->setSuffix(UNIT_SPACE + units);
_right->setSuffix(UNIT_SPACE + units);
_top->setMaximumWidth(_top->sizeHint().width());
_bottom->setMaximumWidth(_bottom->sizeHint().width());
_left->setMaximumWidth(_left->sizeHint().width());
_right->setMaximumWidth(_right->sizeHint().width());
}
void MarginsFWidget::setSingleStep(qreal step)