summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Heinecke <[email protected]>2018-03-07 10:10:55 +0100
committerAndre Heinecke <[email protected]>2018-03-07 10:10:55 +0100
commit61090a7d97bb852170ba31ed0b8364e5aabf7f19 (patch)
treeee1de29c69fa6514a7eb561085c1d10860e2d691
parent3b10124a76c100013dc174a25447c972bf538f02 (diff)
Improve padwidget layout
Set style hint for monospace font to get a good font on windows. Resize to sizeHint when activating the padwidget.
-rw-r--r--src/mainwindow.cpp1
-rw-r--r--src/view/padwidget.cpp3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index f48be8e..50be4d1 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -274,6 +274,7 @@ public:
ui.stackWidget->addWidget(ui.padWidget);
}
ui.stackWidget->setCurrentWidget(ui.padWidget);
+ ui.stackWidget->resize(ui.padWidget->sizeHint());
}
private:
diff --git a/src/view/padwidget.cpp b/src/view/padwidget.cpp
index fe059ba..35f4433 100644
--- a/src/view/padwidget.cpp
+++ b/src/view/padwidget.cpp
@@ -151,7 +151,8 @@ public:
mEdit->setPlaceholderText("Enter a message to encrypt or decrypt...");
auto fixedFont = QFont("Monospace", 10);
- // This does not work well:
+ fixedFont.setStyleHint(QFont::TypeWriter);
+ // This does not work well
// QFontDatabase::systemFont(QFontDatabase::FixedFont);
mEdit->setCurrentFont(fixedFont);