diff options
author | Andrey Zhdanov <andrjufka@gmail.com> | 2014-04-16 21:25:15 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-04-16 12:17:49 -0700 |
commit | 4bd4c0110815a9c5a9c9c05fbd6bd987573b2904 (patch) | |
tree | f824be6c2a3b1212003f439c0a3532c4e266685d | |
parent | 1b6d4f55df0c9522cec3b56afc022b02dd968fe7 (diff) | |
download | subsurface-4bd4c0110815a9c5a9c9c05fbd6bd987573b2904.tar.gz |
UI adjustments in Print Dialog Window
- move buttons to the bottom of the window
- use QDialogButtonBox that allows to follow platform-dependent button layout
- enlarge window size to not to crop content
- change "Close" button action from "accept" to "reject"
Signed-off-by: Andrey Zhdanov <andrjufka@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/printdialog.cpp | 35 | ||||
-rw-r--r-- | qt-ui/printoptions.ui | 14 |
2 files changed, 26 insertions, 23 deletions
diff --git a/qt-ui/printdialog.cpp b/qt-ui/printdialog.cpp index 8f0d21b8e..331a78dac 100644 --- a/qt-ui/printdialog.cpp +++ b/qt-ui/printdialog.cpp @@ -26,20 +26,7 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f QVBoxLayout *layout = new QVBoxLayout(this); setLayout(layout); - QHBoxLayout *hLayout = new QHBoxLayout(); - layout->addLayout(hLayout); - - QPushButton *previewButton = new QPushButton(tr("&Preview")); - connect(previewButton, SIGNAL(clicked(bool)), this, SLOT(previewClicked())); - hLayout->addWidget(previewButton); - - QPushButton *printButton = new QPushButton(tr("P&rint")); - connect(printButton, SIGNAL(clicked(bool)), this, SLOT(printClicked())); - hLayout->addWidget(printButton); - - QPushButton *closeButton = new QPushButton(tr("&Close")); - connect(closeButton, SIGNAL(clicked(bool)), this, SLOT(accept())); - hLayout->addWidget(closeButton); + layout->addWidget(optionsWidget); progressBar = new QProgressBar(); connect(printLayout, SIGNAL(signalProgress(int)), progressBar, SLOT(setValue(int))); @@ -49,9 +36,25 @@ PrintDialog::PrintDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f progressBar->setTextVisible(false); layout->addWidget(progressBar); - layout->addWidget(optionsWidget); + QHBoxLayout *hLayout = new QHBoxLayout(); + layout->addLayout(hLayout); + + QPushButton *printButton = new QPushButton(tr("P&rint")); + connect(printButton, SIGNAL(clicked(bool)), this, SLOT(printClicked())); + + QPushButton *previewButton = new QPushButton(tr("&Preview")); + connect(previewButton, SIGNAL(clicked(bool)), this, SLOT(previewClicked())); + + QDialogButtonBox *buttonBox = new QDialogButtonBox; + buttonBox->addButton(QDialogButtonBox::Cancel); + buttonBox->addButton(printButton, QDialogButtonBox::AcceptRole); + buttonBox->addButton(previewButton, QDialogButtonBox::ActionRole); + + connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); + + hLayout->addWidget(buttonBox); - setFixedSize(520, 350); + setFixedSize(550, 400); setWindowTitle(tr("Print")); setWindowIcon(QIcon(":subsurface-icon")); } diff --git a/qt-ui/printoptions.ui b/qt-ui/printoptions.ui index 94a400e4b..43f8e6cfd 100644 --- a/qt-ui/printoptions.ui +++ b/qt-ui/printoptions.ui @@ -7,14 +7,14 @@ <x>0</x>
<y>0</y>
<width>511</width>
- <height>453</height>
+ <height>448</height> </rect>
</property>
<widget class="QGroupBox" name="printOptions">
<property name="geometry">
<rect>
<x>10</x>
- <y>80</y>
+ <y>70</y> <width>489</width>
<height>81</height>
</rect>
@@ -67,7 +67,7 @@ <x>10</x>
<y>10</y>
<width>489</width>
- <height>61</height>
+ <height>51</height> </rect>
</property>
<property name="sizePolicy">
@@ -153,9 +153,9 @@ <property name="geometry">
<rect>
<x>10</x>
- <y>170</y>
+ <y>160</y> <width>489</width>
- <height>91</height>
+ <height>81</height> </rect>
</property>
<property name="title">
@@ -210,9 +210,9 @@ <property name="geometry">
<rect>
<x>10</x>
- <y>270</y>
+ <y>250</y> <width>489</width>
- <height>151</height>
+ <height>141</height> </rect>
</property>
<property name="title">
|