From 6fb63f71b093d8ba07aeb6b7aecea2500143ec88 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 15 Jun 2010 19:45:57 -0300 Subject: [PATCH] Modified logic to selected the default sort criteria in palette editor. --- data/widgets/palette_editor.xml | 2 +- src/commands/cmd_palette_editor.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/widgets/palette_editor.xml b/data/widgets/palette_editor.xml index dd3a3cc5f..2a5ae46a5 100644 --- a/data/widgets/palette_editor.xml +++ b/data/widgets/palette_editor.xml @@ -76,7 +76,7 @@ - + diff --git a/src/commands/cmd_palette_editor.cpp b/src/commands/cmd_palette_editor.cpp index 09a9b97d0..ce3534bd0 100644 --- a/src/commands/cmd_palette_editor.cpp +++ b/src/commands/cmd_palette_editor.cpp @@ -444,9 +444,10 @@ static void sort_command(JWidget widget) HOOK(data.insert_criteria, JI_SIGNAL_BUTTON_SELECT, insert_criteria_hook, &data); HOOK(data.remove_criteria, JI_SIGNAL_BUTTON_SELECT, remove_criteria_hook, &data); - // Select "Value" and insert it as default selected criteria - jlistbox_select_index(data.available_criteria, 5); - insert_criteria_hook(data.insert_criteria, (void*)&data); + // If there is a selected in available criteria + // , insert it as default criteria to sort colors + if (jlistbox_get_selected_child(data.available_criteria)) + insert_criteria_hook(data.insert_criteria, (void*)&data); // Open the window dlg->open_window_fg();