diff --git a/sagasu/src/filetreewindow.cpp b/sagasu/src/filetreewindow.cpp index 087772f..6d15092 100644 --- a/sagasu/src/filetreewindow.cpp +++ b/sagasu/src/filetreewindow.cpp @@ -16,29 +16,32 @@ FileTreeWindow::FileTreeWindow(HashDatabase &database, const QString &gamePath, { auto layout = new QVBoxLayout(); layout->setContentsMargins(0, 0, 0, 0); + layout->setSpacing(0); setLayout(layout); m_searchModel = new QSortFilterProxyModel(); m_searchModel->setRecursiveFilteringEnabled(true); m_searchModel->setFilterCaseSensitivity(Qt::CaseSensitivity::CaseInsensitive); - auto searchLayout = new QHBoxLayout(); - layout->addLayout(searchLayout); + /*auto searchLayout = new QHBoxLayout(); + layout->addLayout(searchLayout);*/ auto searchEdit = new QLineEdit(); searchEdit->setPlaceholderText(QStringLiteral("Search...")); searchEdit->setClearButtonEnabled(true); + searchEdit->setProperty("_breeze_borders_sides", QVariant::fromValue(QFlags{Qt::BottomEdge})); connect(searchEdit, &QLineEdit::textChanged, this, [this](const QString &text) { m_searchModel->setFilterRegularExpression(text); }); - searchLayout->addWidget(searchEdit); + layout->addWidget(searchEdit); - m_unknownCheckbox = new QCheckBox(); + // TODO Restore as an action, later. it's currently pretty useless as-is as it's a "please slow down and crash" checkbox + /*m_unknownCheckbox = new QCheckBox(); m_unknownCheckbox->setToolTip(QStringLiteral("Show unknown files and folders.")); connect(m_unknownCheckbox, &QCheckBox::clicked, this, [this] { refreshModel(); }); - searchLayout->addWidget(m_unknownCheckbox); + searchLayout->addWidget(m_unknownCheckbox);*/ auto treeWidget = new QTreeView(); treeWidget->setModel(m_searchModel); @@ -76,7 +79,7 @@ FileTreeWindow::FileTreeWindow(HashDatabase &database, const QString &gamePath, void FileTreeWindow::refreshModel() { // TODO: this should really be handled by the proxy - m_fileModel = new FileTreeModel(m_database, m_unknownCheckbox->isChecked(), m_gamePath, data); + m_fileModel = new FileTreeModel(m_database, false, m_gamePath, data); m_searchModel->setSourceModel(m_fileModel); } diff --git a/sagasu/src/mainwindow.cpp b/sagasu/src/mainwindow.cpp index 98d8eab..3c33c9f 100644 --- a/sagasu/src/mainwindow.cpp +++ b/sagasu/src/mainwindow.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "cmppart.h" @@ -30,15 +31,14 @@ MainWindow::MainWindow(const QString &gamePath, GameData *data) , fileCache(*data) { setupMenubar(); + setMinimumSize(1280, 720); m_mgr = new QNetworkAccessManager(this); - auto dummyWidget = new QWidget(); + auto dummyWidget = new QSplitter(); + dummyWidget->setChildrenCollapsible(false); setCentralWidget(dummyWidget); - auto layout = new QHBoxLayout(); - dummyWidget->setLayout(layout); - m_tree = new FileTreeWindow(m_database, gamePath, data); connect(m_tree, &FileTreeWindow::extractFile, this, [this, data](const QString &path) { const QFileInfo info(path); @@ -58,13 +58,13 @@ MainWindow::MainWindow(const QString &gamePath, GameData *data) connect(m_tree, &FileTreeWindow::pathSelected, this, [this](const QString &path) { refreshParts(path); }); - m_tree->setMaximumWidth(200); - layout->addWidget(m_tree); + m_tree->setMaximumWidth(300); + dummyWidget->addWidget(m_tree); partHolder = new QTabWidget(); - partHolder->setMinimumWidth(800); + partHolder->setDocumentMode(true); // hide borders partHolder->setMinimumHeight(720); - layout->addWidget(partHolder); + dummyWidget->addWidget(partHolder); refreshParts({}); } @@ -120,6 +120,8 @@ void MainWindow::refreshParts(const QString &path) auto propertiesWidget = new FilePropertiesWindow(path, file); partHolder->addTab(propertiesWidget, QStringLiteral("Properties")); + + partHolder->tabBar()->setExpanding(true); } void MainWindow::setupFileMenu(QMenu *menu)