diff --git a/src/exportdialog.cpp b/src/exportdialog.cpp index 53d9c24f..a95c030e 100644 --- a/src/exportdialog.cpp +++ b/src/exportdialog.cpp @@ -74,8 +74,8 @@ ExportDialog::ExportDialog(QPrinter *printer, QWidget *parent) QGridLayout *marginsLayout = new QGridLayout(); marginsLayout->addWidget(_topMargin, 0, 0, 1, 2, Qt::AlignCenter); - marginsLayout->addWidget(_leftMargin, 1, 0, 1, 1, Qt::AlignCenter); - marginsLayout->addWidget(_rightMargin, 1, 1, 1, 1, Qt::AlignCenter); + marginsLayout->addWidget(_leftMargin, 1, 0, 1, 1, Qt::AlignRight); + marginsLayout->addWidget(_rightMargin, 1, 1, 1, 1, Qt::AlignLeft); marginsLayout->addWidget(_bottomMargin, 2, 0, 1, 2, Qt::AlignCenter); #ifndef Q_OS_MAC @@ -116,7 +116,6 @@ ExportDialog::ExportDialog(QPrinter *printer, QWidget *parent) layout->addWidget(outputFileBox); #endif // Q_OS_MAC layout->addWidget(buttonBox); - setLayout(layout); setWindowTitle(tr("Export to PDF")); diff --git a/src/fileselectwidget.cpp b/src/fileselectwidget.cpp index 0df1a6b3..7defa108 100644 --- a/src/fileselectwidget.cpp +++ b/src/fileselectwidget.cpp @@ -1,12 +1,17 @@ #include #include #include +#include +#include +#include #include "fileselectwidget.h" FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent) { + QFontMetrics fm(QApplication::font()); _edit = new QLineEdit(); + _edit->setMinimumWidth(fm.boundingRect(QDir::homePath()).width()); _button = new QPushButton(tr("Browse...")); connect(_button, SIGNAL(clicked()), this, SLOT(browse())); @@ -19,8 +24,9 @@ FileSelectWidget::FileSelectWidget(QWidget *parent) : QWidget(parent) void FileSelectWidget::browse() { + QFileInfo fi(_edit->text()); QString fileName = QFileDialog::getSaveFileName(this, tr("Select file"), - QDir::currentPath(), _filter); + fi.dir().absolutePath(), _filter); if (!fileName.isEmpty()) _edit->setText(fileName);