@@ -2552,20 +2552,17 @@ static void _restore_clicked(GtkButton *button, gpointer user_data)
25522552 NULL );
25532553 gtk_dialog_set_default_response (GTK_DIALOG (dialog ), GTK_RESPONSE_REJECT );
25542554
2555- GtkContainer * content_area =
2556- GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog )));
25572555 GtkWidget * label = gtk_label_new (_ ("restore shortcuts from one of these states:\n"
25582556 " - default\n"
25592557 " - as at startup\n"
25602558 " - as when opening this dialog\n" ));
25612559 gtk_widget_set_halign (label , GTK_ALIGN_START );
2562- gtk_container_add (content_area , label );
25632560 GtkWidget * clear = gtk_check_button_new_with_label
25642561 (_ ("clear all newer shortcuts\n"
25652562 "(instead of just restoring changed ones)" ));
2566- gtk_container_add ( content_area , clear );
2563+ dt_gui_dialog_add ( GTK_DIALOG ( dialog ), label , clear );
25672564
2568- gtk_widget_show_all (GTK_WIDGET ( content_area ) );
2565+ gtk_widget_show_all (dialog );
25692566
25702567 const int resp = gtk_dialog_run (GTK_DIALOG (dialog ));
25712568 const gboolean wipe = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (clear ));
@@ -2635,38 +2632,28 @@ static void _export_clicked(GtkButton *button, gpointer user_data)
26352632 NULL );
26362633 gtk_dialog_set_default_response (GTK_DIALOG (dialog ), GTK_RESPONSE_REJECT );
26372634
2638- GtkContainer * content_area =
2639- GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog )));
26402635 GtkWidget * label = gtk_label_new (_ ("export all shortcuts to a file\n"
26412636 "or just for one selected device\n" ));
26422637 gtk_widget_set_halign (label , GTK_ALIGN_START );
2643- gtk_container_add (content_area , label );
26442638
26452639 GtkWidget * combo_dev = gtk_combo_box_text_new ();
26462640 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("all" ));
26472641 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("keyboard" ));
26482642 for (GSList * driver = darktable .control -> input_drivers ; driver ; driver = driver -> next )
26492643 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ),
26502644 ((dt_input_driver_definition_t * )driver -> data )-> name );
2651- gtk_container_add (content_area , combo_dev );
2652-
2653- GtkWidget * device_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
26542645
26552646 GtkWidget * combo_id = gtk_combo_box_text_new ();
26562647 for (gchar num [] = "0" ; * num <= '9' ; (* num )++ )
26572648 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_id ), num );
2658- gtk_container_add (GTK_CONTAINER (device_box ), combo_id );
2659- gtk_container_add (GTK_CONTAINER (device_box ), dt_ui_label_new (_ ("device id" )));
2660-
2661- gtk_container_add (content_area , device_box );
2662-
26632649 GtkWidget * count = gtk_label_new ("" );
2664- gtk_container_add (content_area , count );
2665-
26662650 g_signal_connect (combo_dev , "changed" , G_CALLBACK (_import_export_dev_changed ), combo_id );
26672651 g_signal_connect (combo_id , "changed" , G_CALLBACK (_export_id_changed ), count );
26682652
2669- gtk_widget_show_all (GTK_WIDGET (content_area ));
2653+ dt_gui_dialog_add (GTK_DIALOG (dialog ), label , combo_dev ,
2654+ dt_gui_hbox (combo_id , dt_ui_label_new (_ ("device id" ))),
2655+ count );
2656+ gtk_widget_show_all (dialog );
26702657
26712658 gtk_combo_box_set_active (GTK_COMBO_BOX (combo_dev ), 0 );
26722659
@@ -2717,20 +2704,16 @@ static void _import_clicked(GtkButton *button, gpointer user_data)
27172704 NULL );
27182705 gtk_dialog_set_default_response (GTK_DIALOG (dialog ), GTK_RESPONSE_REJECT );
27192706
2720- GtkContainer * content_area =
2721- GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog )));
27222707 GtkWidget * label = gtk_label_new (_ ("import all shortcuts from a file\n"
27232708 "or just for one selected device\n" ));
27242709 gtk_widget_set_halign (label , GTK_ALIGN_START );
2725- gtk_container_add (content_area , label );
27262710
27272711 GtkWidget * combo_dev = gtk_combo_box_text_new ();
27282712 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("all" ));
27292713 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("keyboard" ));
27302714 for (GSList * driver = darktable .control -> input_drivers ; driver ; driver = driver -> next )
27312715 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ),
27322716 ((dt_input_driver_definition_t * )driver -> data )-> name );
2733- gtk_container_add (content_area , combo_dev );
27342717
27352718 GtkWidget * device_grid = gtk_grid_new ();
27362719
@@ -2746,16 +2729,15 @@ static void _import_clicked(GtkButton *button, gpointer user_data)
27462729 gtk_grid_attach (GTK_GRID (device_grid ), combo_to_id , 0 , 1 , 1 , 1 );
27472730 gtk_grid_attach (GTK_GRID (device_grid ), dt_ui_label_new (_ ("id when loaded" )), 1 , 1 , 1 , 1 );
27482731
2749- gtk_container_add (content_area , device_grid );
27502732
27512733 GtkWidget * clear = gtk_check_button_new_with_label (_ ("clear device first" ));
2752- gtk_container_add (content_area , clear );
27532734
27542735 g_signal_connect (combo_dev , "changed" , G_CALLBACK (_import_export_dev_changed ),
27552736 combo_from_id );
27562737 g_signal_connect (combo_from_id , "changed" , G_CALLBACK (_import_id_changed ), combo_to_id );
27572738
2758- gtk_widget_show_all (GTK_WIDGET (content_area ));
2739+ dt_gui_dialog_add (GTK_DIALOG (dialog ), label , combo_dev , device_grid , clear );
2740+ gtk_widget_show_all (dialog );
27592741
27602742 gtk_combo_box_set_active (GTK_COMBO_BOX (combo_dev ), 0 );
27612743
@@ -2929,11 +2911,8 @@ GtkWidget *dt_shortcuts_prefs(GtkWidget *widget)
29292911 _add_prefs_column (shortcuts_view , renderer , _ ("instance" ), SHORTCUT_VIEW_INSTANCE );
29302912
29312913 // Adding the shortcuts treeview to its containers
2932- GtkWidget * scroll = gtk_scrolled_window_new ( NULL , NULL );
2914+ GtkWidget * scroll = dt_gui_scroll_wrap ( GTK_WIDGET ( shortcuts_view ) );
29332915 gtk_widget_set_size_request (scroll , -1 , 100 );
2934- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll ),
2935- GTK_POLICY_AUTOMATIC , GTK_POLICY_AUTOMATIC );
2936- gtk_container_add (GTK_CONTAINER (scroll ), GTK_WIDGET (shortcuts_view ));
29372916 gtk_paned_pack2 (GTK_PANED (container ), scroll , TRUE, FALSE);
29382917
29392918 // Creating the action selection treeview
@@ -3010,11 +2989,8 @@ GtkWidget *dt_shortcuts_prefs(GtkWidget *widget)
30102989 gtk_tree_view_append_column (GTK_TREE_VIEW (actions_view ), column );
30112990
30122991 // Adding the action treeview to its containers
3013- scroll = gtk_scrolled_window_new ( NULL , NULL );
2992+ scroll = dt_gui_scroll_wrap ( GTK_WIDGET ( actions_view ) );
30142993 gtk_widget_set_size_request (scroll , -1 , 100 );
3015- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll ),
3016- GTK_POLICY_AUTOMATIC , GTK_POLICY_AUTOMATIC );
3017- gtk_container_add (GTK_CONTAINER (scroll ), GTK_WIDGET (actions_view ));
30182994 gtk_paned_pack1 (GTK_PANED (container ), scroll , TRUE, FALSE);
30192995
30202996 if (found_iter .user_data )
0 commit comments