From 80501899ca631ab6176dfa921b68b32289259506 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 24 Nov 2014 11:50:02 -0300 Subject: [PATCH] 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 3354fcd70..e8dca1c26 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 - "<showTip(1000, + "The background layer cannot be moved"); } - else if (!layer->isMoveable()) { - Alert::show(PACKAGE "<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 "<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 "<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 daab39302..c8852570a 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 "<showTip(1000, + "There is no active layer"); return NULL; } // If the active layer is not visible. if (!layer->isReadable()) { - Alert::show(PACKAGE - "<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 - "<showTip(1000, + "Layer '%s' is locked", layer->name().c_str()); return NULL; }