-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redesign Dimension Change Window #637
base: master
Are you sure you want to change the base?
Conversation
int numMetatiles = editor->project->getMapDataSize(widthSpinBox->value(), heightSpinBox->value()); | ||
int maxMetatiles = editor->project->getMaxMapDataSize(); | ||
if (numMetatiles <= maxMetatiles) { | ||
dialog.accept(); | ||
} else { | ||
QString errorText = QString("Error: The specified width and height are too large.\n" | ||
"The maximum layout width and height is the following: (width + 15) * (height + 14) <= %1\n" | ||
"The specified layout width and height was: (%2 + 15) * (%3 + 14) = %4") | ||
.arg(maxMetatiles) | ||
.arg(widthSpinBox->value()) | ||
.arg(heightSpinBox->value()) | ||
.arg(numMetatiles); | ||
errorLabel->setText(errorText); | ||
errorLabel->setVisible(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error check wasn't re-implemented (at least not that I can see)
void Layout::adjustDimensions(QMargins margins, bool setNewBlockdata, bool enableScriptCallback) { | ||
int oldWidth = this->width; | ||
int oldHeight = this->height; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Warnings here for enableScriptCallback
and oldHeight
being unused
} | ||
} | ||
|
||
void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *event) { | |
void ResizableRect::hoverLeaveEvent(QGraphicsSceneHoverEvent *) { |
setFlags(this->flags() | QGraphicsItem::ItemIsMovable | QGraphicsItem::ItemSendsGeometryChanges | QGraphicsItem::ItemIsSelectable); | ||
} | ||
|
||
void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * item, QWidget *widget) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem * item, QWidget *widget) { | |
void BoundedPixmapItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *) { |
this->ui->spinBox_width->setLineEditEnabled(false); | ||
this->ui->spinBox_height->setLineEditEnabled(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we disabling line editing for these? (and for spinBox_borderWidth
/Height
)
int newHeight = this->height + margins.top() + margins.bottom(); | ||
|
||
if (setNewBlockdata) { | ||
// Fill new blockdata TODO: replace old functions, scripting support, undo etc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from scripting is the rest of this still true?
|
||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left behind
TODOs:
scriptabilitycloses #616