mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-23 20:47: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 <QHBoxLayout>
|
||||||
#include <QListWidget>
|
#include <QListWidget>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
|
#include <QSplitter>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <physis.hpp>
|
#include <physis.hpp>
|
||||||
|
|
||||||
|
@ -22,18 +23,15 @@ MainWindow::MainWindow(GameData *data)
|
||||||
setMinimumSize(1280, 720);
|
setMinimumSize(1280, 720);
|
||||||
setupMenubar();
|
setupMenubar();
|
||||||
|
|
||||||
auto dummyWidget = new QWidget();
|
auto dummyWidget = new QSplitter();
|
||||||
setCentralWidget(dummyWidget);
|
setCentralWidget(dummyWidget);
|
||||||
|
|
||||||
auto layout = new QHBoxLayout();
|
|
||||||
dummyWidget->setLayout(layout);
|
|
||||||
|
|
||||||
auto listWidget = new MapListWidget(data);
|
auto listWidget = new MapListWidget(data);
|
||||||
listWidget->setMaximumWidth(400);
|
listWidget->setMaximumWidth(400);
|
||||||
layout->addWidget(listWidget);
|
dummyWidget->addWidget(listWidget);
|
||||||
|
|
||||||
auto mapView = new MapView(data, cache);
|
auto mapView = new MapView(data, cache);
|
||||||
layout->addWidget(mapView);
|
dummyWidget->addWidget(mapView);
|
||||||
|
|
||||||
connect(listWidget, &MapListWidget::mapSelected, this, [data, mapView](const QString &basePath) {
|
connect(listWidget, &MapListWidget::mapSelected, this, [data, mapView](const QString &basePath) {
|
||||||
QString base2Path = basePath.left(basePath.lastIndexOf(QStringLiteral("/level/")));
|
QString base2Path = basePath.left(basePath.lastIndexOf(QStringLiteral("/level/")));
|
||||||
|
|
|
@ -14,6 +14,7 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
|
||||||
{
|
{
|
||||||
auto layout = new QVBoxLayout();
|
auto layout = new QVBoxLayout();
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
layout->setContentsMargins(0, 0, 0, 0);
|
||||||
|
layout->setSpacing(0);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
auto searchModel = new QSortFilterProxyModel();
|
auto searchModel = new QSortFilterProxyModel();
|
||||||
|
@ -23,6 +24,7 @@ MapListWidget::MapListWidget(GameData *data, QWidget *parent)
|
||||||
auto searchEdit = new QLineEdit();
|
auto searchEdit = new QLineEdit();
|
||||||
searchEdit->setPlaceholderText(QStringLiteral("Search..."));
|
searchEdit->setPlaceholderText(QStringLiteral("Search..."));
|
||||||
searchEdit->setClearButtonEnabled(true);
|
searchEdit->setClearButtonEnabled(true);
|
||||||
|
searchEdit->setProperty("_breeze_borders_sides", QVariant::fromValue(QFlags{Qt::BottomEdge}));
|
||||||
connect(searchEdit, &QLineEdit::textChanged, this, [=](const QString &text) {
|
connect(searchEdit, &QLineEdit::textChanged, this, [=](const QString &text) {
|
||||||
searchModel->setFilterRegularExpression(text);
|
searchModel->setFilterRegularExpression(text);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue