Skip to content

Commit

Permalink
Negadoctor: remember last selected notebook page
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiyone authored and aurelienpierre committed Jan 21, 2025
1 parent 9058542 commit ca065e9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/anselconfig.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -1833,6 +1833,12 @@
<type>int</type>
<default>0</default>
<shortdescription>last page selected in channel mixer rgb notebook</shortdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/negadoctor/gui_page</name>
<type>int</type>
<default>0</default>
<shortdescription>last page selected in negadoctor notebook</shortdescription>
</dtconfig>
<dtconfig>
<name>plugins/darkroom/retouch/default_algo</name>
Expand Down
9 changes: 9 additions & 0 deletions src/iop/negadoctor.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,17 @@ void gui_init(dt_iop_module_t *self)
gtk_widget_set_tooltip_text(g->film_stock, _("toggle on or off the color controls"));

gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->notebook), FALSE, FALSE, 0);
const int active_page = dt_conf_get_int("plugins/darkroom/negadoctor/gui_page");
gtk_widget_show(gtk_notebook_get_nth_page(g->notebook, active_page));
gtk_notebook_set_current_page(g->notebook, active_page);

}

void gui_cleanup(struct dt_iop_module_t *self)
{
dt_iop_negadoctor_gui_data_t *g = (dt_iop_negadoctor_gui_data_t *)self->gui_data;
dt_conf_set_int("plugins/darkroom/negadoctor/gui_page", gtk_notebook_get_current_page (g->notebook));
}

void gui_changed(dt_iop_module_t *self, GtkWidget *w, void *previous)
{
Expand Down

0 comments on commit ca065e9

Please sign in to comment.