mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-23 12:37:45 +00:00
mapeditor: Use splitter, improve margins everywhere
This commit is contained in:
parent
9b39c7b121
commit
6d026cf522
2 changed files with 6 additions and 6 deletions
|
@ -8,6 +8,7 @@
|
|||
#include <QHBoxLayout>
|
||||
#include <QListWidget>
|
||||
#include <QMenuBar>
|
||||
#include <QSplitter>
|
||||
#include <QUrl>
|
||||
#include <physis.hpp>
|
||||
|
||||
|
@ -22,18 +23,15 @@ MainWindow::MainWindow(GameData *data)
|
|||
setMinimumSize(1280, 720);
|
||||
setupMenubar();
|
||||
|
||||
auto dummyWidget = new QWidget();
|
||||
auto dummyWidget = new QSplitter();
|
||||
setCentralWidget(dummyWidget);
|
||||
|
||||
auto layout = new QHBoxLayout();
|
||||
dummyWidget->setLayout(layout);
|
||||
|
||||
auto listWidget = new MapListWidget(data);
|
||||
listWidget->setMaximumWidth(400);
|
||||
layout->addWidget(listWidget);
|
||||
dummyWidget->addWidget(listWidget);
|
||||
|
||||
auto mapView = new MapView(data, cache);
|
||||
layout->addWidget(mapView);
|
||||
dummyWidget->addWidget(mapView);
|
||||
|
||||
connect(listWidget, &MapListWidget::mapSelected, this, [data, mapView](const QString &basePath) {
|
||||
QString base2Path = basePath.left(basePath.lastIndexOf(QStringLiteral("/level/")));
|
||||
|
|
|
@ -14,6 +14,7 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
|
|||
{
|
||||
auto layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
setLayout(layout);
|
||||
|
||||
auto searchModel = new QSortFilterProxyModel();
|
||||
|
@ -23,6 +24,7 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
|
|||
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, [=](const QString &text) {
|
||||
searchModel->setFilterRegularExpression(text);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue