Lots of actions added or iconified in image editor
This commit is contained in:
+2
-2
@@ -53,8 +53,8 @@ HEADERS += \
|
||||
src/engine/vulkangamerenderer.h \
|
||||
src/engine/vulkangamewindow.h \
|
||||
src/futurecpp.h \
|
||||
src/imagehelpers.h \
|
||||
src/projectcontainer.h \
|
||||
src/editor/imagehelpers.h \
|
||||
src/editor/jshighlighter.h \
|
||||
src/editor/mainwindow.h \
|
||||
src/editor/dialogs/addeventdialog.h \
|
||||
@@ -127,9 +127,9 @@ SOURCES += \
|
||||
src/engine/glgamewindow.cpp \
|
||||
src/engine/vulkangamerenderer.cpp \
|
||||
src/engine/vulkangamewindow.cpp \
|
||||
src/imagehelpers.cpp \
|
||||
src/main.cpp \
|
||||
src/projectcontainer.cpp \
|
||||
src/editor/imagehelpers.cpp \
|
||||
src/editor/jshighlighter.cpp \
|
||||
src/editor/mainwindow.cpp \
|
||||
src/editor/dialogs/addeventdialog.cpp \
|
||||
|
||||
@@ -2,11 +2,6 @@
|
||||
|
||||
#include <QEvent>
|
||||
|
||||
CloseEventFilter::CloseEventFilter(QObject *parent) :
|
||||
QObject{parent}
|
||||
{
|
||||
}
|
||||
|
||||
bool CloseEventFilter::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
if (event->type() == QEvent::Close)
|
||||
|
||||
@@ -7,7 +7,7 @@ class CloseEventFilter : public QObject
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CloseEventFilter(QObject *parent = nullptr);
|
||||
using QObject::QObject;
|
||||
|
||||
signals:
|
||||
void closeEventReceived();
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
MoveFixedDialog::MoveFixedDialog(MoveFixedAction &action, ProjectTreeModel *projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::MoveFixedDialog>()},
|
||||
@@ -20,10 +22,7 @@ MoveFixedDialog::MoveFixedDialog(MoveFixedAction &action, ProjectTreeModel *proj
|
||||
m_ui->widgetObject->setEmptySelectionText(tr("self"));
|
||||
m_ui->widgetObject->setShowClearObjectAction(false);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
MoveFixedDialog::~MoveFixedDialog() = default;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
MoveFreeDialog::MoveFreeDialog(MoveFreeAction &action, ProjectTreeModel *projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::MoveFreeDialog>()},
|
||||
@@ -20,10 +22,7 @@ MoveFreeDialog::MoveFreeDialog(MoveFreeAction &action, ProjectTreeModel *project
|
||||
m_ui->widgetObject->setEmptySelectionText(tr("self"));
|
||||
m_ui->widgetObject->setShowClearObjectAction(false);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
MoveFreeDialog::~MoveFreeDialog() = default;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
MoveTowardsDialog::MoveTowardsDialog(MoveTowardsAction &action, ProjectTreeModel *projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::MoveTowardsDialog>()},
|
||||
@@ -20,10 +22,7 @@ MoveTowardsDialog::MoveTowardsDialog(MoveTowardsAction &action, ProjectTreeModel
|
||||
m_ui->widgetObject->setEmptySelectionText(tr("self"));
|
||||
m_ui->widgetObject->setShowClearObjectAction(false);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
MoveTowardsDialog::~MoveTowardsDialog() = default;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
SetGravityDialog::SetGravityDialog(SetGravityAction &action, ProjectTreeModel *projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::SetGravityDialog>()},
|
||||
@@ -20,10 +22,7 @@ SetGravityDialog::SetGravityDialog(SetGravityAction &action, ProjectTreeModel *p
|
||||
m_ui->widgetObject->setEmptySelectionText(tr("self"));
|
||||
m_ui->widgetObject->setShowClearObjectAction(false);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
SetGravityDialog::~SetGravityDialog() = default;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
SpeedHorizontalDialog::SpeedHorizontalDialog(SpeedHorizontalAction &action, ProjectTreeModel *projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::SpeedHorizontalDialog>()},
|
||||
@@ -20,10 +22,7 @@ SpeedHorizontalDialog::SpeedHorizontalDialog(SpeedHorizontalAction &action, Proj
|
||||
m_ui->widgetObject->setEmptySelectionText(tr("self"));
|
||||
m_ui->widgetObject->setShowClearObjectAction(false);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
SpeedHorizontalDialog::~SpeedHorizontalDialog() = default;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
SpeedVerticalDialog::SpeedVerticalDialog(SpeedVerticalAction &action, ProjectTreeModel *projectModel, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::SpeedVerticalDialog>()},
|
||||
@@ -20,10 +22,7 @@ SpeedVerticalDialog::SpeedVerticalDialog(SpeedVerticalAction &action, ProjectTre
|
||||
m_ui->widgetObject->setEmptySelectionText(tr("self"));
|
||||
m_ui->widgetObject->setShowClearObjectAction(false);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
SpeedVerticalDialog::~SpeedVerticalDialog() = default;
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "mainwindow.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
AddEventDialog::AddEventDialog(ProjectTreeModel &projectModel, MainWindow &mainWindow, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
@@ -20,10 +21,7 @@ AddEventDialog::AddEventDialog(ProjectTreeModel &projectModel, MainWindow &mainW
|
||||
#endif
|
||||
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
connect(m_ui->pushButtonCreate, &QAbstractButton::clicked,
|
||||
this, [this](){ m_eventType = Object::EventType::Create; accept(); });
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "imageeditordialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "imagehelpers.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
BackgroundPropertiesDialog::BackgroundPropertiesDialog(Background &background, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||
QDialog{&mainWindow},
|
||||
@@ -21,10 +23,7 @@ BackgroundPropertiesDialog::BackgroundPropertiesDialog(Background &background, P
|
||||
|
||||
updateTitle();
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->lineEditName->setText(m_background.name);
|
||||
updateSpriteInfo();
|
||||
@@ -139,22 +138,7 @@ void BackgroundPropertiesDialog::saveBackground()
|
||||
return;
|
||||
}
|
||||
|
||||
const auto path = QFileDialog::getSaveFileName(this, tr("Save a Background Image..."), m_background.name + ".png",
|
||||
QStringLiteral("%0 (*.png);;%1 (*.bmp);;%2 (*.tiff);;%3 (*.jpg *.jpeg);;%4 (*)")
|
||||
.arg(tr("PNG Files"))
|
||||
.arg(tr("BMP Files"))
|
||||
.arg(tr("TIFF Files"))
|
||||
.arg(tr("JPEG Files"))
|
||||
.arg(tr("All Files"))
|
||||
);
|
||||
if (path.isEmpty())
|
||||
return;
|
||||
|
||||
if (!m_pixmap.save(path))
|
||||
{
|
||||
QMessageBox::warning(this, tr("Could not save Background!"), tr("Could not save Background!"));
|
||||
return;
|
||||
}
|
||||
saveImage(this, m_pixmap.toImage());
|
||||
}
|
||||
|
||||
void BackgroundPropertiesDialog::editBackground()
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
CreateSpriteDialog::CreateSpriteDialog(QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::CreateSpriteDialog>()}
|
||||
@@ -14,10 +16,7 @@ CreateSpriteDialog::CreateSpriteDialog(QWidget *parent) :
|
||||
#endif
|
||||
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
CreateSpriteDialog::CreateSpriteDialog(const QSize &size, QWidget *parent) :
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#include "deletemomentsdialog.h"
|
||||
#include "ui_deletemomentsdialog.h"
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
DeleteMomentsDialog::DeleteMomentsDialog(QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::DeleteMomentsDialog>()}
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
DeleteMomentsDialog::DeleteMomentsDialog(int fromMoment, int tillMoment, QWidget *parent) :
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "models/spritesmodel.h"
|
||||
#include "dialogs/transparentbackgroundsettingsdialog.h"
|
||||
#include "createspritedialog.h"
|
||||
#include "imageeditordialog.h"
|
||||
#include "imagehelpers.h"
|
||||
@@ -31,13 +32,24 @@ EditSpriteDialog::EditSpriteDialog(const std::vector<QPixmap> &pixmaps, const QS
|
||||
m_ui->actionNew->setShortcut(QKeySequence::New);
|
||||
m_ui->actionCreateFromFile->setShortcut(QKeySequence::Open);
|
||||
m_ui->actionSaveAsPngFile->setShortcut(QKeySequence::Save);
|
||||
m_ui->actionUndo->setShortcut(QKeySequence::Undo);
|
||||
m_ui->actionRedo->setShortcut(QKeySequence::Redo);
|
||||
m_ui->actionCut->setShortcut(QKeySequence::Cut);
|
||||
m_ui->actionCopy->setShortcut(QKeySequence::Copy);
|
||||
m_ui->actionPaste->setShortcut(QKeySequence::Paste);
|
||||
m_ui->actionDelete->setShortcut(QKeySequence::Delete);
|
||||
|
||||
m_ui->listView->setModel(m_model.get());
|
||||
|
||||
connect(m_ui->actionNew, &QAction::triggered, this, &EditSpriteDialog::newSprite);
|
||||
connect(m_ui->actionSaveAsPngFile, &QAction::triggered, this, &EditSpriteDialog::saveAsPng);
|
||||
connect(m_ui->actionNew, &QAction::triggered,
|
||||
this, &EditSpriteDialog::newSprite);
|
||||
connect(m_ui->actionSaveAsPngFile, &QAction::triggered,
|
||||
this, &EditSpriteDialog::saveAsPng);
|
||||
connect(m_ui->actionSetTransparencyBackground, &QAction::triggered,
|
||||
this, &EditSpriteDialog::transparentBackgroundSettings);
|
||||
|
||||
connect(m_ui->listView, &QAbstractItemView::activated, this, &EditSpriteDialog::activated);
|
||||
connect(m_ui->listView, &QAbstractItemView::activated,
|
||||
this, &EditSpriteDialog::activated);
|
||||
connect(m_ui->listView->selectionModel(), &QItemSelectionModel::currentChanged,
|
||||
this, &EditSpriteDialog::currentChanged);
|
||||
currentChanged(m_ui->listView->currentIndex());
|
||||
@@ -126,6 +138,15 @@ void EditSpriteDialog::saveAsPng()
|
||||
saveImage(this, pixmap.toImage());
|
||||
}
|
||||
|
||||
void EditSpriteDialog::transparentBackgroundSettings()
|
||||
{
|
||||
TransparentBackgroundSettingsDialog dialog{this};
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
// TODO apply
|
||||
}
|
||||
}
|
||||
|
||||
void EditSpriteDialog::activated(const QModelIndex &index)
|
||||
{
|
||||
if (!index.isValid())
|
||||
|
||||
@@ -26,6 +26,7 @@ public:
|
||||
private slots:
|
||||
void newSprite();
|
||||
void saveAsPng();
|
||||
void transparentBackgroundSettings();
|
||||
|
||||
void activated(const QModelIndex &index);
|
||||
void currentChanged(const QModelIndex &index);
|
||||
|
||||
@@ -50,6 +50,25 @@
|
||||
<property name="title">
|
||||
<string>&Edit</string>
|
||||
</property>
|
||||
<addaction name="actionUndo"/>
|
||||
<addaction name="actionRedo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCut"/>
|
||||
<addaction name="actionCopy"/>
|
||||
<addaction name="actionPaste"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionErase"/>
|
||||
<addaction name="actionDelete"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMoveLeft"/>
|
||||
<addaction name="actionMoveRight"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionAddEmpty"/>
|
||||
<addaction name="actionInsertEmpty"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionEdit"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSetTransparencyBackground"/>
|
||||
</widget>
|
||||
<widget class="QMenu" name="menuTransform">
|
||||
<property name="title">
|
||||
@@ -76,10 +95,10 @@
|
||||
<item>
|
||||
<widget class="QFrame" name="frame">
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Panel</enum>
|
||||
<enum>QFrame::Shape::Panel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<layout class="QHBoxLayout">
|
||||
<property name="spacing">
|
||||
@@ -118,6 +137,20 @@
|
||||
<addaction name="actionAddFromFile"/>
|
||||
<addaction name="actionSaveAsPngFile"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionInsertEmpty"/>
|
||||
<addaction name="actionAddEmpty"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionUndo"/>
|
||||
<addaction name="actionRedo"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionCut"/>
|
||||
<addaction name="actionCopy"/>
|
||||
<addaction name="actionPaste"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionMoveLeft"/>
|
||||
<addaction name="actionMoveRight"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionEdit"/>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -126,7 +159,7 @@
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
<enum>Qt::Orientation::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QWidget" name="verticalLayoutWidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
@@ -140,7 +173,7 @@
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
<enum>Qt::Orientation::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
@@ -157,7 +190,7 @@
|
||||
<number>16</number>
|
||||
</property>
|
||||
<property name="viewMode">
|
||||
<enum>QListView::IconMode</enum>
|
||||
<enum>QListView::ViewMode::IconMode</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -174,6 +207,9 @@
|
||||
<property name="text">
|
||||
<string>&New...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create a new sprite</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCreateFromFile">
|
||||
<property name="icon">
|
||||
@@ -183,6 +219,9 @@
|
||||
<property name="text">
|
||||
<string>&Create from file...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Create new sprite from file</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAddFromFile">
|
||||
<property name="icon">
|
||||
@@ -192,6 +231,9 @@
|
||||
<property name="text">
|
||||
<string>&Add from file...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Add a sprite from file</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+A</string>
|
||||
</property>
|
||||
@@ -204,6 +246,9 @@
|
||||
<property name="text">
|
||||
<string>&Save as PNG File...</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Save the sprite as PNG File</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCreateFromStrip">
|
||||
<property name="text">
|
||||
@@ -230,6 +275,109 @@
|
||||
<string>Close Saving Changes</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUndo">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/undo.png</normaloff>:/qtgameengine/icons/undo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Undo</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionRedo">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/redo.png</normaloff>:/qtgameengine/icons/redo.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Redo</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCut">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/cut.png</normaloff>:/qtgameengine/icons/cut.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cu&t</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/copy.png</normaloff>:/qtgameengine/icons/copy.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPaste">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/paste.png</normaloff>:/qtgameengine/icons/paste.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Paste</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionErase">
|
||||
<property name="text">
|
||||
<string>&Erase...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Shift+Del</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDelete">
|
||||
<property name="text">
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMoveLeft">
|
||||
<property name="text">
|
||||
<string>Move &Left</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+L</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionMoveRight">
|
||||
<property name="text">
|
||||
<string>&Move Right</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+R</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionAddEmpty">
|
||||
<property name="text">
|
||||
<string>&Add Empty</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Shift+A</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionInsertEmpty">
|
||||
<property name="text">
|
||||
<string>&Insert Empty</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Shift+I</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEdit">
|
||||
<property name="text">
|
||||
<string>Edit...</string>
|
||||
</property>
|
||||
<property name="shortcut">
|
||||
<string>Ctrl+E</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionSetTransparencyBackground">
|
||||
<property name="text">
|
||||
<string>&Set Transparency Background...</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources>
|
||||
<include location="../resources_editor.qrc"/>
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "ui_extensionpackagesdialog.h"
|
||||
|
||||
#include "installextensiondialog.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
ExtensionPackagesDialog::ExtensionPackagesDialog(QWidget *parent) :
|
||||
QDialog{parent},
|
||||
@@ -14,10 +15,7 @@ ExtensionPackagesDialog::ExtensionPackagesDialog(QWidget *parent) :
|
||||
#endif
|
||||
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
if (auto button = m_ui->buttonBox->addButton(tr("Install"), QDialogButtonBox::ActionRole))
|
||||
{
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "projectcontainer.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "mainwindow.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
FontPropertiesDialog::FontPropertiesDialog(Font &font, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||
QDialog{&mainWindow},
|
||||
@@ -18,10 +19,7 @@ FontPropertiesDialog::FontPropertiesDialog(Font &font, ProjectTreeModel &project
|
||||
|
||||
updateTitle();
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->lineEditName->setText(m_font.name);
|
||||
m_ui->fontComboBox->setCurrentFont(m_font.font);
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <QMessageBox>
|
||||
#include <QDebug>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
GlobalGameSettingsDialog::GlobalGameSettingsDialog(GlobalGameSettings &globalGameSettings, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::GlobalGameSettingsDialog>()},
|
||||
@@ -27,10 +29,7 @@ GlobalGameSettingsDialog::GlobalGameSettingsDialog(GlobalGameSettings &globalGam
|
||||
widget->setSizePolicy(sp_retain);
|
||||
}
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
connect(m_ui->checkBoxFullscreen, &QCheckBox::toggled,
|
||||
this, &GlobalGameSettingsDialog::changed);
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <QFontDialog>
|
||||
#include <QColorDialog>
|
||||
|
||||
#include "dialogs/transparentbackgroundsettingsdialog.h"
|
||||
#include "imagehelpers.h"
|
||||
|
||||
ImageEditorDialog::ImageEditorDialog(const QPixmap &pixmap, const QString &title, QWidget *parent) :
|
||||
@@ -29,10 +30,22 @@ ImageEditorDialog::ImageEditorDialog(const QPixmap &pixmap, const QString &title
|
||||
|
||||
updateTitle();
|
||||
|
||||
m_ui->actionNew->setShortcut(QKeySequence::New);
|
||||
m_ui->actionOpen->setShortcut(QKeySequence::Open);
|
||||
m_ui->actionSaveAsPngFile->setShortcut(QKeySequence::Save);
|
||||
m_ui->actionUndo->setShortcut(QKeySequence::Undo);
|
||||
m_ui->actionRedo->setShortcut(QKeySequence::Redo);
|
||||
m_ui->actionDelete->setShortcut(QKeySequence::Delete);
|
||||
m_ui->actionCut->setShortcut(QKeySequence::Cut);
|
||||
m_ui->actionCopy->setShortcut(QKeySequence::Copy);
|
||||
m_ui->actionPaste->setShortcut(QKeySequence::Paste);
|
||||
|
||||
m_ui->scrollArea->setBackgroundRole(QPalette::Dark);
|
||||
|
||||
connect(m_ui->actionSaveAsPngFile, &QAction::triggered,
|
||||
this, &ImageEditorDialog::saveAsPng);
|
||||
connect(m_ui->actionSetTransparencyBackground, &QAction::triggered,
|
||||
this, &ImageEditorDialog::transparentBackgroundSettings);
|
||||
|
||||
connect(m_ui->pushButtonSelectFont, &QAbstractButton::pressed,
|
||||
this, &ImageEditorDialog::selectFont);
|
||||
@@ -195,6 +208,15 @@ void ImageEditorDialog::saveAsPng()
|
||||
saveImage(this, image);
|
||||
}
|
||||
|
||||
void ImageEditorDialog::transparentBackgroundSettings()
|
||||
{
|
||||
TransparentBackgroundSettingsDialog dialog{this};
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
// TODO apply
|
||||
}
|
||||
}
|
||||
|
||||
void ImageEditorDialog::changed()
|
||||
{
|
||||
if (!m_unsavedChanges)
|
||||
|
||||
@@ -28,6 +28,8 @@ public:
|
||||
|
||||
private slots:
|
||||
void saveAsPng();
|
||||
void transparentBackgroundSettings();
|
||||
|
||||
void changed();
|
||||
void selectFont();
|
||||
void selectLeftButtonColor();
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<string>&File</string>
|
||||
</property>
|
||||
<addaction name="actionNew"/>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionSaveAsPngFile"/>
|
||||
<addaction name="separator"/>
|
||||
@@ -142,7 +143,7 @@
|
||||
<addaction name="actionNextImage"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionNew"/>
|
||||
<addaction name="actionLoad"/>
|
||||
<addaction name="actionOpen"/>
|
||||
<addaction name="actionSaveAsPngFile"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionUndo"/>
|
||||
@@ -974,13 +975,13 @@
|
||||
<string>Close the image editor, saving the changes made</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionLoad">
|
||||
<action name="actionOpen">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/open.png</normaloff>:/qtgameengine/icons/open.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Load</string>
|
||||
<string>&Open...</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionUndo">
|
||||
@@ -1007,21 +1008,37 @@
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionDelete">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/delete.png</normaloff>:/qtgameengine/icons/delete.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Delete</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCut">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/cut.png</normaloff>:/qtgameengine/icons/cut.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cu&t</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCopy">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/copy.png</normaloff>:/qtgameengine/icons/copy.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Copy</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionPaste">
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/paste.png</normaloff>:/qtgameengine/icons/paste.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Paste</string>
|
||||
</property>
|
||||
@@ -1055,6 +1072,10 @@
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources_editor.qrc">
|
||||
<normaloff>:/qtgameengine/icons/grid.png</normaloff>:/qtgameengine/icons/grid.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Toggle &Grid</string>
|
||||
</property>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "includedfilepropertiesdialog.h"
|
||||
#include "ui_includedfilepropertiesdialog.h"
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
IncludedFilePropertiesDialog::IncludedFilePropertiesDialog(IncludedFile &includedFile, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_includedFile{includedFile},
|
||||
@@ -12,6 +14,8 @@ IncludedFilePropertiesDialog::IncludedFilePropertiesDialog(IncludedFile &include
|
||||
setWindowFlags((windowFlags() & ~Qt::Dialog) | Qt::Window);
|
||||
#endif
|
||||
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
IncludedFilePropertiesDialog::~IncludedFilePropertiesDialog() = default;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "projectcontainer.h"
|
||||
#include "models/includedfilesmodel.h"
|
||||
#include "dialogs/includedfilepropertiesdialog.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
IncludedFilesDialog::IncludedFilesDialog(ProjectContainer &project, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
@@ -13,10 +14,7 @@ IncludedFilesDialog::IncludedFilesDialog(ProjectContainer &project, QWidget *par
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->listView->setModel(m_model.get());
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include "maskpropertiesdialog.h"
|
||||
#include "ui_maskpropertiesdialog.h"
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
MaskPropertiesDialog::MaskPropertiesDialog(QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::MaskPropertiesDialog>()}
|
||||
@@ -11,6 +13,8 @@ MaskPropertiesDialog::MaskPropertiesDialog(QWidget *parent) :
|
||||
setWindowFlags((windowFlags() & ~Qt::Dialog) | Qt::Window);
|
||||
#endif
|
||||
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
MaskPropertiesDialog::~MaskPropertiesDialog() = default;
|
||||
|
||||
@@ -13,6 +13,19 @@
|
||||
<property name="windowTitle">
|
||||
<string>Mask Properties</string>
|
||||
</property>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>60</x>
|
||||
<y>240</y>
|
||||
<width>187</width>
|
||||
<height>26</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::StandardButton::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "models/objecteventsmodel.h"
|
||||
#include "addeventdialog.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||
QDialog{&mainWindow},
|
||||
@@ -30,10 +31,7 @@ ObjectPropertiesDialog::ObjectPropertiesDialog(Object &object, ProjectTreeModel
|
||||
|
||||
updateTitle();
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->widgetParent->setProjectModel(&m_projectModel);
|
||||
m_ui->widgetParent->setForbiddenObjectName(m_object.name);
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::PreferencesDialog>()}
|
||||
@@ -14,10 +16,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent) :
|
||||
#endif
|
||||
setWindowFlag(Qt::WindowCloseButtonHint);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
PreferencesDialog::~PreferencesDialog() = default;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "projectcontainer.h"
|
||||
#include "models/projecttreemodel.h"
|
||||
#include "mainwindow.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
SoundPropertiesDialog::SoundPropertiesDialog(Sound &sound, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||
QDialog{&mainWindow},
|
||||
@@ -22,10 +23,7 @@ SoundPropertiesDialog::SoundPropertiesDialog(Sound &sound, ProjectTreeModel &pro
|
||||
|
||||
updateTitle();
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->lineEditName->setText(m_sound.name);
|
||||
if (!m_sound.path.isEmpty())
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "maskpropertiesdialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "imagehelpers.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
SpritePropertiesDialog::SpritePropertiesDialog(Sprite &sprite, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||
QDialog{&mainWindow},
|
||||
@@ -24,10 +25,7 @@ SpritePropertiesDialog::SpritePropertiesDialog(Sprite &sprite, ProjectTreeModel
|
||||
|
||||
updateTitle();
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->lineEditName->setText(m_sprite.name);
|
||||
updateSpriteInfo();
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "models/timelinemomentsmodel.h"
|
||||
#include "dialogs/deletemomentsdialog.h"
|
||||
#include "mainwindow.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
TimeLinePropertiesDialog::TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTreeModel &projectModel, MainWindow &mainWindow) :
|
||||
QDialog{&mainWindow},
|
||||
@@ -25,10 +26,7 @@ TimeLinePropertiesDialog::TimeLinePropertiesDialog(TimeLine &timeLine, ProjectTr
|
||||
|
||||
updateTitle();
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->lineEditName->setText(m_timeLine.name);
|
||||
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
#include "transparentbackgroundsettingsdialog.h"
|
||||
#include "ui_transparentbackgroundsettingsdialog.h"
|
||||
|
||||
#include "editorguiutils.h"
|
||||
|
||||
TransparentBackgroundSettingsDialog::TransparentBackgroundSettingsDialog(QWidget *parent) :
|
||||
QDialog{parent},
|
||||
m_ui{std::make_unique<Ui::TransparentBackgroundSettingsDialog>()}
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
}
|
||||
|
||||
TransparentBackgroundSettingsDialog::~TransparentBackgroundSettingsDialog() = default;
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "projectcontainer.h"
|
||||
#include "models/triggersmodel.h"
|
||||
#include "genericcodeeditordialog.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
TriggersDialog::TriggersDialog(ProjectContainer &project, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
@@ -16,10 +17,7 @@ TriggersDialog::TriggersDialog(ProjectContainer &project, QWidget *parent) :
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->listView->setModel(m_model.get());
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include "projectcontainer.h"
|
||||
#include "models/constantsmodel.h"
|
||||
#include "editorguiutils.h"
|
||||
|
||||
UserDefinedConstantsDialog::UserDefinedConstantsDialog(ProjectContainer &project, QWidget *parent) :
|
||||
QDialog{parent},
|
||||
@@ -15,10 +16,7 @@ UserDefinedConstantsDialog::UserDefinedConstantsDialog(ProjectContainer &project
|
||||
{
|
||||
m_ui->setupUi(this);
|
||||
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = m_ui->buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
improveButtonBox(m_ui->buttonBox);
|
||||
|
||||
m_ui->treeView->setModel(m_model.get());
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
#include <QPixmap>
|
||||
#include <QPen>
|
||||
#include <QColor>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QPushButton>
|
||||
|
||||
QBrush makeGridBrush(int snapX, int snapY, const QPen &gridPen, const QColor &backgroundColor)
|
||||
{
|
||||
@@ -35,3 +37,11 @@ QBrush makeGridBrush(int snapX, int snapY, const QColor &gridColor, const QColor
|
||||
|
||||
return QBrush{std::move(pixmap)};
|
||||
}
|
||||
|
||||
void improveButtonBox(QDialogButtonBox *buttonBox)
|
||||
{
|
||||
if (auto button = buttonBox->button(QDialogButtonBox::Ok))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/ok.png"});
|
||||
if (auto button = buttonBox->button(QDialogButtonBox::Cancel))
|
||||
button->setIcon(QIcon{":/qtgameengine/icons/delete.png"});
|
||||
}
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
class QBrush;
|
||||
class QPen;
|
||||
class QColor;
|
||||
class QDialogButtonBox;
|
||||
|
||||
QBrush makeGridBrush(int snapX, int snapY, const QPen &gridPen, const QColor &backgroundColor);
|
||||
QBrush makeGridBrush(int snapX, int snapY, const QColor &gridColor, const QColor &backgroundColor);
|
||||
|
||||
void improveButtonBox(QDialogButtonBox *buttonBox);
|
||||
|
||||
@@ -719,7 +719,10 @@ void MainWindow::showObjectInformation()
|
||||
void MainWindow::transparentBackgroundSettings()
|
||||
{
|
||||
TransparentBackgroundSettingsDialog dialog{this};
|
||||
dialog.exec();
|
||||
if (dialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
// TODO apply
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
||||
Reference in New Issue
Block a user