Set zoom level in steps. Add icons to some buttons. Adjust dialog box layout accordin...
[dorian] / widgets / dyalog.cpp
index 7fb94ff..427e496 100644 (file)
@@ -22,11 +22,18 @@ Dyalog::Dyalog(QWidget *parent) :
     contentLayout->setMargin(0);
     content->setLayout(contentLayout);
 
-    buttonBox = new QDialogButtonBox(Qt::Vertical, this);
-    QHBoxLayout *horizontalLayout = new QHBoxLayout(this);
-    horizontalLayout->addWidget(scroller);
-    horizontalLayout->addWidget(buttonBox);
-    setLayout(horizontalLayout);
+    QBoxLayout *boxLayout;
+    QRect screenGeometry = QApplication::desktop()->screenGeometry();
+    if (screenGeometry.width() < screenGeometry.height()) {
+        buttonBox = new QDialogButtonBox(Qt::Horizontal, this);
+        boxLayout = new QVBoxLayout(this);
+    } else {
+        buttonBox = new QDialogButtonBox(Qt::Vertical, this);
+        boxLayout = new QHBoxLayout(this);
+    }
+    boxLayout->addWidget(scroller);
+    boxLayout->addWidget(buttonBox);
+    setLayout(boxLayout);
 
     scroller->setWidget(content);
     content->show();