Implemented lots of actions in EditSpriteDialog

This commit is contained in:
2025-11-30 00:13:00 +01:00
parent 1d3d391842
commit 7d1c2c7d15
6 changed files with 249 additions and 11 deletions
+17
View File
@@ -1,6 +1,7 @@
#include "createspritedialog.h"
#include "ui_createspritedialog.h"
#include <QMessageBox>
#include <QPushButton>
#include "editorguiutils.h"
@@ -32,3 +33,19 @@ QSize CreateSpriteDialog::spriteSize() const
{
return QSize{m_ui->spinBoxWidth->value(), m_ui->spinBoxHeight->value()};
}
void CreateSpriteDialog::accept()
{
const auto size = spriteSize();
if (size.width() < 1)
{
QMessageBox::warning(this, tr("Zero width not possible!"), tr("Zero width not possible!"));
return;
}
if (size.height() < 1)
{
QMessageBox::warning(this, tr("Zero height not possible!"), tr("Zero height not possible!"));
return;
}
QDialog::accept();
}