Skip to content

Commit

Permalink
GUI: Style tweaks to match xoreos
Browse files Browse the repository at this point in the history
  • Loading branch information
fdde authored and DrMcCoy committed Dec 29, 2017
1 parent 632bf02 commit 5470b8a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 22 deletions.
4 changes: 2 additions & 2 deletions src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ namespace GUI {

W_OBJECT_IMPL(MainWindow)

MainWindow::MainWindow(QWidget *parent, const char *title, const QSize &size, const char *path)
: QMainWindow(parent) {
MainWindow::MainWindow(QWidget *parent, const char *title, const QSize &size, const char *path) :
QMainWindow(parent) {
_centralWidget = new QWidget(this);
_centralLayout = new QGridLayout(_centralWidget);

Expand Down
3 changes: 1 addition & 2 deletions src/gui/panelpreviewempty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ namespace GUI {

W_OBJECT_IMPL(PanelPreviewEmpty)

PanelPreviewEmpty::PanelPreviewEmpty(QWidget *parent)
: QFrame(parent) {
PanelPreviewEmpty::PanelPreviewEmpty(QWidget *parent) : QFrame(parent) {
QHBoxLayout *layoutTop = new QHBoxLayout(this);
layoutTop->setContentsMargins(0, 0, 0, 0);

Expand Down
3 changes: 1 addition & 2 deletions src/gui/panelpreviewimage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace GUI {

W_OBJECT_IMPL(PanelPreviewImage)

PanelPreviewImage::PanelPreviewImage(QWidget *parent)
: QFrame(parent) {
PanelPreviewImage::PanelPreviewImage(QWidget *parent) : QFrame(parent) {
_zoomFactor = 1.0f;

_mode = Qt::SmoothTransformation;
Expand Down
3 changes: 1 addition & 2 deletions src/gui/panelpreviewsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ namespace GUI {

W_OBJECT_IMPL(PanelPreviewSound)

PanelPreviewSound::PanelPreviewSound(QWidget *parent)
: QFrame(parent) {
PanelPreviewSound::PanelPreviewSound(QWidget *parent) : QFrame(parent) {
QGridLayout *layoutTop = new QGridLayout(this);
QHBoxLayout *layoutLabels = new QHBoxLayout();
QHBoxLayout *layoutButtons = new QHBoxLayout();
Expand Down
3 changes: 1 addition & 2 deletions src/gui/panelresourceinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ namespace GUI {

W_OBJECT_IMPL(PanelResourceInfo)

PanelResourceInfo::PanelResourceInfo(QWidget *parent)
: QFrame(parent) {
PanelResourceInfo::PanelResourceInfo(QWidget *parent) : QFrame(parent) {
QVBoxLayout *layoutTop = new QVBoxLayout(this);
QVBoxLayout *layoutLabels = new QVBoxLayout();
QHBoxLayout *layoutButtons = new QHBoxLayout();
Expand Down
15 changes: 5 additions & 10 deletions src/gui/resourcetree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ namespace GUI {

W_OBJECT_IMPL(ResourceTree)

ResourceTree::ResourceTree(MainWindow *mainWindow, QObject *parent)
: QAbstractItemModel(parent)
, _mainWindow(mainWindow)
, _iconProvider(new QFileIconProvider()) {
ResourceTree::ResourceTree(MainWindow *mainWindow, QObject *parent) : QAbstractItemModel(parent),
_mainWindow(mainWindow), _iconProvider(new QFileIconProvider()) {
_root = new ResourceTreeItem("Filename");
}

Expand Down Expand Up @@ -82,16 +80,14 @@ ResourceTree::~ResourceTree() {
delete _root;
}

ResourceTreeItem *ResourceTree::itemFromIndex(const QModelIndex &index) const
{
ResourceTreeItem *ResourceTree::itemFromIndex(const QModelIndex &index) const {
if (!index.isValid())
return _root;

return static_cast<ResourceTreeItem*>(index.internalPointer());
}

QModelIndex ResourceTree::index(int row, int col, const QModelIndex &parent) const
{
QModelIndex ResourceTree::index(int row, int col, const QModelIndex &parent) const {
ResourceTreeItem *item = itemFromIndex(parent)->childAt(row);

if (!item)
Expand All @@ -100,8 +96,7 @@ QModelIndex ResourceTree::index(int row, int col, const QModelIndex &parent) con
return createIndex(row, col, item);
}

QModelIndex ResourceTree::parent(const QModelIndex &index) const
{
QModelIndex ResourceTree::parent(const QModelIndex &index) const {
ResourceTreeItem *parent = itemFromIndex(index)->getParent();
if (parent == _root)
return QModelIndex();
Expand Down
2 changes: 0 additions & 2 deletions src/gui/resourcetreeitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ const QString &ResourceTreeItem::getName() const {
return _name;
}

/* Data. */

bool ResourceTreeItem::isDir() const {
return _source == kSourceDirectory;
}
Expand Down

0 comments on commit 5470b8a

Please sign in to comment.