@@ -2549,20 +2549,17 @@ static void _restore_clicked(GtkButton *button, gpointer user_data)
25492549 NULL );
25502550 gtk_dialog_set_default_response (GTK_DIALOG (dialog ), GTK_RESPONSE_REJECT );
25512551
2552- GtkContainer * content_area =
2553- GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog )));
25542552 GtkWidget * label = gtk_label_new (_ ("restore shortcuts from one of these states:\n"
25552553 " - default\n"
25562554 " - as at startup\n"
25572555 " - as when opening this dialog\n" ));
25582556 gtk_widget_set_halign (label , GTK_ALIGN_START );
2559- gtk_container_add (content_area , label );
25602557 GtkWidget * clear = gtk_check_button_new_with_label
25612558 (_ ("clear all newer shortcuts\n"
25622559 "(instead of just restoring changed ones)" ));
2563- gtk_container_add ( content_area , clear );
2560+ dt_gui_dialog_add ( GTK_DIALOG ( dialog ), label , clear );
25642561
2565- gtk_widget_show_all (GTK_WIDGET ( content_area ) );
2562+ gtk_widget_show_all (dialog );
25662563
25672564 const int resp = gtk_dialog_run (GTK_DIALOG (dialog ));
25682565 const gboolean wipe = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (clear ));
@@ -2632,38 +2629,28 @@ static void _export_clicked(GtkButton *button, gpointer user_data)
26322629 NULL );
26332630 gtk_dialog_set_default_response (GTK_DIALOG (dialog ), GTK_RESPONSE_REJECT );
26342631
2635- GtkContainer * content_area =
2636- GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog )));
26372632 GtkWidget * label = gtk_label_new (_ ("export all shortcuts to a file\n"
26382633 "or just for one selected device\n" ));
26392634 gtk_widget_set_halign (label , GTK_ALIGN_START );
2640- gtk_container_add (content_area , label );
26412635
26422636 GtkWidget * combo_dev = gtk_combo_box_text_new ();
26432637 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("all" ));
26442638 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("keyboard" ));
26452639 for (GSList * driver = darktable .control -> input_drivers ; driver ; driver = driver -> next )
26462640 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ),
26472641 ((dt_input_driver_definition_t * )driver -> data )-> name );
2648- gtk_container_add (content_area , combo_dev );
2649-
2650- GtkWidget * device_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL , 0 );
26512642
26522643 GtkWidget * combo_id = gtk_combo_box_text_new ();
26532644 for (gchar num [] = "0" ; * num <= '9' ; (* num )++ )
26542645 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_id ), num );
2655- gtk_container_add (GTK_CONTAINER (device_box ), combo_id );
2656- gtk_container_add (GTK_CONTAINER (device_box ), dt_ui_label_new (_ ("device id" )));
2657-
2658- gtk_container_add (content_area , device_box );
2659-
26602646 GtkWidget * count = gtk_label_new ("" );
2661- gtk_container_add (content_area , count );
2662-
26632647 g_signal_connect (combo_dev , "changed" , G_CALLBACK (_import_export_dev_changed ), combo_id );
26642648 g_signal_connect (combo_id , "changed" , G_CALLBACK (_export_id_changed ), count );
26652649
2666- gtk_widget_show_all (GTK_WIDGET (content_area ));
2650+ dt_gui_dialog_add (GTK_DIALOG (dialog ), label , combo_dev ,
2651+ dt_gui_hbox (combo_id , dt_ui_label_new (_ ("device id" ))),
2652+ count );
2653+ gtk_widget_show_all (dialog );
26672654
26682655 gtk_combo_box_set_active (GTK_COMBO_BOX (combo_dev ), 0 );
26692656
@@ -2714,20 +2701,16 @@ static void _import_clicked(GtkButton *button, gpointer user_data)
27142701 NULL );
27152702 gtk_dialog_set_default_response (GTK_DIALOG (dialog ), GTK_RESPONSE_REJECT );
27162703
2717- GtkContainer * content_area =
2718- GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog )));
27192704 GtkWidget * label = gtk_label_new (_ ("import all shortcuts from a file\n"
27202705 "or just for one selected device\n" ));
27212706 gtk_widget_set_halign (label , GTK_ALIGN_START );
2722- gtk_container_add (content_area , label );
27232707
27242708 GtkWidget * combo_dev = gtk_combo_box_text_new ();
27252709 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("all" ));
27262710 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ), _ ("keyboard" ));
27272711 for (GSList * driver = darktable .control -> input_drivers ; driver ; driver = driver -> next )
27282712 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dev ),
27292713 ((dt_input_driver_definition_t * )driver -> data )-> name );
2730- gtk_container_add (content_area , combo_dev );
27312714
27322715 GtkWidget * device_grid = gtk_grid_new ();
27332716
@@ -2743,16 +2726,15 @@ static void _import_clicked(GtkButton *button, gpointer user_data)
27432726 gtk_grid_attach (GTK_GRID (device_grid ), combo_to_id , 0 , 1 , 1 , 1 );
27442727 gtk_grid_attach (GTK_GRID (device_grid ), dt_ui_label_new (_ ("id when loaded" )), 1 , 1 , 1 , 1 );
27452728
2746- gtk_container_add (content_area , device_grid );
27472729
27482730 GtkWidget * clear = gtk_check_button_new_with_label (_ ("clear device first" ));
2749- gtk_container_add (content_area , clear );
27502731
27512732 g_signal_connect (combo_dev , "changed" , G_CALLBACK (_import_export_dev_changed ),
27522733 combo_from_id );
27532734 g_signal_connect (combo_from_id , "changed" , G_CALLBACK (_import_id_changed ), combo_to_id );
27542735
2755- gtk_widget_show_all (GTK_WIDGET (content_area ));
2736+ dt_gui_dialog_add (GTK_DIALOG (dialog ), label , combo_dev , device_grid , clear );
2737+ gtk_widget_show_all (dialog );
27562738
27572739 gtk_combo_box_set_active (GTK_COMBO_BOX (combo_dev ), 0 );
27582740
@@ -2926,11 +2908,8 @@ GtkWidget *dt_shortcuts_prefs(GtkWidget *widget)
29262908 _add_prefs_column (shortcuts_view , renderer , _ ("instance" ), SHORTCUT_VIEW_INSTANCE );
29272909
29282910 // Adding the shortcuts treeview to its containers
2929- GtkWidget * scroll = gtk_scrolled_window_new ( NULL , NULL );
2911+ GtkWidget * scroll = dt_gui_scroll_wrap ( GTK_WIDGET ( shortcuts_view ) );
29302912 gtk_widget_set_size_request (scroll , -1 , 100 );
2931- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll ),
2932- GTK_POLICY_AUTOMATIC , GTK_POLICY_AUTOMATIC );
2933- gtk_container_add (GTK_CONTAINER (scroll ), GTK_WIDGET (shortcuts_view ));
29342913 gtk_paned_pack2 (GTK_PANED (container ), scroll , TRUE, FALSE);
29352914
29362915 // Creating the action selection treeview
@@ -3007,11 +2986,8 @@ GtkWidget *dt_shortcuts_prefs(GtkWidget *widget)
30072986 gtk_tree_view_append_column (GTK_TREE_VIEW (actions_view ), column );
30082987
30092988 // Adding the action treeview to its containers
3010- scroll = gtk_scrolled_window_new ( NULL , NULL );
2989+ scroll = dt_gui_scroll_wrap ( GTK_WIDGET ( actions_view ) );
30112990 gtk_widget_set_size_request (scroll , -1 , 100 );
3012- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scroll ),
3013- GTK_POLICY_AUTOMATIC , GTK_POLICY_AUTOMATIC );
3014- gtk_container_add (GTK_CONTAINER (scroll ), GTK_WIDGET (actions_view ));
30152991 gtk_paned_pack1 (GTK_PANED (container ), scroll , TRUE, FALSE);
30162992
30172993 if (found_iter .user_data )
0 commit comments