aboutsummaryrefslogtreecommitdiff
path: root/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'mainwindow.cc')
-rw-r--r--mainwindow.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/mainwindow.cc b/mainwindow.cc
index 21b98ee..5d513b1 100644
--- a/mainwindow.cc
+++ b/mainwindow.cc
@@ -37,6 +37,21 @@ MainWindow::MainWindow(QWidget *parent) :
_statusLabel(new QLabel)
{
ui->setupUi(this);
+#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0)
+ // Some tricks for DPI support
+ const qreal scale = logicalDpiX() / 96.0;
+ if (scale > 1.1) {
+ ui->notebookTree->header()->setDefaultSectionSize(ui->notebookTree->header()->defaultSectionSize() * scale);
+ ui->notebookTree->setIconSize(QSize(16, 16) * scale);
+ ui->prevButton->setMaximumSize(ui->prevButton->maximumSize() * scale);
+ ui->nextButton->setMaximumSize(ui->nextButton->maximumSize() * scale);
+ ui->exportButton->setMaximumSize(ui->exportButton->maximumSize() * scale);
+ ui->playButton->setMaximumSize(ui->playButton->maximumSize() * scale);
+ ui->pauseButton->setMaximumSize(ui->pauseButton->maximumSize() * scale);
+ ui->playButton->setMaximumSize(ui->prevButton->maximumSize() * scale);
+ ui->pageEdit->setMaximumWidth(ui->pageEdit->maximumWidth() * scale);
+ }
+#endif
ui->notebookTree->setModel(_notebooks);
ui->notebookTree->header()->setResizeMode(0, QHeaderView::Stretch);
ui->notebookTree->header()->setResizeMode(1, QHeaderView::Fixed);