mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-24 04:57:45 +00:00
armoury: Improve styling on Breeze, add frame around gear view
This commit is contained in:
parent
0045b89a55
commit
537a8f57e5
5 changed files with 15 additions and 11 deletions
|
@ -6,7 +6,7 @@
|
|||
#include "filecache.h"
|
||||
#include "mdlpart.h"
|
||||
#include <QComboBox>
|
||||
#include <QWidget>
|
||||
#include <QFrame>
|
||||
#include <physis.hpp>
|
||||
|
||||
struct ModelInfo {
|
||||
|
@ -32,7 +32,7 @@ inline bool operator==(const GearInfo &a, const GearInfo &b)
|
|||
|
||||
struct GameData;
|
||||
|
||||
class GearView : public QWidget
|
||||
class GearView : public QFrame
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@ GearListWidget::GearListWidget(GameData *data, QWidget *parent)
|
|||
{
|
||||
auto layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
setLayout(layout);
|
||||
|
||||
auto searchModel = new QSortFilterProxyModel();
|
||||
|
@ -25,6 +26,7 @@ GearListWidget::GearListWidget(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);
|
||||
});
|
||||
|
|
|
@ -12,12 +12,14 @@
|
|||
#include "magic_enum.hpp"
|
||||
|
||||
GearView::GearView(GameData *data, FileCache &cache, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
: QFrame(parent)
|
||||
, data(data)
|
||||
, cache(cache)
|
||||
{
|
||||
mdlPart = new MDLPart(data, cache);
|
||||
setFrameShape(QFrame::Shape::Panel);
|
||||
setFrameShadow(QFrame::Shadow::Sunken);
|
||||
|
||||
mdlPart = new MDLPart(data, cache);
|
||||
reloadRaceDeforms();
|
||||
|
||||
auto layout = new QVBoxLayout();
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include <QDesktopServices>
|
||||
#include <QFileDialog>
|
||||
#include <QMenuBar>
|
||||
#include <QSplitter>
|
||||
#include <magic_enum.hpp>
|
||||
|
||||
#include "cmpeditor.h"
|
||||
|
@ -30,18 +31,15 @@ MainWindow::MainWindow(GameData *in_data)
|
|||
setMinimumSize(QSize(800, 600));
|
||||
setupMenubar();
|
||||
|
||||
auto dummyWidget = new QWidget();
|
||||
auto dummyWidget = new QSplitter();
|
||||
setCentralWidget(dummyWidget);
|
||||
|
||||
auto layout = new QHBoxLayout();
|
||||
dummyWidget->setLayout(layout);
|
||||
|
||||
auto gearListWidget = new GearListWidget(&data);
|
||||
gearListWidget->setMaximumWidth(350);
|
||||
connect(gearListWidget, &GearListWidget::gearSelected, this, [this](const GearInfo &gear) {
|
||||
gearView->setGear(gear);
|
||||
});
|
||||
layout->addWidget(gearListWidget);
|
||||
dummyWidget->addWidget(gearListWidget);
|
||||
|
||||
gearView = new SingleGearView(&data, cache);
|
||||
connect(gearView, &SingleGearView::addToFullModelViewer, this, [this](GearInfo &info) {
|
||||
|
@ -51,7 +49,9 @@ MainWindow::MainWindow(GameData *in_data)
|
|||
|
||||
auto tabWidget = new QTabWidget();
|
||||
tabWidget->addTab(gearView, QStringLiteral("Models"));
|
||||
layout->addWidget(tabWidget);
|
||||
tabWidget->setDocumentMode(true); // Don't draw the borders
|
||||
tabWidget->tabBar()->setExpanding(true);
|
||||
dummyWidget->addWidget(tabWidget);
|
||||
|
||||
fullModelViewer = new FullModelViewer(&data, cache);
|
||||
connect(fullModelViewer, &FullModelViewer::loadingChanged, this, [this](const bool loading) {
|
||||
|
|
|
@ -29,7 +29,7 @@ SingleGearView::SingleGearView(GameData *data, FileCache &cache, QWidget *parent
|
|||
gearView->setFace(-1);
|
||||
|
||||
auto layout = new QVBoxLayout();
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
// layout->setContentsMargins(0, 0, 0, 0);
|
||||
setLayout(layout);
|
||||
|
||||
auto mdlPathEdit = new QLineEdit();
|
||||
|
|
Loading…
Add table
Reference in a new issue