aboutsummaryrefslogtreecommitdiff
path: root/mainwindow.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2016-07-08 22:31:59 +0200
committerJavier <dev.git@javispedro.com>2016-07-08 22:31:59 +0200
commitea34246e769c30f5257d37ad53bb5defc04bb00b (patch)
tree308c81edf37628843b8143742a91f465f9111bd1 /mainwindow.cc
parentd334906cdb5ad988c9e3ad1e9827eab774d1a283 (diff)
downloadscribiu-ea34246e769c30f5257d37ad53bb5defc04bb00b.tar.gz
scribiu-ea34246e769c30f5257d37ad53bb5defc04bb00b.zip
useless dpi workaround for now
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);