Support MergeDownLayer when ENABLE_UI is not defined

This commit is contained in:
David Capello 2019-04-17 00:16:52 -03:00
parent a558d432f4
commit 17895dce69
3 changed files with 7 additions and 3 deletions

View File

@ -238,7 +238,6 @@ if(ENABLE_UI)
commands/cmd_mask_all.cpp
commands/cmd_mask_by_color.cpp
commands/cmd_mask_content.cpp
commands/cmd_merge_down_layer.cpp
commands/cmd_modify_selection.cpp
commands/cmd_move_cel.cpp
commands/cmd_move_mask.cpp
@ -505,6 +504,7 @@ add_library(app-lib
commands/cmd_flatten_layers.cpp
commands/cmd_layer_from_background.cpp
commands/cmd_load_palette.cpp
commands/cmd_merge_down_layer.cpp
commands/cmd_new_frame.cpp
commands/cmd_new_layer.cpp
commands/cmd_open_file.cpp

View File

@ -155,7 +155,11 @@ void MergeDownLayerCommand::onExecute(Context* context)
document->getApi(tx).removeLayer(src_layer); // src_layer is deleted inside removeLayer()
tx.commit();
update_screen_for_document(document);
#ifdef ENABLE_UI
if (context->isUIAvailable())
update_screen_for_document(document);
#endif
}
Command* CommandFactory::createMergeDownLayerCommand()

View File

@ -15,6 +15,7 @@ FOR_EACH_COMMAND(ExportSpriteSheet)
FOR_EACH_COMMAND(FlattenLayers)
FOR_EACH_COMMAND(LayerFromBackground)
FOR_EACH_COMMAND(LoadPalette)
FOR_EACH_COMMAND(MergeDownLayer)
FOR_EACH_COMMAND(NewFrame)
FOR_EACH_COMMAND(NewLayer)
FOR_EACH_COMMAND(OpenFile)
@ -92,7 +93,6 @@ FOR_EACH_COMMAND(LoadMask)
FOR_EACH_COMMAND(MaskAll)
FOR_EACH_COMMAND(MaskByColor)
FOR_EACH_COMMAND(MaskContent)
FOR_EACH_COMMAND(MergeDownLayer)
FOR_EACH_COMMAND(ModifySelection)
FOR_EACH_COMMAND(MoveCel)
FOR_EACH_COMMAND(MoveMask)