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 "filecache.h"
|
||||||
#include "mdlpart.h"
|
#include "mdlpart.h"
|
||||||
#include <QComboBox>
|
#include <QComboBox>
|
||||||
#include <QWidget>
|
#include <QFrame>
|
||||||
#include <physis.hpp>
|
#include <physis.hpp>
|
||||||
|
|
||||||
struct ModelInfo {
|
struct ModelInfo {
|
||||||
|
@ -32,7 +32,7 @@ inline bool operator==(const GearInfo &a, const GearInfo &b)
|
||||||
|
|
||||||
struct GameData;
|
struct GameData;
|
||||||
|
|
||||||
class GearView : public QWidget
|
class GearView : public QFrame
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ GearListWidget::GearListWidget(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();
|
||||||
|
@ -25,6 +26,7 @@ GearListWidget::GearListWidget(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);
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,12 +12,14 @@
|
||||||
#include "magic_enum.hpp"
|
#include "magic_enum.hpp"
|
||||||
|
|
||||||
GearView::GearView(GameData *data, FileCache &cache, QWidget *parent)
|
GearView::GearView(GameData *data, FileCache &cache, QWidget *parent)
|
||||||
: QWidget(parent)
|
: QFrame(parent)
|
||||||
, data(data)
|
, data(data)
|
||||||
, cache(cache)
|
, cache(cache)
|
||||||
{
|
{
|
||||||
mdlPart = new MDLPart(data, cache);
|
setFrameShape(QFrame::Shape::Panel);
|
||||||
|
setFrameShadow(QFrame::Shadow::Sunken);
|
||||||
|
|
||||||
|
mdlPart = new MDLPart(data, cache);
|
||||||
reloadRaceDeforms();
|
reloadRaceDeforms();
|
||||||
|
|
||||||
auto layout = new QVBoxLayout();
|
auto layout = new QVBoxLayout();
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
|
#include <QSplitter>
|
||||||
#include <magic_enum.hpp>
|
#include <magic_enum.hpp>
|
||||||
|
|
||||||
#include "cmpeditor.h"
|
#include "cmpeditor.h"
|
||||||
|
@ -30,18 +31,15 @@ MainWindow::MainWindow(GameData *in_data)
|
||||||
setMinimumSize(QSize(800, 600));
|
setMinimumSize(QSize(800, 600));
|
||||||
setupMenubar();
|
setupMenubar();
|
||||||
|
|
||||||
auto dummyWidget = new QWidget();
|
auto dummyWidget = new QSplitter();
|
||||||
setCentralWidget(dummyWidget);
|
setCentralWidget(dummyWidget);
|
||||||
|
|
||||||
auto layout = new QHBoxLayout();
|
|
||||||
dummyWidget->setLayout(layout);
|
|
||||||
|
|
||||||
auto gearListWidget = new GearListWidget(&data);
|
auto gearListWidget = new GearListWidget(&data);
|
||||||
gearListWidget->setMaximumWidth(350);
|
gearListWidget->setMaximumWidth(350);
|
||||||
connect(gearListWidget, &GearListWidget::gearSelected, this, [this](const GearInfo &gear) {
|
connect(gearListWidget, &GearListWidget::gearSelected, this, [this](const GearInfo &gear) {
|
||||||
gearView->setGear(gear);
|
gearView->setGear(gear);
|
||||||
});
|
});
|
||||||
layout->addWidget(gearListWidget);
|
dummyWidget->addWidget(gearListWidget);
|
||||||
|
|
||||||
gearView = new SingleGearView(&data, cache);
|
gearView = new SingleGearView(&data, cache);
|
||||||
connect(gearView, &SingleGearView::addToFullModelViewer, this, [this](GearInfo &info) {
|
connect(gearView, &SingleGearView::addToFullModelViewer, this, [this](GearInfo &info) {
|
||||||
|
@ -51,7 +49,9 @@ MainWindow::MainWindow(GameData *in_data)
|
||||||
|
|
||||||
auto tabWidget = new QTabWidget();
|
auto tabWidget = new QTabWidget();
|
||||||
tabWidget->addTab(gearView, QStringLiteral("Models"));
|
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);
|
fullModelViewer = new FullModelViewer(&data, cache);
|
||||||
connect(fullModelViewer, &FullModelViewer::loadingChanged, this, [this](const bool loading) {
|
connect(fullModelViewer, &FullModelViewer::loadingChanged, this, [this](const bool loading) {
|
||||||
|
|
|
@ -29,7 +29,7 @@ SingleGearView::SingleGearView(GameData *data, FileCache &cache, QWidget *parent
|
||||||
gearView->setFace(-1);
|
gearView->setFace(-1);
|
||||||
|
|
||||||
auto layout = new QVBoxLayout();
|
auto layout = new QVBoxLayout();
|
||||||
layout->setContentsMargins(0, 0, 0, 0);
|
// layout->setContentsMargins(0, 0, 0, 0);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
|
||||||
auto mdlPathEdit = new QLineEdit();
|
auto mdlPathEdit = new QLineEdit();
|
||||||
|
|
Loading…
Add table
Reference in a new issue