Skip to content

Commit

Permalink
Merge pull request darktable-org#8559 from AlicVB/presets_glitches
Browse files Browse the repository at this point in the history
modulegroup + presets fix focus
  • Loading branch information
TurboGit authored Mar 26, 2021
2 parents d751803 + fd5712f commit 80c588f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 29 deletions.
7 changes: 7 additions & 0 deletions src/gui/presets.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,13 @@ static void _presets_show_edit_dialog(dt_gui_presets_edit_dialog_t *g, gboolean
if(w) gtk_widget_set_sensitive(w, FALSE);
}

// put focus on cancel button if 2 first entry desactivated
if(!allow_desc_change && !allow_name_change)
{
GtkWidget *w = gtk_dialog_get_widget_for_response(GTK_DIALOG(dialog), GTK_RESPONSE_CANCEL);
if(w) gtk_widget_grab_focus(w);
}

g_signal_connect(dialog, "response", G_CALLBACK(_edit_preset_response), g);
gtk_widget_show_all(dialog);
}
Expand Down
58 changes: 29 additions & 29 deletions src/libs/modulegroups.c
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ static gchar *_preset_retrieve_old_layout_updated()
// group name and icon
if(i == 0)
{
ret = dt_util_dstrcat(ret, "ꬹ1|||%s",
ret = dt_util_dstrcat(ret, "1ꬹ1|||%s",
"exposure/exposure|temperature/temperature|temperature/tint|colorbalance/contrast"
"|colorbalance/output saturation|clipping/angle|denoiseprofile|lens|bilat");
ret = dt_util_dstrcat(ret, "ꬹfavorites|favorites|");
Expand Down Expand Up @@ -1235,7 +1235,7 @@ static gchar *_preset_retrieve_old_layout(const char *list, const char *list_fav
if(i == 0)
{
// we don't have to care about "modern" workflow for temperature as it's more recent than this layout
ret = dt_util_dstrcat(ret, "ꬹ1|||%s",
ret = dt_util_dstrcat(ret, "1ꬹ1|||%s",
"exposure/exposure|temperature/temperature|temperature/tint|colorbalance/contrast"
"|colorbalance/output saturation|clipping/angle|denoiseprofile|lens|bilat");
ret = dt_util_dstrcat(ret, "ꬹfavorites|favorites|");
Expand Down Expand Up @@ -1489,36 +1489,36 @@ static void _preset_from_string(dt_lib_module_t *self, gchar *txt, gboolean edit
}

// start no quick access
#define SNQA() \
{ \
g_free(tx); \
tx=NULL; \
tx = dt_util_dstrcat(tx, "1ꬹ1"); \
#define SNQA() \
{ \
g_free(tx); \
tx = NULL; \
tx = dt_util_dstrcat(tx, "1ꬹ0||"); \
}

// start quick access
#define SQA() \
{ \
g_free(tx); \
tx=NULL; \
tx = dt_util_dstrcat(tx, "ꬹ1||"); \
if(is_modern) \
{ \
AM("channelmixerrgb/temperature"); \
} \
else \
{ \
AM("temperature/temperature"); \
AM("temperature/tint"); \
} \
AM("exposure/exposure"); \
AM("colorbalance/contrast"); \
AM("colorbalance/output saturation");\
AM("vibrancergb/amount"); \
AM("clipping/angle"); \
AM("denoiseprofile"); \
AM("lens"); \
AM("bilat"); \
#define SQA() \
{ \
g_free(tx); \
tx = NULL; \
tx = dt_util_dstrcat(tx, "1ꬹ1||"); \
if(is_modern) \
{ \
AM("channelmixerrgb/temperature"); \
} \
else \
{ \
AM("temperature/temperature"); \
AM("temperature/tint"); \
} \
AM("exposure/exposure"); \
AM("colorbalance/contrast"); \
AM("colorbalance/output saturation"); \
AM("vibrancergb/amount"); \
AM("clipping/angle"); \
AM("denoiseprofile"); \
AM("lens"); \
AM("bilat"); \
}

// start module group
Expand Down

0 comments on commit 80c588f

Please sign in to comment.