diff options
author | Chris Xiong <chirs241097@gmail.com> | 2022-09-12 13:16:57 -0400 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2022-09-12 13:16:57 -0400 |
commit | e93e4ed25011c1e1abaf3049e90e4c2a2c6184ec (patch) | |
tree | 3b44c96b31768586157559af7f50588355255e46 | |
parent | af5ff1296572ff55e86a5867b9e841014871123b (diff) | |
download | deduper-e93e4ed25011c1e1abaf3049e90e4c2a2c6184ec.tar.xz |
Even more mingui adjustments.
Image list is no longer collapsible.
Set min size for image list.
Main window is now a real QMainWindow.
-rw-r--r-- | mingui/mingui.cpp | 10 | ||||
-rw-r--r-- | mingui/mingui.hpp | 4 |
2 files changed, 9 insertions, 5 deletions
diff --git a/mingui/mingui.cpp b/mingui/mingui.cpp index 8a9fa57..494745a 100644 --- a/mingui/mingui.cpp +++ b/mingui/mingui.cpp @@ -53,15 +53,15 @@ MinGuiWidget::MinGuiWidget() this->setFont(QFontDatabase::systemFont(QFontDatabase::SystemFont::FixedFont)); this->setWindowTitle("deduper minigui"); this->setLayout(new QVBoxLayout(this)); - sb = new QStatusBar(this); + sb = this->statusBar(); sb->addPermanentWidget(permamsg = new QLabel()); QLabel *opm = new QLabel(); opm->setText("placeholder status bar text"); sb->addWidget(opm); l = new QSplitter(Qt::Orientation::Horizontal, this); + l->setContentsMargins(6, 6, 6, 6); l->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - this->layout()->addWidget(l); - this->layout()->addWidget(sb); + this->setCentralWidget(l); infopanel = new QTextEdit(this); infopanel->setReadOnly(true); infopanel->setMinimumWidth(80); @@ -78,6 +78,9 @@ MinGuiWidget::MinGuiWidget() lw->setResizeMode(QListView::ResizeMode::Adjust); lw->setVerticalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAsNeeded); lw->setHorizontalScrollBarPolicy(Qt::ScrollBarPolicy::ScrollBarAsNeeded); + lw->setHorizontalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel); + lw->setVerticalScrollMode(QAbstractItemView::ScrollMode::ScrollPerPixel); + lw->setMinimumWidth(240); for (size_t i = 0; i < keys.size(); ++i) { @@ -154,6 +157,7 @@ MinGuiWidget::MinGuiWidget() l->addWidget(infopanel); l->setStretchFactor(0, 3); l->setStretchFactor(1, 1); + l->setCollapsible(0, false); marked.clear(); infopanel->setText("bleh"); infopanel->setSizePolicy(QSizePolicy::Policy::Minimum, QSizePolicy::Policy::Minimum); diff --git a/mingui/mingui.hpp b/mingui/mingui.hpp index f0efda6..f80561b 100644 --- a/mingui/mingui.hpp +++ b/mingui/mingui.hpp @@ -6,7 +6,7 @@ #include <string> #include <unordered_set> -#include <QWidget> +#include <QMainWindow> #include <QList> class QHBoxLayout; @@ -21,7 +21,7 @@ class ImageItemDelegate; namespace fs = std::filesystem; -class MinGuiWidget : public QWidget +class MinGuiWidget : public QMainWindow { Q_OBJECT private: |