From a01c97cda3ea5da3e1cfacc429c12ba2eaad2adc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Lemaire?= Date: Thu, 5 Jul 2012 15:50:46 +0000 Subject: [PATCH] paysages : Small fixes. git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@379 b1fd45b6-86a6-48da-8261-f70d1f35bdcc --- gui_qt/baseform.cpp | 6 +++++- gui_qt/formatmosphere.cpp | 2 +- lib_paysages/clouds.c | 2 +- lib_paysages/textures.c | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/gui_qt/baseform.cpp b/gui_qt/baseform.cpp index 7708ead..a1c3f48 100644 --- a/gui_qt/baseform.cpp +++ b/gui_qt/baseform.cpp @@ -264,7 +264,9 @@ void BaseForm::layerUpClicked() layerMovedEvent(_layer_list->currentIndex(), _layer_list->currentIndex() + 1); rebuildLayerList(); - + + _layer_list->setCurrentIndex(_layer_list->currentIndex() + 1); + _button_apply->setEnabled(true); _button_revert->setEnabled(true); } @@ -278,6 +280,8 @@ void BaseForm::layerDownClicked() rebuildLayerList(); + _layer_list->setCurrentIndex(_layer_list->currentIndex() - 1); + _button_apply->setEnabled(true); _button_revert->setEnabled(true); } diff --git a/gui_qt/formatmosphere.cpp b/gui_qt/formatmosphere.cpp index abd1dc4..1c13eda 100644 --- a/gui_qt/formatmosphere.cpp +++ b/gui_qt/formatmosphere.cpp @@ -67,7 +67,7 @@ FormAtmosphere::FormAtmosphere(QWidget *parent): addInputDouble(tr("End distance"), &_definition.distance_far, -500.0, 500.0, 5.0, 50.0); addInputDouble(tr("Masking power"), &_definition.full_mask, 0.0, 1.0, 0.01, 0.1); addInputBoolean(tr("Lock on horizon color"), &_definition.auto_lock_on_haze); - addInputColor(tr("Color"), &_definition.color); + addInputColor(tr("Color"), &_definition.color)->setEnabledCondition(&_definition.auto_lock_on_haze, 0); revertConfig(); } diff --git a/lib_paysages/clouds.c b/lib_paysages/clouds.c index 7800d7e..5f1f8a0 100644 --- a/lib_paysages/clouds.c +++ b/lib_paysages/clouds.c @@ -283,7 +283,7 @@ void cloudsMoveLayer(CloudsDefinition* definition, int layer, int new_position) } else { - memmove(definition->layers + new_position, definition->layers + new_position + 1, sizeof(CloudsLayerDefinition) * (layer - new_position)); + memmove(definition->layers + new_position + 1, definition->layers + new_position, sizeof(CloudsLayerDefinition) * (layer - new_position)); } definition->layers[new_position] = temp; } diff --git a/lib_paysages/textures.c b/lib_paysages/textures.c index d7f220b..edf4330 100644 --- a/lib_paysages/textures.c +++ b/lib_paysages/textures.c @@ -226,7 +226,7 @@ void texturesMoveLayer(TexturesDefinition* definition, int layer, int new_positi } else { - memmove(definition->layers + new_position, definition->layers + new_position + 1, sizeof(TextureLayerDefinition) * (layer - new_position)); + memmove(definition->layers + new_position + 1, definition->layers + new_position, sizeof(TextureLayerDefinition) * (layer - new_position)); } definition->layers[new_position] = temp; }