@@ -4349,6 +4349,16 @@ static gboolean area_motion_notify(GtkWidget *widget, GdkEventMotion *event, dt_
43494349 }
43504350}
43514351
4352+ static void _tab_switch (GtkNotebook * notebook , GtkWidget * page , guint page_num , GtkWidget * area )
4353+ {
4354+ if (page_num == 1 || page_num == 4 ) return ;
4355+
4356+ g_object_ref (area );
4357+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (area )), area );
4358+ gtk_box_pack_end (GTK_BOX (page ), area , TRUE, TRUE, 0 );
4359+ g_object_unref (area );
4360+ }
4361+
43524362void gui_init (dt_iop_module_t * self )
43534363{
43544364 dt_iop_filmicrgb_gui_data_t * g = IOP_GUI_ALLOC (filmicrgb );
@@ -4374,9 +4384,16 @@ void gui_init(dt_iop_module_t *self)
43744384 static struct dt_action_def_t notebook_def = { };
43754385 g -> notebook = dt_ui_notebook_new (& notebook_def );
43764386 dt_action_define_iop (self , NULL , N_ ("page" ), GTK_WIDGET (g -> notebook ), & notebook_def );
4387+ GtkSizeGroup * group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL );
43774388
43784389 // Page SCENE
4379- self -> widget = dt_ui_notebook_page (g -> notebook , N_ ("scene" ), NULL );
4390+ GtkWidget * page = dt_ui_notebook_page (g -> notebook , N_ ("scene" ), NULL );
4391+
4392+ self -> widget = gtk_box_new (GTK_ORIENTATION_VERTICAL , 0 );
4393+ gtk_size_group_add_widget (group , self -> widget );
4394+ gtk_box_pack_start (GTK_BOX (page ), GTK_WIDGET (self -> widget ), FALSE, FALSE, 0 );
4395+
4396+ gtk_box_pack_end (GTK_BOX (page ), GTK_WIDGET (g -> area ), TRUE, TRUE, 0 );
43804397
43814398 g -> grey_point_source
43824399 = dt_color_picker_new (self , DT_COLOR_PICKER_AREA | DT_COLOR_PICKER_DENOISE ,
@@ -4499,7 +4516,11 @@ void gui_init(dt_iop_module_t *self)
44994516 "decrease if you see magenta or out-of-gamut highlights." ));
45004517
45014518 // Page LOOK
4502- self -> widget = dt_ui_notebook_page (g -> notebook , N_ ("look" ), NULL );
4519+ page = dt_ui_notebook_page (g -> notebook , N_ ("look" ), NULL );
4520+
4521+ self -> widget = gtk_box_new (GTK_ORIENTATION_VERTICAL , 0 );
4522+ gtk_size_group_add_widget (group , self -> widget );
4523+ gtk_box_pack_start (GTK_BOX (page ), GTK_WIDGET (self -> widget ), FALSE, FALSE, 0 );
45034524
45044525 g -> contrast = dt_bauhaus_slider_from_params (self , N_ ("contrast" ));
45054526 dt_bauhaus_slider_set_soft_range (g -> contrast , 0.5 , 3.0 );
@@ -4537,7 +4558,11 @@ void gui_init(dt_iop_module_t *self)
45374558 "increase if shadows and/or highlights are under-saturated." ));
45384559
45394560 // Page DISPLAY
4540- self -> widget = dt_ui_notebook_page (g -> notebook , N_ ("display" ), NULL );
4561+ page = dt_ui_notebook_page (g -> notebook , N_ ("display" ), NULL );
4562+
4563+ self -> widget = gtk_box_new (GTK_ORIENTATION_VERTICAL , 0 );
4564+ gtk_size_group_add_widget (group , self -> widget );
4565+ gtk_box_pack_start (GTK_BOX (page ), GTK_WIDGET (self -> widget ), FALSE, FALSE, 0 );
45414566
45424567 // Black slider
45434568 g -> black_point_target = dt_bauhaus_slider_from_params (self , "black_point_target" );
@@ -4560,6 +4585,17 @@ void gui_init(dt_iop_module_t *self)
45604585 gtk_widget_set_tooltip_text (g -> white_point_target , _ ("luminance of output pure white, "
45614586 "this should be 100%\nexcept if you want a faded look" ));
45624587
4588+ // Curve type
4589+ g -> highlights = dt_bauhaus_combobox_from_params (self , "highlights" );
4590+ gtk_widget_set_tooltip_text (g -> highlights , _ ("choose the desired curvature of the filmic spline in highlights.\n"
4591+ "hard uses a high curvature resulting in more tonal compression.\n"
4592+ "soft uses a low curvature resulting in less tonal compression." ));
4593+
4594+ g -> shadows = dt_bauhaus_combobox_from_params (self , "shadows" );
4595+ gtk_widget_set_tooltip_text (g -> shadows , _ ("choose the desired curvature of the filmic spline in shadows.\n"
4596+ "hard uses a high curvature resulting in more tonal compression.\n"
4597+ "soft uses a low curvature resulting in less tonal compression." ));
4598+
45634599 // Page OPTIONS
45644600 self -> widget = dt_ui_notebook_page (g -> notebook , N_ ("options" ), NULL );
45654601
@@ -4577,17 +4613,6 @@ void gui_init(dt_iop_module_t *self)
45774613 const int pos = dt_bauhaus_combobox_get_from_value (g -> preserve_color , DT_FILMIC_METHOD_EUCLIDEAN_NORM_V1 );
45784614 dt_bauhaus_combobox_remove_at (g -> preserve_color , pos );
45794615
4580- // Curve type
4581- g -> highlights = dt_bauhaus_combobox_from_params (self , "highlights" );
4582- gtk_widget_set_tooltip_text (g -> highlights , _ ("choose the desired curvature of the filmic spline in highlights.\n"
4583- "hard uses a high curvature resulting in more tonal compression.\n"
4584- "soft uses a low curvature resulting in less tonal compression." ));
4585-
4586- g -> shadows = dt_bauhaus_combobox_from_params (self , "shadows" );
4587- gtk_widget_set_tooltip_text (g -> shadows , _ ("choose the desired curvature of the filmic spline in shadows.\n"
4588- "hard uses a high curvature resulting in more tonal compression.\n"
4589- "soft uses a low curvature resulting in less tonal compression." ));
4590-
45914616 g -> custom_grey = dt_bauhaus_toggle_from_params (self , "custom_grey" );
45924617 gtk_widget_set_tooltip_text (g -> custom_grey ,
45934618 /* xgettext:no-c-format */
@@ -4622,7 +4647,9 @@ void gui_init(dt_iop_module_t *self)
46224647 "this is useful to match natural sensor noise pattern." ));
46234648
46244649 // start building top level widget
4625- self -> widget = dt_gui_vbox (g -> area , g -> notebook );
4650+ g_signal_connect (G_OBJECT (g -> notebook ), "switch_page" , G_CALLBACK (_tab_switch ), g -> area );
4651+ g_object_unref (group );
4652+ self -> widget = dt_gui_vbox (g -> notebook );
46264653}
46274654
46284655void gui_changed (dt_iop_module_t * self , GtkWidget * w , void * previous )
0 commit comments