[aseprite] 70/134: Change errors UI related to locked/hidden layers to status bar tips
Tobias Hansen
thansen at moszumanska.debian.org
Sat Mar 14 17:10:08 UTC 2015
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 80501899ca631ab6176dfa921b68b32289259506
Author: David Capello <davidcapello at gmail.com>
Date: Mon Nov 24 11:50:02 2014 -0300
Change errors UI related to locked/hidden layers to status bar tips
This was mainly done for Ctrl+click, so when we try to move the
Background layer, we avoid an annoying message box.
---
src/app/ui/editor/standby_state.cpp | 18 ++++++++++--------
src/app/ui/editor/tool_loop_impl.cpp | 15 ++++++---------
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/src/app/ui/editor/standby_state.cpp b/src/app/ui/editor/standby_state.cpp
index 3354fcd..e8dca1c 100644
--- a/src/app/ui/editor/standby_state.cpp
+++ b/src/app/ui/editor/standby_state.cpp
@@ -198,14 +198,14 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
if ((layer) &&
(layer->type() == OBJECT_LAYER_IMAGE)) {
- // TODO you can move the `Background' with tiled mode
+ // TODO we should be able to move the `Background' with tiled mode
if (layer->isBackground()) {
- Alert::show(PACKAGE
- "<<You can't move the `Background' layer."
- "||&Close");
+ StatusBar::instance()->showTip(1000,
+ "The background layer cannot be moved");
}
- else if (!layer->isMoveable()) {
- Alert::show(PACKAGE "<<The layer movement is locked.||&Close");
+ else if (!layer->isMoveable() || !layer->isWritable()) {
+ StatusBar::instance()->showTip(1000,
+ "Layer '%s' is locked", layer->name().c_str());
}
else {
// Change to MovingCelState
@@ -237,7 +237,8 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
Image* image = location.image(&x, &y, &opacity);
if (image) {
if (!layer->isWritable()) {
- Alert::show(PACKAGE "<<The layer is locked.||&Close");
+ StatusBar::instance()->showTip(1000,
+ "Layer '%s' is locked", layer->name().c_str());
return true;
}
@@ -251,7 +252,8 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
// Move selected pixels
if (editor->isInsideSelection() && msg->left()) {
if (!layer->isWritable()) {
- Alert::show(PACKAGE "<<The layer is locked.||&Close");
+ StatusBar::instance()->showTip(1000,
+ "Layer '%s' is locked", layer->name().c_str());
return true;
}
diff --git a/src/app/ui/editor/tool_loop_impl.cpp b/src/app/ui/editor/tool_loop_impl.cpp
index daab393..c885257 100644
--- a/src/app/ui/editor/tool_loop_impl.cpp
+++ b/src/app/ui/editor/tool_loop_impl.cpp
@@ -298,24 +298,21 @@ tools::ToolLoop* create_tool_loop(Editor* editor, Context* context)
Layer* layer = editor->layer();
if (!layer) {
- Alert::show(PACKAGE "<<The current sprite does not have any layer.||&Close");
+ StatusBar::instance()->showTip(1000,
+ "There is no active layer");
return NULL;
}
// If the active layer is not visible.
if (!layer->isReadable()) {
- Alert::show(PACKAGE
- "<<The current layer is hidden,"
- "<<make it visible and try again"
- "||&Close");
+ StatusBar::instance()->showTip(1000,
+ "Layer '%s' is hidden", layer->name().c_str());
return NULL;
}
// If the active layer is read-only.
else if (!layer->isWritable()) {
- Alert::show(PACKAGE
- "<<The current layer is locked,"
- "<<unlock it and try again"
- "||&Close");
+ StatusBar::instance()->showTip(1000,
+ "Layer '%s' is locked", layer->name().c_str());
return NULL;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list