From 4df6ddad54d2cb6ebfdcbf2b6fee35ec4fa760b9 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Sun, 9 Oct 2016 02:32:00 +0200 Subject: [PATCH] API: container: Remove gtk_container_set_border_width() --- demos/gtk-demo/assistant.c | 2 - demos/gtk-demo/blendmodes.ui | 1 - demos/gtk-demo/button_box.c | 5 - demos/gtk-demo/changedisplay.c | 2 - demos/gtk-demo/clipboard.c | 4 - demos/gtk-demo/colorsel.c | 3 - demos/gtk-demo/combobox.c | 6 - demos/gtk-demo/dialog.c | 4 - demos/gtk-demo/drawingarea.c | 3 - demos/gtk-demo/editable_cells.c | 1 - demos/gtk-demo/entry_buffer.c | 1 - demos/gtk-demo/entry_completion.c | 1 - demos/gtk-demo/glarea.c | 1 - demos/gtk-demo/hypertext.c | 2 - demos/gtk-demo/images.c | 3 - demos/gtk-demo/infobar.c | 2 - demos/gtk-demo/links.c | 1 - demos/gtk-demo/list_store.c | 1 - demos/gtk-demo/menus.c | 3 - demos/gtk-demo/offscreen_window.c | 33 +-- demos/gtk-demo/offscreen_window2.c | 33 +-- demos/gtk-demo/panes.c | 3 - demos/gtk-demo/pickers.c | 4 - demos/gtk-demo/popover.c | 2 - demos/gtk-demo/revealer.ui | 1 - demos/gtk-demo/scale.ui | 1 - demos/gtk-demo/search_entry.c | 2 - demos/gtk-demo/search_entry2.c | 3 - demos/gtk-demo/sizegroup.c | 3 - demos/gtk-demo/spinner.c | 1 - demos/gtk-demo/textview.c | 2 - demos/gtk-demo/theming_style_classes.c | 1 - demos/gtk-demo/toolpalette.c | 5 - demos/gtk-demo/transparent.c | 1 - demos/gtk-demo/tree_store.c | 1 - demos/widget-factory/widget-factory.ui | 3 - docs/reference/gtk/gtk4-sections.txt | 3 - docs/tools/widgets.c | 6 - examples/action-namespace.c | 1 - examples/builder.ui | 1 - examples/drawing.c | 2 - examples/grid-packing.c | 1 - examples/plugman.c | 1 - gtk/deprecated/gtkalignment.c | 21 +- gtk/deprecated/gtktable.c | 1 - gtk/gtk-builder-tool.c | 2 - gtk/gtkappchooserdialog.c | 48 +--- gtk/gtkapplicationwindow.c | 12 +- gtk/gtkbbox.c | 1 - gtk/gtkbin.c | 45 +--- gtk/gtkbox.c | 1 - gtk/gtkbuilder.c | 2 - gtk/gtkbutton.c | 4 - gtk/gtkcombobox.c | 2 - gtk/gtkcontainer.c | 248 ------------------ gtk/gtkcontainer.h | 11 +- gtk/gtkcontainerprivate.h | 3 - gtk/gtkcustompaperunixdialog.c | 9 +- gtk/gtkdialog.c | 51 ---- gtk/gtkentry.c | 1 - gtk/gtkeventbox.c | 3 - gtk/gtkfilechooserwidget.c | 3 - gtk/gtkfixed.c | 1 - gtk/gtkflowbox.c | 1 - gtk/gtkframe.c | 2 - gtk/gtkgrid.c | 1 - gtk/gtkheaderbar.c | 1 - gtk/gtkmenu.c | 77 ++---- gtk/gtkmenubar.c | 3 - gtk/gtkmenuitem.c | 2 - gtk/gtkmessagedialog.c | 34 --- gtk/gtkmountoperation.c | 4 - gtk/gtknotebook.c | 2 - gtk/gtkoffscreenwindow.c | 25 +- gtk/gtkpaned.c | 1 - gtk/gtkpathbar.c | 1 - gtk/gtkplacesview.c | 1 - gtk/gtkpopover.c | 11 +- gtk/gtkrecentchooserdialog.c | 8 +- gtk/gtkscrolledwindow.c | 1 - gtk/gtkshortcutssection.c | 1 - gtk/gtkshortcutswindow.c | 2 - gtk/gtkspinbutton.c | 2 - gtk/gtkstack.c | 1 - gtk/gtktextview.c | 17 +- gtk/gtktoolbar.c | 2 - gtk/gtktoolitem.c | 2 - gtk/gtktoolitemgroup.c | 44 ++-- gtk/gtktoolpalette.c | 29 +- gtk/gtktreeview.c | 1 - gtk/gtkviewport.c | 1 - gtk/gtkwindow.c | 43 +-- gtk/ui/gtkaboutdialog.ui | 3 - gtk/ui/gtkcolorchooserdialog.ui | 2 - gtk/ui/gtkdialog.ui | 1 - gtk/ui/gtkfilechooserdialog.ui | 2 - gtk/ui/gtkfilechooserwidget.ui | 3 - gtk/ui/gtkfontchooserdialog.ui | 2 - gtk/ui/gtkinfobar.ui | 3 - gtk/ui/gtkmessagedialog.ui | 1 - gtk/ui/gtkpagesetupunixdialog.ui | 2 - gtk/ui/gtkplacesview.ui | 2 - gtk/ui/gtkprintunixdialog.ui | 8 - gtk/ui/gtksearchbar.ui | 1 - tests/gdkgears.c | 2 - tests/gtkoffscreenbox.c | 32 +-- tests/print-editor.c | 1 - tests/simple.c | 1 - tests/testadjustsize.c | 27 -- tests/testanimation.c | 6 - tests/testappchooser.c | 1 - tests/testappchooserbutton.c | 1 - tests/testcalendar.c | 1 - tests/testcellrenderertext.c | 1 - tests/testcombo.c | 12 - tests/testcombochange.c | 1 - tests/testellipsise.c | 1 - tests/testemblems.c | 1 - tests/testentrycompletion.c | 3 - tests/testentryicons.c | 1 - tests/testfilechooserbutton.c | 1 - tests/testflowbox.c | 2 - tests/testfontoptions.c | 1 - tests/testframe.c | 1 - tests/testglarea.c | 1 - tests/testglblending.c | 1 - tests/testgtk.c | 115 -------- tests/testheightforwidth.c | 5 - tests/testkineticscrolling.c | 1 - tests/testlockbutton.c | 1 - tests/testmenubutton.c | 1 - tests/testmerge.c | 3 - tests/testmultidisplay.c | 3 +- tests/testnotebookdnd.c | 3 - tests/testrichtext.c | 1 - tests/testscrolledwindow.c | 4 +- tests/testselection.c | 2 - tests/testswitch.c | 1 - tests/testtoolbar.c | 3 - tests/testtooltips.c | 1 - tests/testtreecolumns.c | 1 - tests/testtreecolumnsizing.c | 1 - tests/testtreeflow.c | 1 - tests/testtreefocus.c | 2 - tests/testtreesort.c | 3 - tests/testwindowsize.c | 1 - tests/treestoretest.c | 1 - testsuite/gtk/builder.c | 5 - testsuite/reftests/background-area.ref.ui | 1 - testsuite/reftests/background-area.ui | 1 - .../reftests/background-image-multiple.ref.ui | 1 - .../reftests/background-image-multiple.ui | 1 - testsuite/reftests/background-origin.ui | 1 - testsuite/reftests/info-bar-message-types.ui | 10 - .../messagedialog-secondarytext.ref.ui | 1 - .../reftests/messagedialog-secondarytext.ui | 1 - testsuite/reftests/window-border-width.ref.ui | 1 - testsuite/reftests/window-border-width.ui | 1 - .../reftests/window-height-for-width.ref.ui | 1 - testsuite/reftests/window-height-for-width.ui | 1 - 160 files changed, 131 insertions(+), 1127 deletions(-) diff --git a/demos/gtk-demo/assistant.c b/demos/gtk-demo/assistant.c index 22b19bc829..22b2cb4ae9 100644 --- a/demos/gtk-demo/assistant.c +++ b/demos/gtk-demo/assistant.c @@ -94,7 +94,6 @@ create_page1 (GtkWidget *assistant) GtkWidget *box, *label, *entry; box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); - gtk_container_set_border_width (GTK_CONTAINER (box), 12); label = gtk_label_new ("You must fill out this entry to continue:"); gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE); @@ -118,7 +117,6 @@ create_page2 (GtkWidget *assistant) GtkWidget *box, *checkbutton; box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - gtk_container_set_border_width (GTK_CONTAINER (box), 12); checkbutton = gtk_check_button_new_with_label ("This is optional data, you may continue " "even if you do not check this"); diff --git a/demos/gtk-demo/blendmodes.ui b/demos/gtk-demo/blendmodes.ui index 02dc736503..fb5b5b7541 100644 --- a/demos/gtk-demo/blendmodes.ui +++ b/demos/gtk-demo/blendmodes.ui @@ -11,7 +11,6 @@ True False - 12 12 12 diff --git a/demos/gtk-demo/button_box.c b/demos/gtk-demo/button_box.c index be4e03353d..d5182b08a1 100644 --- a/demos/gtk-demo/button_box.c +++ b/demos/gtk-demo/button_box.c @@ -23,7 +23,6 @@ create_bbox (gint horizontal, else bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL); - gtk_container_set_border_width (GTK_CONTAINER (bbox), 5); gtk_container_add (GTK_CONTAINER (frame), bbox); gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout); @@ -62,8 +61,6 @@ do_button_box (GtkWidget *do_widget) G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), main_vbox); @@ -73,7 +70,6 @@ do_button_box (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (main_vbox), frame_horz, TRUE, TRUE); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 10); gtk_container_add (GTK_CONTAINER (frame_horz), vbox); gtk_box_pack_start (GTK_BOX (vbox), @@ -104,7 +100,6 @@ do_button_box (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (main_vbox), frame_vert, TRUE, TRUE); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 10); gtk_container_add (GTK_CONTAINER (frame_vert), hbox); gtk_box_pack_start (GTK_BOX (hbox), diff --git a/demos/gtk-demo/changedisplay.c b/demos/gtk-demo/changedisplay.c index c8a4487eaf..6a066e2fc2 100644 --- a/demos/gtk-demo/changedisplay.c +++ b/demos/gtk-demo/changedisplay.c @@ -305,7 +305,6 @@ create_frame (ChangeDisplayInfo *info, *frame = gtk_frame_new (title); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_container_add (GTK_CONTAINER (*frame), hbox); scrollwin = gtk_scrolled_window_new (NULL, NULL); @@ -539,7 +538,6 @@ do_changedisplay (GtkWidget *do_widget) content_area = gtk_dialog_get_content_area (GTK_DIALOG (info->window)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE); frame = create_display_frame (info); diff --git a/demos/gtk-demo/clipboard.c b/demos/gtk-demo/clipboard.c index 8e31c5185b..e3ca3ea942 100644 --- a/demos/gtk-demo/clipboard.c +++ b/demos/gtk-demo/clipboard.c @@ -219,7 +219,6 @@ do_clipboard (GtkWidget *do_widget) G_CALLBACK (gtk_widget_destroyed), &window); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); @@ -228,7 +227,6 @@ do_clipboard (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE); /* Create the first entry */ @@ -245,7 +243,6 @@ do_clipboard (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE); /* Create the second entry */ @@ -262,7 +259,6 @@ do_clipboard (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE); /* Create the first image */ diff --git a/demos/gtk-demo/colorsel.c b/demos/gtk-demo/colorsel.c index 4df48b634f..b75bb26a02 100644 --- a/demos/gtk-demo/colorsel.c +++ b/demos/gtk-demo/colorsel.c @@ -74,10 +74,7 @@ do_colorsel (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); /* diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c index 09d50e49cb..6ebac749a3 100644 --- a/demos/gtk-demo/combobox.c +++ b/demos/gtk-demo/combobox.c @@ -318,8 +318,6 @@ do_combobox (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 2); gtk_container_add (GTK_CONTAINER (window), vbox); @@ -330,7 +328,6 @@ do_combobox (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); model = create_icon_store (); @@ -371,7 +368,6 @@ do_combobox (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); model = create_capital_store (); @@ -399,7 +395,6 @@ do_combobox (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); combo = gtk_combo_box_text_new_with_entry (); @@ -417,7 +412,6 @@ do_combobox (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_container_set_border_width (GTK_CONTAINER (box), 5); gtk_container_add (GTK_CONTAINER (frame), box); combo = gtk_combo_box_text_new (); diff --git a/demos/gtk-demo/dialog.c b/demos/gtk-demo/dialog.c index a632519717..362e27e1f6 100644 --- a/demos/gtk-demo/dialog.c +++ b/demos/gtk-demo/dialog.c @@ -56,7 +56,6 @@ interactive_dialog_clicked (GtkButton *button, content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 8); gtk_box_pack_start (GTK_BOX (content_area), hbox, FALSE, FALSE); image = gtk_image_new_from_icon_name ("dialog-question", GTK_ICON_SIZE_DIALOG); @@ -114,13 +113,10 @@ do_dialog (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); - frame = gtk_frame_new ("Dialogs"); gtk_container_add (GTK_CONTAINER (window), frame); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (frame), vbox); /* Standard message dialog */ diff --git a/demos/gtk-demo/drawingarea.c b/demos/gtk-demo/drawingarea.c index 8023bb3423..ac031330f0 100644 --- a/demos/gtk-demo/drawingarea.c +++ b/demos/gtk-demo/drawingarea.c @@ -215,10 +215,7 @@ do_drawingarea (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); /* diff --git a/demos/gtk-demo/editable_cells.c b/demos/gtk-demo/editable_cells.c index d6acc49eb7..770091bdc5 100644 --- a/demos/gtk-demo/editable_cells.c +++ b/demos/gtk-demo/editable_cells.c @@ -349,7 +349,6 @@ do_editable_cells (GtkWidget *do_widget) gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Editable Cells"); - gtk_container_set_border_width (GTK_CONTAINER (window), 5); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); diff --git a/demos/gtk-demo/entry_buffer.c b/demos/gtk-demo/entry_buffer.c index ef3e15ee3e..7e7094d21a 100644 --- a/demos/gtk-demo/entry_buffer.c +++ b/demos/gtk-demo/entry_buffer.c @@ -29,7 +29,6 @@ do_entry_buffer (GtkWidget *do_widget) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), diff --git a/demos/gtk-demo/entry_completion.c b/demos/gtk-demo/entry_completion.c index 0ca4cbe5ac..c3bee99de1 100644 --- a/demos/gtk-demo/entry_completion.c +++ b/demos/gtk-demo/entry_completion.c @@ -56,7 +56,6 @@ do_entry_completion (GtkWidget *do_widget) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Completion demo, try writing total or gnome for example."); diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c index b51e4ae1fe..51b848dce0 100644 --- a/demos/gtk-demo/glarea.c +++ b/demos/gtk-demo/glarea.c @@ -393,7 +393,6 @@ create_glarea_window (GtkWidget *do_widget) gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "OpenGL Area"); gtk_window_set_default_size (GTK_WINDOW (window), 400, 600); - gtk_container_set_border_width (GTK_CONTAINER (window), 12); g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE); diff --git a/demos/gtk-demo/hypertext.c b/demos/gtk-demo/hypertext.c index 4a221d8b9d..0aa1b2349c 100644 --- a/demos/gtk-demo/hypertext.c +++ b/demos/gtk-demo/hypertext.c @@ -268,8 +268,6 @@ do_hypertext (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); - view = gtk_text_view_new (); gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (view), GTK_WRAP_WORD); gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 20); diff --git a/demos/gtk-demo/images.c b/demos/gtk-demo/images.c index a3e9c7a0a6..eecb72849e 100644 --- a/demos/gtk-demo/images.c +++ b/demos/gtk-demo/images.c @@ -347,10 +347,7 @@ do_images (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (cleanup_callback), NULL); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); label = gtk_label_new (NULL); diff --git a/demos/gtk-demo/infobar.c b/demos/gtk-demo/infobar.c index 62df74f27a..8dbea04c7f 100644 --- a/demos/gtk-demo/infobar.c +++ b/demos/gtk-demo/infobar.c @@ -59,7 +59,6 @@ do_infobar (GtkWidget *do_widget) gtk_window_set_title (GTK_WINDOW (window), "Info Bars"); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); @@ -132,7 +131,6 @@ do_infobar (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE); vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (vbox2), 8); gtk_container_add (GTK_CONTAINER (frame), vbox2); /* Standard message dialog */ diff --git a/demos/gtk-demo/links.c b/demos/gtk-demo/links.c index 5a39a1a842..c896656ffd 100644 --- a/demos/gtk-demo/links.c +++ b/demos/gtk-demo/links.c @@ -56,7 +56,6 @@ do_links (GtkWidget *do_widget) gtk_window_set_screen (GTK_WINDOW (window), gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Links"); - gtk_container_set_border_width (GTK_CONTAINER (window), 12); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); diff --git a/demos/gtk-demo/list_store.c b/demos/gtk-demo/list_store.c index db065edb44..2fa12ce4af 100644 --- a/demos/gtk-demo/list_store.c +++ b/demos/gtk-demo/list_store.c @@ -262,7 +262,6 @@ do_list_store (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); gtk_container_add (GTK_CONTAINER (window), vbox); diff --git a/demos/gtk-demo/menus.c b/demos/gtk-demo/menus.c index 5537751e87..9fdd35350c 100644 --- a/demos/gtk-demo/menus.c +++ b/demos/gtk-demo/menus.c @@ -105,8 +105,6 @@ do_menus (GtkWidget *do_widget) accel_group = gtk_accel_group_new (); gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); - box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_container_add (GTK_CONTAINER (window), box); gtk_widget_show (box); @@ -138,7 +136,6 @@ do_menus (GtkWidget *do_widget) gtk_widget_show (menuitem); box2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 10); - gtk_container_set_border_width (GTK_CONTAINER (box2), 10); gtk_box_pack_start (GTK_BOX (box1), box2, FALSE, TRUE); gtk_widget_show (box2); diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c index ce5a077339..9480025869 100644 --- a/demos/gtk-demo/offscreen_window.c +++ b/demos/gtk-demo/offscreen_window.c @@ -233,18 +233,16 @@ gtk_rotated_bin_realize (GtkWidget *widget) GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; - guint border_width; GtkRequisition child_requisition; gtk_widget_set_realized (widget, TRUE); gtk_widget_get_allocation (widget, &allocation); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - attributes.x = allocation.x + border_width; - attributes.y = allocation.y + border_width; - attributes.width = allocation.width - 2 * border_width; - attributes.height = allocation.height - 2 * border_width; + attributes.x = allocation.x; + attributes.y = allocation.y; + attributes.width = allocation.width; + attributes.height = allocation.height; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK @@ -383,8 +381,6 @@ gtk_rotated_bin_size_request (GtkWidget *widget, GtkRotatedBin *bin = GTK_ROTATED_BIN (widget); GtkRequisition child_requisition; double s, c; - double w, h; - guint border_width; child_requisition.width = 0; child_requisition.height = 0; @@ -395,12 +391,8 @@ gtk_rotated_bin_size_request (GtkWidget *widget, s = sin (bin->angle); c = cos (bin->angle); - w = c * child_requisition.width + s * child_requisition.height; - h = s * child_requisition.width + c * child_requisition.height; - - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - requisition->width = border_width * 2 + w; - requisition->height = border_width * 2 + h; + requisition->width = c * child_requisition.width + s * child_requisition.height; + requisition->height = s * child_requisition.width + c * child_requisition.height; } static void @@ -432,21 +424,18 @@ gtk_rotated_bin_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkRotatedBin *bin = GTK_ROTATED_BIN (widget); - guint border_width; gint w, h; gdouble s, c; gtk_widget_set_allocation (widget, allocation); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - - w = allocation->width - border_width * 2; - h = allocation->height - border_width * 2; + w = allocation->width; + h = allocation->height; if (gtk_widget_get_realized (widget)) gdk_window_move_resize (gtk_widget_get_window (widget), - allocation->x + border_width, - allocation->y + border_width, + allocation->x, + allocation->y, w, h); if (bin->child && gtk_widget_get_visible (bin->child)) @@ -577,8 +566,6 @@ do_offscreen_window (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL, 0, G_PI/2, 0.01); diff --git a/demos/gtk-demo/offscreen_window2.c b/demos/gtk-demo/offscreen_window2.c index ce91040ee7..06c4a0aa15 100644 --- a/demos/gtk-demo/offscreen_window2.c +++ b/demos/gtk-demo/offscreen_window2.c @@ -172,18 +172,16 @@ gtk_mirror_bin_realize (GtkWidget *widget) GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; - guint border_width; GtkRequisition child_requisition; gtk_widget_set_realized (widget, TRUE); gtk_widget_get_allocation (widget, &allocation); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - attributes.x = allocation.x + border_width; - attributes.y = allocation.y + border_width; - attributes.width = allocation.width - 2 * border_width; - attributes.height = allocation.height - 2 * border_width; + attributes.x = allocation.x; + attributes.y = allocation.y; + attributes.width = allocation.width; + attributes.height = allocation.height; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK @@ -309,7 +307,6 @@ gtk_mirror_bin_size_request (GtkWidget *widget, { GtkMirrorBin *bin = GTK_MIRROR_BIN (widget); GtkRequisition child_requisition; - guint border_width; child_requisition.width = 0; child_requisition.height = 0; @@ -318,9 +315,8 @@ gtk_mirror_bin_size_request (GtkWidget *widget, gtk_widget_get_preferred_size ( (bin->child), &child_requisition, NULL); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - requisition->width = border_width * 2 + child_requisition.width + 10; - requisition->height = border_width * 2 + child_requisition.height * 2 + 10; + requisition->width = child_requisition.width + 10; + requisition->height = child_requisition.height * 2 + 10; } static void @@ -353,19 +349,16 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget, { GtkMirrorBin *bin = GTK_MIRROR_BIN (widget); gint w, h; - guint border_width; gtk_widget_set_allocation (widget, allocation); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - - w = allocation->width - border_width * 2; - h = allocation->height - border_width * 2; + w = allocation->width; + h = allocation->height; if (gtk_widget_get_realized (widget)) gdk_window_move_resize (gtk_widget_get_window (widget), - allocation->x + border_width, - allocation->y + border_width, + allocation->x, + allocation->y, w, h); if (bin->child && gtk_widget_get_visible (bin->child)) @@ -382,8 +375,8 @@ gtk_mirror_bin_size_allocate (GtkWidget *widget, if (gtk_widget_get_realized (widget)) gdk_window_move_resize (bin->offscreen_window, - allocation->x + border_width, - allocation->y + border_width, + allocation->x, + allocation->y, child_allocation.width, child_allocation.height); gtk_widget_size_allocate (bin->child, &child_allocation); } @@ -482,8 +475,6 @@ do_offscreen_window2 (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); bin = gtk_mirror_bin_new (); diff --git a/demos/gtk-demo/panes.c b/demos/gtk-demo/panes.c index e92a37c3c4..3fb0ef0531 100644 --- a/demos/gtk-demo/panes.c +++ b/demos/gtk-demo/panes.c @@ -85,7 +85,6 @@ create_pane_options (GtkPaned *paned, child2 = gtk_paned_get_child2 (paned); frame = gtk_frame_new (frame_label); - gtk_container_set_border_width (GTK_CONTAINER (frame), 4); table = gtk_grid_new (); gtk_container_add (GTK_CONTAINER (frame), table); @@ -142,14 +141,12 @@ do_panes (GtkWidget *do_widget) G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "Paned Widgets"); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); gtk_box_pack_start (GTK_BOX (vbox), vpaned, TRUE, TRUE); - gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5); hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_paned_add1 (GTK_PANED (vpaned), hpaned); diff --git a/demos/gtk-demo/pickers.c b/demos/gtk-demo/pickers.c index db8ee77d65..54daaf0329 100644 --- a/demos/gtk-demo/pickers.c +++ b/demos/gtk-demo/pickers.c @@ -22,15 +22,11 @@ do_pickers (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); - table = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (table), 3); gtk_grid_set_column_spacing (GTK_GRID (table), 10); gtk_container_add (GTK_CONTAINER (window), table); - gtk_container_set_border_width (GTK_CONTAINER (table), 10); - label = gtk_label_new ("Color:"); gtk_widget_set_halign (label, GTK_ALIGN_START); gtk_widget_set_valign (label, GTK_ALIGN_CENTER); diff --git a/demos/gtk-demo/popover.c b/demos/gtk-demo/popover.c index 44afdf26e0..ec79b97c39 100644 --- a/demos/gtk-demo/popover.c +++ b/demos/gtk-demo/popover.c @@ -25,7 +25,6 @@ create_popover (GtkWidget *parent, popover = gtk_popover_new (parent); gtk_popover_set_position (GTK_POPOVER (popover), pos); gtk_container_add (GTK_CONTAINER (popover), child); - gtk_container_set_border_width (GTK_CONTAINER (popover), 6); gtk_widget_show (child); return popover; @@ -132,7 +131,6 @@ do_popover (GtkWidget *do_widget) { window = gtk_window_new (GTK_WINDOW_TOPLEVEL); box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24); - gtk_container_set_border_width (GTK_CONTAINER (box), 24); gtk_container_add (GTK_CONTAINER (window), box); g_signal_connect (window, "destroy", diff --git a/demos/gtk-demo/revealer.ui b/demos/gtk-demo/revealer.ui index 0265ab355d..732268401c 100644 --- a/demos/gtk-demo/revealer.ui +++ b/demos/gtk-demo/revealer.ui @@ -2,7 +2,6 @@ - 5 300 300 Revealer diff --git a/demos/gtk-demo/scale.ui b/demos/gtk-demo/scale.ui index 198fa09337..521b3f2c45 100644 --- a/demos/gtk-demo/scale.ui +++ b/demos/gtk-demo/scale.ui @@ -21,7 +21,6 @@ Scales - 20 1 diff --git a/demos/gtk-demo/search_entry.c b/demos/gtk-demo/search_entry.c index 37cb10a51b..09743e5cc4 100644 --- a/demos/gtk-demo/search_entry.c +++ b/demos/gtk-demo/search_entry.c @@ -239,7 +239,6 @@ do_search_entry (GtkWidget *do_widget) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), "Search entry demo"); @@ -247,7 +246,6 @@ do_search_entry (GtkWidget *do_widget) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); /* Create our entry */ entry = gtk_search_entry_new (); diff --git a/demos/gtk-demo/search_entry2.c b/demos/gtk-demo/search_entry2.c index be70e51756..eabac96909 100644 --- a/demos/gtk-demo/search_entry2.c +++ b/demos/gtk-demo/search_entry2.c @@ -87,7 +87,6 @@ do_search_entry2 (GtkWidget *do_widget) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 0); entry = gtk_search_entry_new (); container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); @@ -117,7 +116,6 @@ do_search_entry2 (GtkWidget *do_widget) /* Result */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); label = gtk_label_new ("Result:"); gtk_label_set_xalign (GTK_LABEL (label), 0.0); @@ -134,7 +132,6 @@ do_search_entry2 (GtkWidget *do_widget) hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 0); label = gtk_label_new ("Signal:"); gtk_label_set_xalign (GTK_LABEL (label), 0.0); diff --git a/demos/gtk-demo/sizegroup.c b/demos/gtk-demo/sizegroup.c index e196f254f6..424555895d 100644 --- a/demos/gtk-demo/sizegroup.c +++ b/demos/gtk-demo/sizegroup.c @@ -109,7 +109,6 @@ do_sizegroup (GtkWidget *do_widget) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL); g_object_set_data_full (G_OBJECT (window), "size-group", size_group, g_object_unref); @@ -119,7 +118,6 @@ do_sizegroup (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE); table = gtk_grid_new (); - gtk_container_set_border_width (GTK_CONTAINER (table), 5); gtk_grid_set_row_spacing (GTK_GRID (table), 5); gtk_grid_set_column_spacing (GTK_GRID (table), 10); gtk_container_add (GTK_CONTAINER (frame), table); @@ -132,7 +130,6 @@ do_sizegroup (GtkWidget *do_widget) gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE); table = gtk_grid_new (); - gtk_container_set_border_width (GTK_CONTAINER (table), 5); gtk_grid_set_row_spacing (GTK_GRID (table), 5); gtk_grid_set_column_spacing (GTK_GRID (table), 10); gtk_container_add (GTK_CONTAINER (frame), table); diff --git a/demos/gtk-demo/spinner.c b/demos/gtk-demo/spinner.c index 969665f655..597fe7a60f 100644 --- a/demos/gtk-demo/spinner.c +++ b/demos/gtk-demo/spinner.c @@ -53,7 +53,6 @@ do_spinner (GtkWidget *do_widget) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 5); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 5); /* Sensitive */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 5); diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c index 13ea318d1c..474fdbf9d6 100644 --- a/demos/gtk-demo/textview.c +++ b/demos/gtk-demo/textview.c @@ -481,10 +481,8 @@ do_textview (GtkWidget *do_widget) G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "Multiple Views"); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_container_set_border_width (GTK_CONTAINER(vpaned), 5); gtk_container_add (GTK_CONTAINER (window), vpaned); /* For convenience, we just use the autocreated buffer from diff --git a/demos/gtk-demo/theming_style_classes.c b/demos/gtk-demo/theming_style_classes.c index 63fea3ba34..afb9dcdaf2 100644 --- a/demos/gtk-demo/theming_style_classes.c +++ b/demos/gtk-demo/theming_style_classes.c @@ -25,7 +25,6 @@ do_theming_style_classes (GtkWidget *do_widget) gtk_widget_get_screen (do_widget)); gtk_window_set_title (GTK_WINDOW (window), "Style Classes"); gtk_window_set_resizable (GTK_WINDOW (window), FALSE); - gtk_container_set_border_width (GTK_CONTAINER (window), 12); g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); diff --git a/demos/gtk-demo/toolpalette.c b/demos/gtk-demo/toolpalette.c index 2d61e7ee1d..b158cf3288 100644 --- a/demos/gtk-demo/toolpalette.c +++ b/demos/gtk-demo/toolpalette.c @@ -443,7 +443,6 @@ do_toolpalette (GtkWidget *do_widget) g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); /* Add widgets to control the ToolPalette appearance: */ box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); @@ -529,7 +528,6 @@ do_toolpalette (GtkWidget *do_widget) gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (palette_scroller), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gtk_container_set_border_width (GTK_CONTAINER (palette_scroller), 6); gtk_widget_set_hexpand (palette_scroller, TRUE); gtk_container_add (GTK_CONTAINER (palette_scroller), palette); @@ -549,7 +547,6 @@ do_toolpalette (GtkWidget *do_widget) /* ===== notebook ===== */ notebook = gtk_notebook_new (); - gtk_container_set_border_width (GTK_CONTAINER (notebook), 6); gtk_box_pack_end (GTK_BOX(hbox), notebook, FALSE, FALSE); /* ===== DnD for tool items ===== */ @@ -585,7 +582,6 @@ do_toolpalette (GtkWidget *do_widget) GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add (GTK_CONTAINER (contents_scroller), contents); - gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller, @@ -615,7 +611,6 @@ do_toolpalette (GtkWidget *do_widget) GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add (GTK_CONTAINER (contents_scroller), contents); - gtk_container_set_border_width (GTK_CONTAINER (contents_scroller), 6); gtk_notebook_append_page (GTK_NOTEBOOK (notebook), contents_scroller, gtk_label_new ("Interactive DnD Mode")); diff --git a/demos/gtk-demo/transparent.c b/demos/gtk-demo/transparent.c index dbd94b7d02..bbbacbe743 100644 --- a/demos/gtk-demo/transparent.c +++ b/demos/gtk-demo/transparent.c @@ -202,7 +202,6 @@ do_transparent (GtkWidget *do_widget) G_CALLBACK (gtk_widget_destroyed), &window); gtk_window_set_title (GTK_WINDOW (window), "Transparency"); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); view = gtk_text_view_new (); diff --git a/demos/gtk-demo/tree_store.c b/demos/gtk-demo/tree_store.c index 318b4dba17..32ec14c8af 100644 --- a/demos/gtk-demo/tree_store.c +++ b/demos/gtk-demo/tree_store.c @@ -398,7 +398,6 @@ do_tree_store (GtkWidget *do_widget) G_CALLBACK (gtk_widget_destroyed), &window); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 8); gtk_container_add (GTK_CONTAINER (window), vbox); gtk_box_pack_start (GTK_BOX (vbox), diff --git a/demos/widget-factory/widget-factory.ui b/demos/widget-factory/widget-factory.ui index c7d80a6804..caae6d9c66 100644 --- a/demos/widget-factory/widget-factory.ui +++ b/demos/widget-factory/widget-factory.ui @@ -441,7 +441,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus. 1 vertical - 10 10 @@ -1830,7 +1829,6 @@ Suspendisse feugiat quam quis dolor accumsan cursus. 1 10 - 16 1 @@ -2873,7 +2871,6 @@ microphone-sensitivity-medium-symbolic 1 - 16 10 diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt index 9ae88f9f04..287de5409e 100644 --- a/docs/reference/gtk/gtk4-sections.txt +++ b/docs/reference/gtk/gtk4-sections.txt @@ -999,8 +999,6 @@ gtk_container_child_set_valist gtk_container_child_notify gtk_container_child_notify_by_pspec gtk_container_forall -gtk_container_get_border_width -gtk_container_set_border_width gtk_container_propagate_draw gtk_container_get_focus_chain gtk_container_set_focus_chain @@ -1009,7 +1007,6 @@ gtk_container_class_find_child_property gtk_container_class_install_child_property gtk_container_class_install_child_properties gtk_container_class_list_child_properties -gtk_container_class_handle_border_width GTK_CONTAINER diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c index 5315f5a063..6f3303a935 100644 --- a/docs/tools/widgets.c +++ b/docs/tools/widgets.c @@ -36,7 +36,6 @@ new_widget_info (const char *name, else { info->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width (GTK_CONTAINER (info->window), 12); info->include_decorations = FALSE; gtk_widget_show_all (widget); gtk_container_add (GTK_CONTAINER (info->window), widget); @@ -391,7 +390,6 @@ create_info_bar (void) gtk_container_add (GTK_CONTAINER (align), widget); info = new_widget_info ("info-bar", align, SMALL); - gtk_container_set_border_width (GTK_CONTAINER (info->window), 0); return info; } @@ -423,7 +421,6 @@ create_search_bar (void) gtk_box_pack_start (GTK_BOX (box), view, TRUE, TRUE); info = new_widget_info ("search-bar", box, SMALL); - gtk_container_set_border_width (GTK_CONTAINER (info->window), 0); return info; } @@ -457,7 +454,6 @@ create_action_bar (void) gtk_container_add (GTK_CONTAINER (box), widget); info = new_widget_info ("action-bar", box, SMALL); - gtk_container_set_border_width (GTK_CONTAINER (info->window), 0); return info; } @@ -1086,7 +1082,6 @@ create_statusbar (void) gtk_box_pack_end (GTK_BOX (vbox), align, FALSE, FALSE); info = new_widget_info ("statusbar", vbox, SMALL); - gtk_container_set_border_width (GTK_CONTAINER (info->window), 0); return info; } @@ -1280,7 +1275,6 @@ create_headerbar (void) GtkWidget *button; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_container_set_border_width (GTK_CONTAINER (window), 0); view = gtk_text_view_new (); gtk_widget_show (view); gtk_widget_set_size_request (window, 220, 150); diff --git a/examples/action-namespace.c b/examples/action-namespace.c index 7335ad993e..6a4c84ed44 100644 --- a/examples/action-namespace.c +++ b/examples/action-namespace.c @@ -114,7 +114,6 @@ activate (GApplication *app, gtk_widget_set_halign (GTK_WIDGET (button), GTK_ALIGN_CENTER); gtk_widget_set_valign (GTK_WIDGET (button), GTK_ALIGN_START); gtk_container_add (GTK_CONTAINER (win), button); - gtk_container_set_border_width (GTK_CONTAINER (win), 12); gtk_widget_show_all (win); g_object_unref (button_menu); diff --git a/examples/builder.ui b/examples/builder.ui index 6321c93ca0..b9b5c2d145 100644 --- a/examples/builder.ui +++ b/examples/builder.ui @@ -2,7 +2,6 @@ True Grid - 10 True diff --git a/examples/drawing.c b/examples/drawing.c index a496bcabf4..2d4b9b47d2 100644 --- a/examples/drawing.c +++ b/examples/drawing.c @@ -142,8 +142,6 @@ activate (GtkApplication *app, g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL); - gtk_container_set_border_width (GTK_CONTAINER (window), 8); - frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); gtk_container_add (GTK_CONTAINER (window), frame); diff --git a/examples/grid-packing.c b/examples/grid-packing.c index 2d9db4fb90..06cf95535c 100644 --- a/examples/grid-packing.c +++ b/examples/grid-packing.c @@ -18,7 +18,6 @@ activate (GtkApplication *app, /* create a new window, and set its title */ window = gtk_application_window_new (app); gtk_window_set_title (GTK_WINDOW (window), "Window"); - gtk_container_set_border_width (GTK_CONTAINER (window), 10); /* Here we construct the container that is going pack our buttons */ grid = gtk_grid_new (); diff --git a/examples/plugman.c b/examples/plugman.c index 04f0029367..82006d60e6 100644 --- a/examples/plugman.c +++ b/examples/plugman.c @@ -338,7 +338,6 @@ configure_plugins (GSimpleAction *action, gtk_builder_add_from_string (builder, "" " " - " 12" " Plugins" " " " " diff --git a/gtk/deprecated/gtkalignment.c b/gtk/deprecated/gtkalignment.c index eaf7f2bd4c..8c5913e175 100644 --- a/gtk/deprecated/gtkalignment.c +++ b/gtk/deprecated/gtkalignment.c @@ -556,7 +556,6 @@ gtk_alignment_size_allocate (GtkWidget *widget, GtkAllocation child_allocation; GtkWidget *child; gint width, height; - gint border_width; gint baseline; gtk_widget_set_allocation (widget, allocation); @@ -571,17 +570,15 @@ gtk_alignment_size_allocate (GtkWidget *widget, gint child_width, child_height; double yalign, yscale; - border_width = gtk_container_get_border_width (GTK_CONTAINER (alignment)); - padding_horizontal = priv->padding_left + priv->padding_right; padding_vertical = priv->padding_top + priv->padding_bottom; - width = MAX (1, allocation->width - padding_horizontal - 2 * border_width); - height = MAX (1, allocation->height - padding_vertical - 2 * border_width); + width = MAX (1, allocation->width - padding_horizontal); + height = MAX (1, allocation->height - padding_vertical); baseline = gtk_widget_get_allocated_baseline (widget); if (baseline != -1) - baseline -= border_width + priv->padding_top; + baseline -= priv->padding_top; /* If we get a baseline set that means we're baseline aligned, and the parent honored that. In that case we have to ignore yalign/yscale as we need @@ -634,11 +631,11 @@ gtk_alignment_size_allocate (GtkWidget *widget, child_allocation.height = height; if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) - child_allocation.x = (1.0 - priv->xalign) * (width - child_allocation.width) + allocation->x + border_width + priv->padding_right; + child_allocation.x = (1.0 - priv->xalign) * (width - child_allocation.width) + allocation->x + priv->padding_right; else - child_allocation.x = priv->xalign * (width - child_allocation.width) + allocation->x + border_width + priv->padding_left; + child_allocation.x = priv->xalign * (width - child_allocation.width) + allocation->x + priv->padding_left; - child_allocation.y = yalign * (height - child_allocation.height) + allocation->y + border_width + priv->padding_top; + child_allocation.y = yalign * (height - child_allocation.height) + allocation->y + priv->padding_top; gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline); } @@ -659,16 +656,14 @@ gtk_alignment_get_preferred_size (GtkWidget *widget, GtkWidget *child; guint minimum, natural; guint top_offset; - guint border; if (minimum_baseline) *minimum_baseline = -1; if (natural_baseline) *natural_baseline = -1; - border = gtk_container_get_border_width (GTK_CONTAINER (widget)); - natural = minimum = border * 2; - top_offset = border; + natural = minimum = 0; + top_offset = 0; if ((child = gtk_bin_get_child (GTK_BIN (widget))) && gtk_widget_get_visible (child)) { diff --git a/gtk/deprecated/gtktable.c b/gtk/deprecated/gtktable.c index b51f869327..a10e893abf 100644 --- a/gtk/deprecated/gtktable.c +++ b/gtk/deprecated/gtktable.c @@ -177,7 +177,6 @@ gtk_table_class_init (GtkTableClass *class) container_class->child_type = gtk_table_child_type; container_class->set_child_property = gtk_table_set_child_property; container_class->get_child_property = gtk_table_get_child_property; - gtk_container_class_handle_border_width (container_class); g_object_class_install_property (gobject_class, PROP_N_ROWS, diff --git a/gtk/gtk-builder-tool.c b/gtk/gtk-builder-tool.c index cb5e8643c2..28e44547d0 100644 --- a/gtk/gtk-builder-tool.c +++ b/gtk/gtk-builder-tool.c @@ -186,14 +186,12 @@ needs_explicit_setting (MyParserData *data, { "GtkCalendar", "year", 0 }, { "GtkCalendar", "month", 0 }, { "GtkCalendar", "day", 0 }, - { "GtkDialog", "border-width", 0 }, { "GtkPlacesSidebar", "show-desktop", 0 }, { "GtkRadioButton", "draw-indicator", 0 }, { "GtkGrid", "left-attach", 1 }, { "GtkGrid", "top-attach", 1 }, { "GtkWidget", "hexpand", 0 }, { "GtkWidget", "vexpand", 0 }, - { "GtkContainer", "border-width", 0 }, { "GtkVBox", "expand", 1 }, { NULL, NULL, 0 } }; diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c index 1694547e98..556525d121 100644 --- a/gtk/gtkappchooserdialog.c +++ b/gtk/gtkappchooserdialog.c @@ -522,45 +522,6 @@ gtk_app_chooser_dialog_constructed (GObject *object) setup_search (self); } -/* This is necessary do deal with the fact that GtkDialog - * exposes bits of its internal spacing as style properties, - * and puts the action area inside the content area. - * To achieve a flush-top search bar, we need the content - * area border to be 0, and distribute the spacing to other - * containers to compensate. - */ -static void -update_spacings (GtkAppChooserDialog *self) -{ - GtkWidget *widget; - gint content_area_border; - gint action_area_border; - - gtk_widget_style_get (GTK_WIDGET (self), - "content-area-border", &content_area_border, - "action-area-border", &action_area_border, - NULL); - - widget = gtk_dialog_get_content_area (GTK_DIALOG (self)); - gtk_container_set_border_width (GTK_CONTAINER (widget), 0); - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - widget = gtk_dialog_get_action_area (GTK_DIALOG (self)); -G_GNUC_END_IGNORE_DEPRECATIONS - gtk_container_set_border_width (GTK_CONTAINER (widget), 5 + content_area_border + action_area_border); - - widget = self->priv->inner_box; - gtk_container_set_border_width (GTK_CONTAINER (widget), 10 + content_area_border); -} - -static void -gtk_app_chooser_dialog_style_updated (GtkWidget *widget) -{ - GTK_WIDGET_CLASS (gtk_app_chooser_dialog_parent_class)->style_updated (widget); - - update_spacings (GTK_APP_CHOOSER_DIALOG (widget)); -} - static void gtk_app_chooser_dialog_dispose (GObject *object) { @@ -646,20 +607,19 @@ gtk_app_chooser_dialog_iface_init (GtkAppChooserIface *iface) static void gtk_app_chooser_dialog_class_init (GtkAppChooserDialogClass *klass) { - GtkWidgetClass *widget_class; GObjectClass *gobject_class; + GtkWidgetClass *widget_class; GParamSpec *pspec; gobject_class = G_OBJECT_CLASS (klass); + widget_class = GTK_WIDGET_CLASS (klass); + gobject_class->dispose = gtk_app_chooser_dialog_dispose; gobject_class->finalize = gtk_app_chooser_dialog_finalize; gobject_class->set_property = gtk_app_chooser_dialog_set_property; gobject_class->get_property = gtk_app_chooser_dialog_get_property; gobject_class->constructed = gtk_app_chooser_dialog_constructed; - widget_class = GTK_WIDGET_CLASS (klass); - widget_class->style_updated = gtk_app_chooser_dialog_style_updated; - g_object_class_override_property (gobject_class, PROP_CONTENT_TYPE, "content-type"); /** @@ -718,8 +678,6 @@ gtk_app_chooser_dialog_init (GtkAppChooserDialog *self) */ g_signal_connect (self, "response", G_CALLBACK (gtk_app_chooser_dialog_response), NULL); - - update_spacings (self); } static void diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c index 3e1e9692b0..7929812d62 100644 --- a/gtk/gtkapplicationwindow.c +++ b/gtk/gtkapplicationwindow.c @@ -579,16 +579,14 @@ gtk_application_window_real_get_preferred_width (GtkWidget *widget, if (window->priv->menubar != NULL) { gint menubar_min_width, menubar_nat_width; - gint border_width; GtkBorder border = { 0 }; gtk_widget_get_preferred_width (window->priv->menubar, &menubar_min_width, &menubar_nat_width); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); _gtk_window_get_shadow_width (GTK_WINDOW (widget), &border); - menubar_min_width += 2 * border_width + border.left + border.right; - menubar_nat_width += 2 * border_width + border.left + border.right; + menubar_min_width += border.left + border.right; + menubar_nat_width += border.left + border.right; *minimum_width = MAX (*minimum_width, menubar_min_width); *natural_width = MAX (*natural_width, menubar_nat_width); @@ -615,16 +613,14 @@ gtk_application_window_real_get_preferred_width_for_height (GtkWidget *widget, if (window->priv->menubar != NULL) { gint menubar_min_width, menubar_nat_width; - gint border_width; GtkBorder border = { 0 }; gtk_widget_get_preferred_width_for_height (window->priv->menubar, menubar_height, &menubar_min_width, &menubar_nat_width); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); _gtk_window_get_shadow_width (GTK_WINDOW (widget), &border); - menubar_min_width += 2 * border_width + border.left + border.right; - menubar_nat_width += 2 * border_width + border.left + border.right; + menubar_min_width += border.left + border.right; + menubar_nat_width += border.left + border.right; *minimum_width = MAX (*minimum_width, menubar_min_width); *natural_width = MAX (*natural_width, menubar_nat_width); diff --git a/gtk/gtkbbox.c b/gtk/gtkbbox.c index 979f2a8444..9ea859f7d2 100644 --- a/gtk/gtkbbox.c +++ b/gtk/gtkbbox.c @@ -203,7 +203,6 @@ gtk_button_box_class_init (GtkButtonBoxClass *class) container_class->add = gtk_button_box_add; container_class->set_child_property = gtk_button_box_set_child_property; container_class->get_child_property = gtk_button_box_get_child_property; - gtk_container_class_handle_border_width (container_class); /** * GtkButtonBox:child-min-width: diff --git a/gtk/gtkbin.c b/gtk/gtkbin.c index 1295a37bc2..2fba246162 100644 --- a/gtk/gtkbin.c +++ b/gtk/gtkbin.c @@ -171,15 +171,6 @@ gtk_bin_forall (GtkContainer *container, (* callback) (priv->child, callback_data); } -static int -gtk_bin_get_effective_border_width (GtkBin *bin) -{ - if (GTK_CONTAINER_CLASS (GTK_BIN_GET_CLASS (bin))->_handle_border_width) - return 0; - - return gtk_container_get_border_width (GTK_CONTAINER (bin)); -} - static void gtk_bin_get_preferred_width (GtkWidget *widget, gint *minimum_width, @@ -187,7 +178,6 @@ gtk_bin_get_preferred_width (GtkWidget *widget, { GtkBin *bin = GTK_BIN (widget); GtkBinPrivate *priv = bin->priv; - gint border_width; *minimum_width = 0; *natural_width = 0; @@ -200,10 +190,6 @@ gtk_bin_get_preferred_width (GtkWidget *widget, *minimum_width = child_min; *natural_width = child_nat; } - - border_width = gtk_bin_get_effective_border_width (bin); - *minimum_width += 2 * border_width; - *natural_width += 2 * border_width; } static void @@ -213,7 +199,6 @@ gtk_bin_get_preferred_height (GtkWidget *widget, { GtkBin *bin = GTK_BIN (widget); GtkBinPrivate *priv = bin->priv; - gint border_width; *minimum_height = 0; *natural_height = 0; @@ -226,10 +211,6 @@ gtk_bin_get_preferred_height (GtkWidget *widget, *minimum_height = child_min; *natural_height = child_nat; } - - border_width = gtk_bin_get_effective_border_width (bin); - *minimum_height += 2 * border_width; - *natural_height += 2 * border_width; } static void @@ -240,25 +221,19 @@ gtk_bin_get_preferred_width_for_height (GtkWidget *widget, { GtkBin *bin = GTK_BIN (widget); GtkBinPrivate *priv = bin->priv; - gint border_width; *minimum_width = 0; *natural_width = 0; - border_width = gtk_bin_get_effective_border_width (bin); - if (priv->child && gtk_widget_get_visible (priv->child)) { gint child_min, child_nat; - gtk_widget_get_preferred_width_for_height (priv->child, height - 2 * border_width, + gtk_widget_get_preferred_width_for_height (priv->child, height, &child_min, &child_nat); *minimum_width = child_min; *natural_width = child_nat; } - - *minimum_width += 2 * border_width; - *natural_width += 2 * border_width; } static void @@ -269,25 +244,19 @@ gtk_bin_get_preferred_height_for_width (GtkWidget *widget, { GtkBin *bin = GTK_BIN (widget); GtkBinPrivate *priv = bin->priv; - gint border_width; *minimum_height = 0; *natural_height = 0; - border_width = gtk_bin_get_effective_border_width (bin); - if (priv->child && gtk_widget_get_visible (priv->child)) { gint child_min, child_nat; - gtk_widget_get_preferred_height_for_width (priv->child, width - 2 * border_width, + gtk_widget_get_preferred_height_for_width (priv->child, width, &child_min, &child_nat); *minimum_height = child_min; *natural_height = child_nat; } - - *minimum_height += 2 * border_width; - *natural_height += 2 * border_width; } static void @@ -301,15 +270,7 @@ gtk_bin_size_allocate (GtkWidget *widget, if (priv->child && gtk_widget_get_visible (priv->child)) { - GtkAllocation child_allocation; - gint border_width = gtk_bin_get_effective_border_width (bin); - - child_allocation.x = allocation->x + border_width; - child_allocation.y = allocation->y + border_width; - child_allocation.width = allocation->width - 2 * border_width; - child_allocation.height = allocation->height - 2 * border_width; - - gtk_widget_size_allocate (priv->child, &child_allocation); + gtk_widget_size_allocate (priv->child, allocation); } } diff --git a/gtk/gtkbox.c b/gtk/gtkbox.c index f0e0f7bebb..ddb680ba3e 100644 --- a/gtk/gtkbox.c +++ b/gtk/gtkbox.c @@ -265,7 +265,6 @@ gtk_box_class_init (GtkBoxClass *class) container_class->set_child_property = gtk_box_set_child_property; container_class->get_child_property = gtk_box_get_child_property; container_class->get_path_for_child = gtk_box_get_path_for_child; - gtk_container_class_handle_border_width (container_class); g_object_class_override_property (object_class, PROP_ORIENTATION, diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c index 0e4eacae05..547461eeca 100644 --- a/gtk/gtkbuilder.c +++ b/gtk/gtkbuilder.c @@ -174,10 +174,8 @@ * * * - * 10 * * - * 20 * * * gtk-ok diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index 4b17c3338f..dbe7d82709 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -219,11 +219,9 @@ gtk_button_class_init (GtkButtonClass *klass) { GObjectClass *gobject_class; GtkWidgetClass *widget_class; - GtkContainerClass *container_class; gobject_class = G_OBJECT_CLASS (klass); widget_class = (GtkWidgetClass*) klass; - container_class = (GtkContainerClass*) klass; gobject_class->constructed = gtk_button_constructed; gobject_class->dispose = gtk_button_dispose; @@ -250,8 +248,6 @@ gtk_button_class_init (GtkButtonClass *klass) widget_class->state_changed = gtk_button_state_changed; widget_class->grab_notify = gtk_button_grab_notify; - gtk_container_class_handle_border_width (container_class); - klass->clicked = NULL; klass->activate = gtk_real_button_activate; diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index a3044a0697..603bf4ab05 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -668,8 +668,6 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass) container_class->add = gtk_combo_box_add; container_class->remove = gtk_combo_box_remove; - gtk_container_class_handle_border_width (container_class); - widget_class = (GtkWidgetClass *)klass; widget_class->size_allocate = gtk_combo_box_size_allocate; widget_class->draw = gtk_combo_box_draw; diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index d90370b0b4..fcd086d765 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -280,9 +280,6 @@ struct _GtkContainerPrivate GdkFrameClock *resize_clock; guint resize_handler; - guint border_width : 16; - guint border_width_set : 1; - guint has_focus_chain : 1; guint reallocate_redraws : 1; guint restyle_pending : 1; @@ -301,7 +298,6 @@ enum { enum { PROP_0, - PROP_BORDER_WIDTH, PROP_RESIZE_MODE, PROP_CHILD, LAST_PROP @@ -350,21 +346,6 @@ static gint gtk_container_draw (GtkWidget *widget, cairo_t *cr); static void gtk_container_map (GtkWidget *widget); static void gtk_container_unmap (GtkWidget *widget); -static void gtk_container_adjust_size_request (GtkWidget *widget, - GtkOrientation orientation, - gint *minimum_size, - gint *natural_size); -static void gtk_container_adjust_baseline_request (GtkWidget *widget, - gint *minimum_baseline, - gint *natural_baseline); -static void gtk_container_adjust_size_allocation (GtkWidget *widget, - GtkOrientation orientation, - gint *minimum_size, - gint *natural_size, - gint *allocated_pos, - gint *allocated_size); -static void gtk_container_adjust_baseline_allocation (GtkWidget *widget, - gint *baseline); static GtkSizeRequestMode gtk_container_get_request_mode (GtkWidget *widget); static gchar* gtk_container_child_default_composite_name (GtkContainer *container, @@ -510,11 +491,6 @@ gtk_container_class_init (GtkContainerClass *class) widget_class->map = gtk_container_map; widget_class->unmap = gtk_container_unmap; widget_class->focus = gtk_container_focus; - - widget_class->adjust_size_request = gtk_container_adjust_size_request; - widget_class->adjust_baseline_request = gtk_container_adjust_baseline_request; - widget_class->adjust_size_allocation = gtk_container_adjust_size_allocation; - widget_class->adjust_baseline_allocation = gtk_container_adjust_baseline_allocation; widget_class->get_request_mode = gtk_container_get_request_mode; class->add = gtk_container_add_unimplemented; @@ -534,14 +510,6 @@ gtk_container_class_init (GtkContainerClass *class) GTK_RESIZE_PARENT, GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED); - container_props[PROP_BORDER_WIDTH] = - g_param_spec_uint ("border-width", - P_("Border width"), - P_("The width of the empty border outside the containers children"), - 0, 65535, - 0, - GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY); - container_props[PROP_CHILD] = g_param_spec_object ("child", P_("Child"), @@ -1674,10 +1642,8 @@ gtk_container_init (GtkContainer *container) priv = container->priv; priv->focus_child = NULL; - priv->border_width = 0; priv->resize_mode = GTK_RESIZE_PARENT; priv->reallocate_redraws = FALSE; - priv->border_width_set = FALSE; } static void @@ -1712,9 +1678,6 @@ gtk_container_set_property (GObject *object, switch (prop_id) { - case PROP_BORDER_WIDTH: - gtk_container_set_border_width (container, g_value_get_uint (value)); - break; case PROP_RESIZE_MODE: G_GNUC_BEGIN_IGNORE_DEPRECATIONS; gtk_container_set_resize_mode (container, g_value_get_enum (value)); @@ -1740,9 +1703,6 @@ gtk_container_get_property (GObject *object, switch (prop_id) { - case PROP_BORDER_WIDTH: - g_value_set_uint (value, priv->border_width); - break; case PROP_RESIZE_MODE: g_value_set_enum (value, priv->resize_mode); break; @@ -1752,86 +1712,6 @@ gtk_container_get_property (GObject *object, } } -gboolean -_gtk_container_get_border_width_set (GtkContainer *container) -{ - GtkContainerPrivate *priv; - - g_return_val_if_fail (GTK_IS_CONTAINER (container), FALSE); - - priv = container->priv; - - return priv->border_width_set; -} - -void -_gtk_container_set_border_width_set (GtkContainer *container, - gboolean border_width_set) -{ - GtkContainerPrivate *priv; - - g_return_if_fail (GTK_IS_CONTAINER (container)); - - priv = container->priv; - - priv->border_width_set = border_width_set ? TRUE : FALSE; -} - -/** - * gtk_container_set_border_width: - * @container: a #GtkContainer - * @border_width: amount of blank space to leave outside - * the container. Valid values are in the range 0-65535 pixels. - * - * Sets the border width of the container. - * - * The border width of a container is the amount of space to leave - * around the outside of the container. The only exception to this is - * #GtkWindow; because toplevel windows can’t leave space outside, - * they leave the space inside. The border is added on all sides of - * the container. To add space to only one side, use a specific - * #GtkWidget:margin property on the child widget, for example - * #GtkWidget:margin-top. - **/ -void -gtk_container_set_border_width (GtkContainer *container, - guint border_width) -{ - GtkContainerPrivate *priv; - - g_return_if_fail (GTK_IS_CONTAINER (container)); - - priv = container->priv; - - if (priv->border_width != border_width) - { - priv->border_width = border_width; - _gtk_container_set_border_width_set (container, TRUE); - - g_object_notify_by_pspec (G_OBJECT (container), container_props[PROP_BORDER_WIDTH]); - - if (_gtk_widget_get_realized (GTK_WIDGET (container))) - gtk_widget_queue_resize (GTK_WIDGET (container)); - } -} - -/** - * gtk_container_get_border_width: - * @container: a #GtkContainer - * - * Retrieves the border width of the container. See - * gtk_container_set_border_width(). - * - * Returns: the current border width - **/ -guint -gtk_container_get_border_width (GtkContainer *container) -{ - g_return_val_if_fail (GTK_IS_CONTAINER (container), 0); - - return container->priv->border_width; -} - /** * gtk_container_add: * @container: a #GtkContainer @@ -2240,111 +2120,6 @@ gtk_container_resize_children (GtkContainer *container) gtk_widget_size_allocate_with_baseline (widget, &allocation, baseline); } -static void -gtk_container_adjust_size_request (GtkWidget *widget, - GtkOrientation orientation, - gint *minimum_size, - gint *natural_size) -{ - GtkContainer *container; - - container = GTK_CONTAINER (widget); - - if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width) - { - int border_width; - - border_width = container->priv->border_width; - - *minimum_size += border_width * 2; - *natural_size += border_width * 2; - } - - /* chain up last so gtk_widget_set_size_request() values - * will have a chance to overwrite our border width. - */ - parent_class->adjust_size_request (widget, orientation, - minimum_size, natural_size); -} - -static void -gtk_container_adjust_baseline_request (GtkWidget *widget, - gint *minimum_baseline, - gint *natural_baseline) -{ - GtkContainer *container; - - container = GTK_CONTAINER (widget); - - if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width) - { - int border_width; - - border_width = container->priv->border_width; - - *minimum_baseline += border_width; - *natural_baseline += border_width; - } - - parent_class->adjust_baseline_request (widget, minimum_baseline, natural_baseline); -} - -static void -gtk_container_adjust_size_allocation (GtkWidget *widget, - GtkOrientation orientation, - gint *minimum_size, - gint *natural_size, - gint *allocated_pos, - gint *allocated_size) -{ - GtkContainer *container; - int border_width; - - container = GTK_CONTAINER (widget); - - if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width) - { - border_width = container->priv->border_width; - - *allocated_size -= border_width * 2; - *allocated_pos += border_width; - *minimum_size -= border_width * 2; - *natural_size -= border_width * 2; - } - - /* Chain up to GtkWidgetClass *after* removing our border width from - * the proposed allocation size. This is because it's possible that the - * widget was allocated more space than it needs in a said orientation, - * if GtkWidgetClass does any alignments and thus limits the size to the - * natural size... then we need that to be done *after* removing any margins - * and padding values. - */ - parent_class->adjust_size_allocation (widget, orientation, - minimum_size, natural_size, allocated_pos, - allocated_size); -} - -static void -gtk_container_adjust_baseline_allocation (GtkWidget *widget, - gint *baseline) -{ - GtkContainer *container; - int border_width; - - container = GTK_CONTAINER (widget); - - if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width) - { - border_width = container->priv->border_width; - - if (*baseline >= 0) - *baseline -= border_width; - } - - parent_class->adjust_baseline_allocation (widget, baseline); -} - - typedef struct { gint hfw; gint wfh; @@ -2386,29 +2161,6 @@ gtk_container_get_request_mode (GtkWidget *widget) GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH; } -/** - * gtk_container_class_handle_border_width: - * @klass: the class struct of a #GtkContainer subclass - * - * Modifies a subclass of #GtkContainerClass to automatically add and - * remove the border-width setting on GtkContainer. This allows the - * subclass to ignore the border width in its size request and - * allocate methods. The intent is for a subclass to invoke this - * in its class_init function. - * - * gtk_container_class_handle_border_width() is necessary because it - * would break API too badly to make this behavior the default. So - * subclasses must “opt in” to the parent class handling border_width - * for them. - */ -void -gtk_container_class_handle_border_width (GtkContainerClass *klass) -{ - g_return_if_fail (GTK_IS_CONTAINER_CLASS (klass)); - - klass->_handle_border_width = TRUE; -} - /** * gtk_container_forall: (virtual forall) * @container: a #GtkContainer diff --git a/gtk/gtkcontainer.h b/gtk/gtkcontainer.h index ea87bd91c8..63420cd5bb 100644 --- a/gtk/gtkcontainer.h +++ b/gtk/gtkcontainer.h @@ -107,8 +107,6 @@ struct _GtkContainerClass /*< private >*/ - unsigned int _handle_border_width : 1; - /* Padding for future expansion */ void (*_gtk_reserved1) (void); void (*_gtk_reserved2) (void); @@ -139,11 +137,7 @@ typedef enum GDK_AVAILABLE_IN_ALL GType gtk_container_get_type (void) G_GNUC_CONST; -GDK_AVAILABLE_IN_ALL -void gtk_container_set_border_width (GtkContainer *container, - guint border_width); -GDK_AVAILABLE_IN_ALL -guint gtk_container_get_border_width (GtkContainer *container); + GDK_AVAILABLE_IN_ALL void gtk_container_add (GtkContainer *container, GtkWidget *widget); @@ -292,9 +286,6 @@ void gtk_container_forall (GtkContainer *container, GtkCallback callback, gpointer callback_data); -GDK_AVAILABLE_IN_ALL -void gtk_container_class_handle_border_width (GtkContainerClass *klass); - GDK_AVAILABLE_IN_ALL GtkWidgetPath * gtk_container_get_path_for_child (GtkContainer *container, GtkWidget *child); diff --git a/gtk/gtkcontainerprivate.h b/gtk/gtkcontainerprivate.h index 7402a6676b..0681909d51 100644 --- a/gtk/gtkcontainerprivate.h +++ b/gtk/gtkcontainerprivate.h @@ -39,9 +39,6 @@ gboolean _gtk_container_get_reallocate_redraws (GtkContainer *container); void _gtk_container_stop_idle_sizer (GtkContainer *container); void _gtk_container_maybe_start_idle_sizer (GtkContainer *container); -gboolean _gtk_container_get_border_width_set (GtkContainer *container); -void _gtk_container_set_border_width_set (GtkContainer *container, - gboolean border_width_set); void gtk_container_get_children_clip (GtkContainer *container, GtkAllocation *out_clip); void gtk_container_set_default_resize_mode (GtkContainer *container, diff --git a/gtk/gtkcustompaperunixdialog.c b/gtk/gtkcustompaperunixdialog.c index ff6fa9f70c..375891e425 100644 --- a/gtk/gtkcustompaperunixdialog.c +++ b/gtk/gtkcustompaperunixdialog.c @@ -1021,7 +1021,7 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog) { GtkCustomPaperUnixDialogPrivate *priv = dialog->priv; GtkDialog *cpu_dialog = GTK_DIALOG (dialog); - GtkWidget *action_area, *content_area; + GtkWidget *content_area; GtkWidget *grid, *label, *widget, *frame, *combo; GtkWidget *hbox, *vbox, *treeview, *scrolled, *toolbar, *button; GtkCellRenderer *cell; @@ -1033,16 +1033,9 @@ populate_dialog (GtkCustomPaperUnixDialog *dialog) GtkStyleContext *context; content_area = gtk_dialog_get_content_area (cpu_dialog); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - action_area = gtk_dialog_get_action_area (cpu_dialog); -G_GNUC_END_IGNORE_DEPRECATIONS - gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width (GTK_CONTAINER (action_area), 5); - gtk_box_set_spacing (GTK_BOX (action_area), 6); hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 18); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE); gtk_widget_show (hbox); diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c index 0a6fa6c6cd..0b6538b292 100644 --- a/gtk/gtkdialog.c +++ b/gtk/gtkdialog.c @@ -575,22 +575,6 @@ gtk_dialog_class_init (GtkDialogClass *class) NULL, G_TYPE_NONE, 0); - /** - * GtkDialog:content-area-border: - * - * The default border width used around the - * content area of the dialog, as returned by - * gtk_dialog_get_content_area(), unless gtk_container_set_border_width() - * was called on that widget directly. - */ - gtk_widget_class_install_style_property (widget_class, - g_param_spec_int ("content-area-border", - P_("Content area border"), - P_("Width of border around the main dialog area"), - 0, - G_MAXINT, - 2, - GTK_PARAM_READABLE)); /** * GtkDialog:content-area-spacing: * @@ -618,23 +602,6 @@ gtk_dialog_class_init (GtkDialogClass *class) 6, GTK_PARAM_READABLE)); - /** - * GtkDialog:action-area-border: - * - * The default border width used around the - * action area of the dialog, as returned by - * gtk_dialog_get_action_area(), unless gtk_container_set_border_width() - * was called on that widget directly. - */ - gtk_widget_class_install_style_property (widget_class, - g_param_spec_int ("action-area-border", - P_("Action area border"), - P_("Width of border around the button area at the bottom of the dialog"), - 0, - G_MAXINT, - 5, - GTK_PARAM_READABLE)); - /** * GtkDialog:use-header-bar: * @@ -673,25 +640,14 @@ static void update_spacings (GtkDialog *dialog) { GtkDialogPrivate *priv = dialog->priv; - gint content_area_border; gint content_area_spacing; gint button_spacing; - gint action_area_border; gtk_widget_style_get (GTK_WIDGET (dialog), - "content-area-border", &content_area_border, "content-area-spacing", &content_area_spacing, "button-spacing", &button_spacing, - "action-area-border", &action_area_border, NULL); - if (!_gtk_container_get_border_width_set (GTK_CONTAINER (priv->vbox))) - { - gtk_container_set_border_width (GTK_CONTAINER (priv->vbox), - content_area_border); - _gtk_container_set_border_width_set (GTK_CONTAINER (priv->vbox), FALSE); - } - if (!_gtk_box_get_spacing_set (GTK_BOX (priv->vbox))) { gtk_box_set_spacing (GTK_BOX (priv->vbox), content_area_spacing); @@ -701,13 +657,6 @@ update_spacings (GtkDialog *dialog) /* don't set spacing when buttons are linked */ if (gtk_button_box_get_layout (GTK_BUTTON_BOX (priv->action_area)) != GTK_BUTTONBOX_EXPAND) gtk_box_set_spacing (GTK_BOX (priv->action_area), button_spacing); - - if (!_gtk_container_get_border_width_set (GTK_CONTAINER (priv->action_area))) - { - gtk_container_set_border_width (GTK_CONTAINER (priv->action_area), - action_area_border); - _gtk_container_set_border_width_set (GTK_CONTAINER (priv->action_area), FALSE); - } } static void diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index fa4a794f7b..9d30895b79 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -2567,7 +2567,6 @@ gtk_entry_ensure_magnifier (GtkEntry *entry) gtk_popover_set_modal (GTK_POPOVER (priv->magnifier_popover), FALSE); gtk_container_add (GTK_CONTAINER (priv->magnifier_popover), priv->magnifier); - gtk_container_set_border_width (GTK_CONTAINER (priv->magnifier_popover), 4); gtk_widget_show (priv->magnifier); } diff --git a/gtk/gtkeventbox.c b/gtk/gtkeventbox.c index dc06847ac9..2f92131233 100644 --- a/gtk/gtkeventbox.c +++ b/gtk/gtkeventbox.c @@ -91,7 +91,6 @@ gtk_event_box_class_init (GtkEventBoxClass *class) { GObjectClass *gobject_class = G_OBJECT_CLASS (class); GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class); - GtkContainerClass *container_class = GTK_CONTAINER_CLASS (class); gobject_class->set_property = gtk_event_box_set_property; gobject_class->get_property = gtk_event_box_get_property; @@ -106,8 +105,6 @@ gtk_event_box_class_init (GtkEventBoxClass *class) widget_class->size_allocate = gtk_event_box_size_allocate; widget_class->draw = gtk_event_box_draw; - gtk_container_class_handle_border_width (container_class); - g_object_class_install_property (gobject_class, PROP_VISIBLE_WINDOW, g_param_spec_boolean ("visible-window", diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 05827a2082..9be432059d 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -2681,10 +2681,7 @@ save_widgets_create (GtkFileChooserWidget *impl) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_style_context_add_class (gtk_widget_get_style_context (vbox), "search-bar"); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 0); - priv->save_widgets_table = gtk_grid_new (); - gtk_container_set_border_width (GTK_CONTAINER (priv->save_widgets_table), 10); gtk_box_pack_start (GTK_BOX (vbox), priv->save_widgets_table, FALSE, FALSE); gtk_widget_show (priv->save_widgets_table); gtk_grid_set_row_spacing (GTK_GRID (priv->save_widgets_table), 12); diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index 751e7b3478..2edc2faeb4 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -140,7 +140,6 @@ gtk_fixed_class_init (GtkFixedClass *class) container_class->child_type = gtk_fixed_child_type; container_class->set_child_property = gtk_fixed_set_child_property; container_class->get_child_property = gtk_fixed_get_child_property; - gtk_container_class_handle_border_width (container_class); gtk_container_class_install_child_property (container_class, CHILD_PROP_X, diff --git a/gtk/gtkflowbox.c b/gtk/gtkflowbox.c index ed50e5f228..b3a914b1af 100644 --- a/gtk/gtkflowbox.c +++ b/gtk/gtkflowbox.c @@ -3798,7 +3798,6 @@ gtk_flow_box_class_init (GtkFlowBoxClass *class) container_class->remove = gtk_flow_box_remove; container_class->forall = gtk_flow_box_forall; container_class->child_type = gtk_flow_box_child_type; - gtk_container_class_handle_border_width (container_class); class->activate_cursor_child = gtk_flow_box_activate_cursor_child; class->toggle_cursor_child = gtk_flow_box_toggle_cursor_child; diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index 56fb8c9597..2ad519f5e4 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -272,8 +272,6 @@ gtk_frame_class_init (GtkFrameClass *class) container_class->remove = gtk_frame_remove; container_class->forall = gtk_frame_forall; - gtk_container_class_handle_border_width (container_class); - class->compute_child_allocation = gtk_frame_real_compute_child_allocation; gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_FRAME_ACCESSIBLE); diff --git a/gtk/gtkgrid.c b/gtk/gtkgrid.c index 357dbb1bc7..31808d036a 100644 --- a/gtk/gtkgrid.c +++ b/gtk/gtkgrid.c @@ -1752,7 +1752,6 @@ gtk_grid_class_init (GtkGridClass *class) container_class->child_type = gtk_grid_child_type; container_class->set_child_property = gtk_grid_set_child_property; container_class->get_child_property = gtk_grid_get_child_property; - gtk_container_class_handle_border_width (container_class); g_object_class_override_property (object_class, PROP_ORIENTATION, "orientation"); diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c index f2bde019a6..268eb2086b 100644 --- a/gtk/gtkheaderbar.c +++ b/gtk/gtkheaderbar.c @@ -1984,7 +1984,6 @@ gtk_header_bar_class_init (GtkHeaderBarClass *class) container_class->child_type = gtk_header_bar_child_type; container_class->set_child_property = gtk_header_bar_set_child_property; container_class->get_child_property = gtk_header_bar_get_child_property; - gtk_container_class_handle_border_width (container_class); gtk_container_class_install_child_property (container_class, CHILD_PROP_PACK_TYPE, diff --git a/gtk/gtkmenu.c b/gtk/gtkmenu.c index 1f08ed444f..1921dd4edb 100644 --- a/gtk/gtkmenu.c +++ b/gtk/gtkmenu.c @@ -2628,7 +2628,6 @@ gtk_menu_realize (GtkWidget *widget) GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; - gint border_width; GtkWidget *child; GList *children; GtkBorder arrow_border, padding; @@ -2657,16 +2656,13 @@ gtk_menu_realize (GtkWidget *widget) gtk_widget_register_window (widget, window); get_menu_padding (widget, &padding); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); gtk_widget_get_allocation (widget, &allocation); - attributes.x = border_width + padding.left; - attributes.y = border_width + padding.top; - attributes.width = allocation.width - - (2 * border_width) - padding.left - padding.right; - attributes.height = allocation.height - - (2 * border_width) - padding.top - padding.bottom; + attributes.x = padding.left; + attributes.y = padding.top; + attributes.width = allocation.width - padding.left - padding.right; + attributes.height = allocation.height - padding.top - padding.bottom; get_arrows_border (menu, &arrow_border); attributes.y += arrow_border.top; @@ -2684,10 +2680,8 @@ gtk_menu_realize (GtkWidget *widget) attributes.x = 0; attributes.y = - priv->scroll_offset; - attributes.width = allocation.width + (2 * border_width) + - padding.left + padding.right; - attributes.height = priv->requested_height - (2 * border_width) + - padding.top + padding.bottom; + attributes.width = allocation.width + padding.left + padding.right; + attributes.height = priv->requested_height + padding.top + padding.bottom; attributes.width = MAX (1, attributes.width); attributes.height = MAX (1, attributes.height); @@ -2805,7 +2799,6 @@ calculate_line_heights (GtkMenu *menu, GtkMenuShell *menu_shell; GtkWidget *child, *widget; GList *children; - guint border_width; guint n_columns; gint n_heights; guint *min_heights; @@ -2824,8 +2817,7 @@ calculate_line_heights (GtkMenu *menu, get_menu_padding (widget, &padding); - border_width = gtk_container_get_border_width (GTK_CONTAINER (menu)); - avail_width -= (border_width) * 2 + padding.left + padding.right; + avail_width -= padding.left + padding.right; for (children = menu_shell->priv->children; children; children = children->next) { @@ -2881,7 +2873,6 @@ gtk_menu_size_allocate (GtkWidget *widget, GList *children; gint x, y, i; gint width, height; - guint border_width; GtkBorder arrow_border, padding; g_return_if_fail (GTK_IS_MENU (widget)); @@ -2894,7 +2885,6 @@ gtk_menu_size_allocate (GtkWidget *widget, gtk_widget_set_allocation (widget, allocation); get_menu_padding (widget, &padding); - border_width = gtk_container_get_border_width (GTK_CONTAINER (menu)); g_free (priv->heights); priv->heights_length = calculate_line_heights (menu, @@ -2903,14 +2893,14 @@ gtk_menu_size_allocate (GtkWidget *widget, NULL); /* refresh our cached height request */ - priv->requested_height = (2 * border_width) + padding.top + padding.bottom; + priv->requested_height = padding.top + padding.bottom; for (i = 0; i < priv->heights_length; i++) priv->requested_height += priv->heights[i]; - x = border_width + padding.left; - y = border_width + padding.top; - width = allocation->width - (2 * border_width) - padding.left - padding.right; - height = allocation->height - (2 * border_width) - padding.top - padding.bottom; + x = padding.left; + y = padding.top; + width = allocation->width - padding.left - padding.right; + height = allocation->height - padding.top - padding.bottom; if (menu_shell->priv->active) gtk_menu_scroll_to (menu, priv->scroll_offset); @@ -3077,7 +3067,6 @@ gtk_menu_get_preferred_width (GtkWidget *widget, GList *children; guint max_toggle_size; guint max_accel_width; - guint border_width; gint child_min, child_nat; gint min_width, nat_width; GtkBorder padding; @@ -3160,9 +3149,8 @@ gtk_menu_get_preferred_width (GtkWidget *widget, nat_width *= gtk_menu_get_n_columns (menu); get_menu_padding (widget, &padding); - border_width = gtk_container_get_border_width (GTK_CONTAINER (menu)); - min_width += (2 * border_width) + padding.left + padding.right; - nat_width += (2 * border_width) + padding.left + padding.right; + min_width += padding.left + padding.right; + nat_width += padding.left + padding.right; priv->toggle_size = max_toggle_size; priv->accel_size = max_accel_width; @@ -3195,14 +3183,12 @@ gtk_menu_get_preferred_height_for_width (GtkWidget *widget, GtkMenu *menu = GTK_MENU (widget); GtkMenuPrivate *priv = menu->priv; guint *min_heights, *nat_heights; - guint border_width; gint n_heights, i; gint min_height, single_height, nat_height; - border_width = gtk_container_get_border_width (GTK_CONTAINER (menu)); get_menu_padding (widget, &padding); - min_height = nat_height = (2 * border_width) + padding.top + padding.bottom; + min_height = nat_height = padding.top + padding.bottom; single_height = 0; n_heights = @@ -3216,8 +3202,7 @@ gtk_menu_get_preferred_height_for_width (GtkWidget *widget, } get_arrows_border (menu, &arrow_border); - single_height += (2 * border_width) - + padding.top + padding.bottom + single_height += padding.top + padding.bottom + arrow_border.top + arrow_border.bottom; min_height = MIN (min_height, single_height); @@ -3605,7 +3590,6 @@ get_arrows_sensitive_area (GtkMenu *menu, GtkWidget *widget = GTK_WIDGET (menu); GdkWindow *window; gint width, height; - guint border; gint win_x, win_y; GtkBorder padding; gint top_arrow_height, bottom_arrow_height; @@ -3625,7 +3609,6 @@ get_arrows_sensitive_area (GtkMenu *menu, width = gdk_window_get_width (window); height = gdk_window_get_height (window); - border = gtk_container_get_border_width (GTK_CONTAINER (menu)); get_menu_padding (widget, &padding); gdk_window_get_position (window, &win_x, &win_y); @@ -3635,15 +3618,15 @@ get_arrows_sensitive_area (GtkMenu *menu, upper->x = win_x; upper->y = win_y; upper->width = width; - upper->height = top_arrow_height + border + padding.top; + upper->height = top_arrow_height + padding.top; } if (lower) { lower->x = win_x; - lower->y = win_y + height - border - padding.bottom - bottom_arrow_height; + lower->y = win_y + height - padding.bottom - bottom_arrow_height; lower->width = width; - lower->height = bottom_arrow_height + border + padding.bottom; + lower->height = bottom_arrow_height + padding.bottom; } } @@ -4661,7 +4644,6 @@ gtk_menu_scroll_to (GtkMenu *menu, GtkWidget *widget; gint x, y; gint view_width, view_height; - gint border_width; widget = GTK_WIDGET (menu); @@ -4671,13 +4653,11 @@ gtk_menu_scroll_to (GtkMenu *menu, get_menu_padding (widget, &padding); - border_width = gtk_container_get_border_width (GTK_CONTAINER (menu)); + view_width -= padding.left + padding.right; + view_height -= padding.top + padding.bottom; - view_width -= (2 * border_width) + padding.left + padding.right; - view_height -= (2 * border_width) + padding.top + padding.bottom; - - x = border_width + padding.left; - y = border_width + padding.top; + x = padding.left; + y = padding.top; top_arrow_node = gtk_css_gadget_get_node (priv->top_arrow_gadget); gtk_css_node_set_visible (top_arrow_node, priv->upper_arrow_visible); @@ -4762,8 +4742,7 @@ gtk_menu_scroll_item_visible (GtkMenuShell *menu_shell, get_menu_padding (widget, &padding); - height -= 2 * gtk_container_get_border_width (GTK_CONTAINER (menu)) + - padding.top + padding.bottom; + height -= padding.top + padding.bottom; if (child_offset < y) { @@ -5072,16 +5051,13 @@ get_visible_size (GtkMenu *menu) { GtkAllocation allocation; GtkWidget *widget = GTK_WIDGET (menu); - GtkContainer *container = GTK_CONTAINER (menu); GtkBorder padding, arrow_border; gint menu_height; gtk_widget_get_allocation (widget, &allocation); get_menu_padding (widget, &padding); - menu_height = (allocation.height - - (2 * gtk_container_get_border_width (container)) - - padding.top - padding.bottom); + menu_height = allocation.height - padding.top - padding.bottom; get_arrows_border (menu, &arrow_border); menu_height -= arrow_border.top; @@ -5146,8 +5122,7 @@ get_menu_height (GtkMenu *menu) get_menu_padding (widget, &padding); height = priv->requested_height; - height -= (gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2) + - padding.top + padding.bottom; + height -= padding.top + padding.bottom; get_arrows_border (menu, &arrow_border); height -= arrow_border.top; diff --git a/gtk/gtkmenubar.c b/gtk/gtkmenubar.c index f6f771d1cb..bdf2ce0214 100644 --- a/gtk/gtkmenubar.c +++ b/gtk/gtkmenubar.c @@ -138,14 +138,12 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) GObjectClass *gobject_class; GtkWidgetClass *widget_class; GtkMenuShellClass *menu_shell_class; - GtkContainerClass *container_class; GtkBindingSet *binding_set; gobject_class = (GObjectClass*) class; widget_class = (GtkWidgetClass*) class; menu_shell_class = (GtkMenuShellClass*) class; - container_class = (GtkContainerClass*) class; gobject_class->get_property = gtk_menu_bar_get_property; gobject_class->set_property = gtk_menu_bar_set_property; @@ -239,7 +237,6 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class) GTK_PACK_DIRECTION_LTR, GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY)); - gtk_container_class_handle_border_width (container_class); gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_MENU_BAR); gtk_widget_class_set_css_name (widget_class, "menubar"); } diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c index c4d511f9a5..efa30591e5 100644 --- a/gtk/gtkmenuitem.c +++ b/gtk/gtkmenuitem.c @@ -814,8 +814,6 @@ gtk_menu_item_class_init (GtkMenuItemClass *klass) gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_MENU_ITEM_ACCESSIBLE); gtk_widget_class_set_css_name (widget_class, "menuitem"); - - gtk_container_class_handle_border_width (container_class); } static void diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c index ed48e85e18..f55479be64 100644 --- a/gtk/gtkmessagedialog.c +++ b/gtk/gtkmessagedialog.c @@ -110,8 +110,6 @@ struct _GtkMessageDialogPrivate guint message_type : 3; }; -static void gtk_message_dialog_style_updated (GtkWidget *widget); - static void gtk_message_dialog_constructed (GObject *object); static void gtk_message_dialog_set_property (GObject *object, guint prop_id, @@ -161,23 +159,12 @@ gtk_message_dialog_class_init (GtkMessageDialogClass *class) widget_class = GTK_WIDGET_CLASS (class); gobject_class = G_OBJECT_CLASS (class); - widget_class->style_updated = gtk_message_dialog_style_updated; - gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_ALERT); gobject_class->constructed = gtk_message_dialog_constructed; gobject_class->set_property = gtk_message_dialog_set_property; gobject_class->get_property = gtk_message_dialog_get_property; - gtk_widget_class_install_style_property (widget_class, - g_param_spec_int ("message-border", - P_("label border"), - P_("Width of border around the label in the message dialog"), - 0, - G_MAXINT, - 12, - GTK_PARAM_READABLE)); - /** * GtkMessageDialog:message-type: * @@ -323,7 +310,6 @@ gtk_message_dialog_init (GtkMessageDialog *dialog) priv->message_type = GTK_MESSAGE_OTHER; gtk_widget_init_template (GTK_WIDGET (dialog)); - gtk_message_dialog_style_updated (GTK_WIDGET (dialog)); G_GNUC_BEGIN_IGNORE_DEPRECATIONS action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog)); G_GNUC_END_IGNORE_DEPRECATIONS @@ -971,23 +957,3 @@ gtk_message_dialog_add_buttons (GtkMessageDialog* message_dialog, g_object_notify (G_OBJECT (message_dialog), "buttons"); } -static void -gtk_message_dialog_style_updated (GtkWidget *widget) -{ - GtkMessageDialog *dialog = GTK_MESSAGE_DIALOG (widget); - GtkWidget *parent; - gint border_width; - - parent = gtk_widget_get_parent (dialog->priv->message_area); - - if (parent) - { - gtk_widget_style_get (widget, "message-border", - &border_width, NULL); - - gtk_container_set_border_width (GTK_CONTAINER (parent), - MAX (0, border_width - 7)); - } - - GTK_WIDGET_CLASS (gtk_message_dialog_parent_class)->style_updated (widget); -} diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c index 83408448e8..db8a602181 100644 --- a/gtk/gtkmountoperation.c +++ b/gtk/gtkmountoperation.c @@ -532,9 +532,7 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS G_GNUC_END_IGNORE_DEPRECATIONS /* Set the dialog up with HIG properties */ - gtk_container_set_border_width (GTK_CONTAINER (dialog), 5); gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width (GTK_CONTAINER (action_area), 5); gtk_box_set_spacing (GTK_BOX (action_area), 6); gtk_window_set_resizable (window, FALSE); @@ -550,7 +548,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS /* Build contents */ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12); - gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_box_pack_start (GTK_BOX (content_area), hbox, TRUE, TRUE); icon = gtk_image_new_from_icon_name ("dialog-password", @@ -1407,7 +1404,6 @@ create_show_processes_dialog (GtkMountOperation *op, content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE); if (secondary != NULL) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index ea120d2523..430ac06553 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -1152,8 +1152,6 @@ gtk_notebook_class_init (GtkNotebookClass *class) add_tab_bindings (binding_set, GDK_CONTROL_MASK, GTK_DIR_TAB_FORWARD); add_tab_bindings (binding_set, GDK_CONTROL_MASK | GDK_SHIFT_MASK, GTK_DIR_TAB_BACKWARD); - gtk_container_class_handle_border_width (container_class); - gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_NOTEBOOK_ACCESSIBLE); gtk_widget_class_set_css_name (widget_class, "notebook"); } diff --git a/gtk/gtkoffscreenwindow.c b/gtk/gtkoffscreenwindow.c index ec2594c7fb..367927ff77 100644 --- a/gtk/gtkoffscreenwindow.c +++ b/gtk/gtkoffscreenwindow.c @@ -56,13 +56,10 @@ gtk_offscreen_window_get_preferred_width (GtkWidget *widget, { GtkBin *bin = GTK_BIN (widget); GtkWidget *child; - gint border_width; gint default_width; - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - - *minimum = border_width * 2; - *natural = border_width * 2; + *minimum = 0; + *natural = 0; child = gtk_bin_get_child (bin); @@ -90,13 +87,10 @@ gtk_offscreen_window_get_preferred_height (GtkWidget *widget, { GtkBin *bin = GTK_BIN (widget); GtkWidget *child; - gint border_width; gint default_height; - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - - *minimum = border_width * 2; - *natural = border_width * 2; + *minimum = 0; + *natural = 0; child = gtk_bin_get_child (bin); @@ -123,12 +117,9 @@ gtk_offscreen_window_size_allocate (GtkWidget *widget, { GtkBin *bin = GTK_BIN (widget); GtkWidget *child; - gint border_width; gtk_widget_set_allocation (widget, allocation); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - if (gtk_widget_get_realized (widget)) gdk_window_move_resize (gtk_widget_get_window (widget), allocation->x, @@ -142,10 +133,10 @@ gtk_offscreen_window_size_allocate (GtkWidget *widget, { GtkAllocation child_alloc; - child_alloc.x = border_width; - child_alloc.y = border_width; - child_alloc.width = allocation->width - 2 * border_width; - child_alloc.height = allocation->height - 2 * border_width; + child_alloc.x = 0; + child_alloc.y = 0; + child_alloc.width = allocation->width; + child_alloc.height = allocation->height; gtk_widget_size_allocate (child, &child_alloc); } diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c index 67b39a9b86..9dd2edefbe 100644 --- a/gtk/gtkpaned.c +++ b/gtk/gtkpaned.c @@ -349,7 +349,6 @@ gtk_paned_class_init (GtkPanedClass *class) container_class->set_focus_child = gtk_paned_set_focus_child; container_class->set_child_property = gtk_paned_set_child_property; container_class->get_child_property = gtk_paned_get_child_property; - gtk_container_class_handle_border_width (container_class); paned_class->cycle_child_focus = gtk_paned_cycle_child_focus; paned_class->toggle_handle_focus = gtk_paned_toggle_handle_focus; diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index b35c5b35ee..9b2265fabd 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -237,7 +237,6 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class) container_class->add = gtk_path_bar_add; container_class->forall = gtk_path_bar_forall; container_class->remove = gtk_path_bar_remove; - gtk_container_class_handle_border_width (container_class); /* FIXME: */ /* container_class->child_type = gtk_path_bar_child_type;*/ diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c index 0105800bbf..a0fae51309 100644 --- a/gtk/gtkplacesview.c +++ b/gtk/gtkplacesview.c @@ -569,7 +569,6 @@ populate_servers (GtkPlacesView *view) grid = g_object_new (GTK_TYPE_GRID, "orientation", GTK_ORIENTATION_VERTICAL, - "border-width", 3, NULL); /* name of the connected uri, if any */ diff --git a/gtk/gtkpopover.c b/gtk/gtkpopover.c index 4aee40f7e5..b2716f5d0f 100644 --- a/gtk/gtkpopover.c +++ b/gtk/gtkpopover.c @@ -1223,19 +1223,16 @@ get_padding_and_border (GtkWidget *widget, GtkBorder *border) { GtkStyleContext *context; - gint border_width; GtkBorder tmp; context = gtk_widget_get_style_context (widget); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - gtk_style_context_get_padding (context, border); gtk_style_context_get_border (context, &tmp); - border->top += tmp.top + border_width; - border->right += tmp.right + border_width; - border->bottom += tmp.bottom + border_width; - border->left += tmp.left + border_width; + border->top += tmp.top; + border->right += tmp.right; + border->bottom += tmp.bottom; + border->left += tmp.left; } static gint diff --git a/gtk/gtkrecentchooserdialog.c b/gtk/gtkrecentchooserdialog.c index 8486e72c99..f83db7856e 100644 --- a/gtk/gtkrecentchooserdialog.c +++ b/gtk/gtkrecentchooserdialog.c @@ -127,7 +127,7 @@ static void gtk_recent_chooser_dialog_init (GtkRecentChooserDialog *dialog) { GtkRecentChooserDialogPrivate *priv; - GtkWidget *content_area, *action_area; + GtkWidget *content_area; GtkDialog *rc_dialog = GTK_DIALOG (dialog); priv = gtk_recent_chooser_dialog_get_instance_private (dialog); @@ -135,13 +135,8 @@ gtk_recent_chooser_dialog_init (GtkRecentChooserDialog *dialog) gtk_dialog_set_use_header_bar_from_setting (GTK_DIALOG (dialog)); content_area = gtk_dialog_get_content_area (rc_dialog); -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - action_area = gtk_dialog_get_action_area (rc_dialog); -G_GNUC_END_IGNORE_DEPRECATIONS - gtk_container_set_border_width (GTK_CONTAINER (rc_dialog), 5); gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */ - gtk_container_set_border_width (GTK_CONTAINER (action_area), 5); } /* we intercept the GtkRecentChooser::item_activated signal and try to @@ -213,7 +208,6 @@ gtk_recent_chooser_dialog_constructed (GObject *object) content_area = gtk_dialog_get_content_area (GTK_DIALOG (object)); - gtk_container_set_border_width (GTK_CONTAINER (priv->chooser), 5); gtk_box_pack_start (GTK_BOX (content_area), priv->chooser, TRUE, TRUE); gtk_widget_show (priv->chooser); diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c index 27f467779d..7806c866d1 100644 --- a/gtk/gtkscrolledwindow.c +++ b/gtk/gtkscrolledwindow.c @@ -556,7 +556,6 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class) container_class->add = gtk_scrolled_window_add; container_class->remove = gtk_scrolled_window_remove; container_class->forall = gtk_scrolled_window_forall; - gtk_container_class_handle_border_width (container_class); class->scroll_child = gtk_scrolled_window_scroll_child; class->move_focus_out = gtk_scrolled_window_move_focus_out; diff --git a/gtk/gtkshortcutssection.c b/gtk/gtkshortcutssection.c index 2ec177d29a..4fe60414db 100644 --- a/gtk/gtkshortcutssection.c +++ b/gtk/gtkshortcutssection.c @@ -428,7 +428,6 @@ gtk_shortcuts_section_init (GtkShortcutsSection *self) gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL); gtk_box_set_homogeneous (GTK_BOX (self), FALSE); gtk_box_set_spacing (GTK_BOX (self), 22); - gtk_container_set_border_width (GTK_CONTAINER (self), 24); self->stack = g_object_new (GTK_TYPE_STACK, "homogeneous", TRUE, diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c index 1e1bf8f6f2..4f40231267 100644 --- a/gtk/gtkshortcutswindow.c +++ b/gtk/gtkshortcutswindow.c @@ -963,7 +963,6 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self) G_GNUC_END_IGNORE_DEPRECATIONS; priv->popover = g_object_new (GTK_TYPE_POPOVER, - "border-width", 6, "relative-to", priv->menu_button, "position", GTK_POS_BOTTOM, NULL); @@ -1002,7 +1001,6 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self) "visible", TRUE, NULL); box = g_object_new (GTK_TYPE_BOX, - "border-width", 24, "halign", GTK_ALIGN_CENTER, "spacing", 24, "orientation", GTK_ORIENTATION_VERTICAL, diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c index fe4190e251..a06d4cc2b8 100644 --- a/gtk/gtkspinbutton.c +++ b/gtk/gtkspinbutton.c @@ -134,7 +134,6 @@ * adjustment = gtk_adjustment_new (50.0, 0.0, 100.0, 1.0, 5.0, 0.0); * * window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - * gtk_container_set_border_width (GTK_CONTAINER (window), 5); * * // creates the spinbutton, with no decimal places * button = gtk_spin_button_new (adjustment, 1.0, 0); @@ -166,7 +165,6 @@ * adjustment = gtk_adjustment_new (2.500, 0.0, 5.0, 0.001, 0.1, 0.0); * * window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - * gtk_container_set_border_width (GTK_CONTAINER (window), 5); * * // creates the spinbutton, with three decimal places * button = gtk_spin_button_new (adjustment, 0.001, 3); diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c index ca3e4e43e1..44fbe2068b 100644 --- a/gtk/gtkstack.c +++ b/gtk/gtkstack.c @@ -452,7 +452,6 @@ gtk_stack_class_init (GtkStackClass *klass) container_class->forall = gtk_stack_forall; container_class->set_child_property = gtk_stack_set_child_property; container_class->get_child_property = gtk_stack_get_child_property; - gtk_container_class_handle_border_width (container_class); stack_props[PROP_HOMOGENEOUS] = g_param_spec_boolean ("homogeneous", P_("Homogeneous"), P_("Homogeneous sizing"), diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 84b6599d4f..c4ee2228a0 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -1802,7 +1802,6 @@ _gtk_text_view_ensure_magnifier (GtkTextView *text_view) gtk_popover_set_modal (GTK_POPOVER (priv->magnifier_popover), FALSE); gtk_container_add (GTK_CONTAINER (priv->magnifier_popover), priv->magnifier); - gtk_container_set_border_width (GTK_CONTAINER (priv->magnifier_popover), 4); gtk_widget_show (priv->magnifier); } @@ -3976,7 +3975,6 @@ gtk_text_view_size_request (GtkWidget *widget, GtkTextView *text_view; GtkTextViewPrivate *priv; GSList *tmp_list; - guint border_width; text_view = GTK_TEXT_VIEW (widget); priv = text_view->priv; @@ -4007,10 +4005,6 @@ gtk_text_view_size_request (GtkWidget *widget, if (priv->bottom_window) requisition->height += priv->bottom_window->requisition.height; - border_width = gtk_container_get_border_width (GTK_CONTAINER (text_view)); - requisition->width += border_width * 2; - requisition->height += border_width * 2; - requisition->height += priv->top_border + priv->bottom_border; requisition->width += priv->left_border + priv->right_border; @@ -4231,7 +4225,6 @@ gtk_text_view_size_allocate (GtkWidget *widget, GdkRectangle right_rect; GdkRectangle top_rect; GdkRectangle bottom_rect; - guint border_width; gboolean size_changed; text_view = GTK_TEXT_VIEW (widget); @@ -4247,8 +4240,6 @@ gtk_text_view_size_allocate (GtkWidget *widget, widget_allocation.width != allocation->width || widget_allocation.height != allocation->height; - border_width = gtk_container_get_border_width (GTK_CONTAINER (text_view)); - gtk_widget_set_allocation (widget, allocation); if (gtk_widget_get_realized (widget)) @@ -4262,7 +4253,7 @@ gtk_text_view_size_allocate (GtkWidget *widget, * windows get at least a 1x1 allocation. */ - width = allocation->width - border_width * 2; + width = allocation->width; if (priv->left_window) left_rect.width = priv->left_window->requisition.width; @@ -4283,7 +4274,7 @@ gtk_text_view_size_allocate (GtkWidget *widget, top_rect.width = text_rect.width; bottom_rect.width = text_rect.width; - height = allocation->height - border_width * 2; + height = allocation->height; if (priv->top_window) top_rect.height = priv->top_window->requisition.height; @@ -4305,8 +4296,8 @@ gtk_text_view_size_allocate (GtkWidget *widget, right_rect.height = text_rect.height; /* Origins */ - left_rect.x = border_width; - top_rect.y = border_width; + left_rect.x = 0; + top_rect.y = 0; text_rect.x = left_rect.x + left_rect.width; text_rect.y = top_rect.y + top_rect.height; diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 71913da069..e7f270dde6 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -433,8 +433,6 @@ gtk_toolbar_class_init (GtkToolbarClass *klass) container_class->get_child_property = gtk_toolbar_get_child_property; container_class->set_child_property = gtk_toolbar_set_child_property; - gtk_container_class_handle_border_width (container_class); - klass->orientation_changed = gtk_toolbar_orientation_changed; klass->style_changed = gtk_toolbar_real_style_changed; diff --git a/gtk/gtktoolitem.c b/gtk/gtktoolitem.c index c877985496..0c59eae158 100644 --- a/gtk/gtktoolitem.c +++ b/gtk/gtktoolitem.c @@ -169,8 +169,6 @@ gtk_tool_item_class_init (GtkToolItemClass *klass) widget_class->size_allocate = gtk_tool_item_size_allocate; widget_class->parent_set = gtk_tool_item_parent_set; - gtk_container_class_handle_border_width (GTK_CONTAINER_CLASS (klass)); - klass->create_menu_proxy = _gtk_tool_item_create_menu_proxy; g_object_class_install_property (object_class, diff --git a/gtk/gtktoolitemgroup.c b/gtk/gtktoolitemgroup.c index 38fedeb4d2..6dd15717a2 100644 --- a/gtk/gtktoolitemgroup.c +++ b/gtk/gtktoolitemgroup.c @@ -582,7 +582,6 @@ gtk_tool_item_group_size_request (GtkWidget *widget, GtkOrientation orientation; GtkRequisition item_size; gint requested_rows; - guint border_width; if (priv->children && gtk_tool_item_group_get_label_widget (group)) { @@ -604,10 +603,6 @@ gtk_tool_item_group_size_request (GtkWidget *widget, requisition->width = MAX (requisition->width, item_size.width); else requisition->height = MAX (requisition->height, item_size.height * requested_rows); - - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - requisition->width += border_width * 2; - requisition->height += border_width * 2; } static void @@ -679,9 +674,7 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget, GtkOrientation orientation; gint min_rows; - guint border_width; - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); orientation = gtk_tool_shell_get_orientation (GTK_TOOL_SHELL (group)); /* figure out the size of homogeneous items */ @@ -713,7 +706,7 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget, gint row = -1; guint col = 0; - item_area.width = allocation->width - 2 * border_width; + item_area.width = allocation->width; n_columns = MAX (item_area.width / item_size.width, 1); /* calculate required rows for n_columns columns */ @@ -770,7 +763,7 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget, guint col = 0, min_col, max_col = 0, all_items = 0; gint i; - item_area.height = allocation->height - 2 * border_width; + item_area.height = allocation->height; n_rows = MAX (item_area.height / item_size.height, min_rows); row_min_width = g_new0 (guint, n_rows); @@ -907,8 +900,8 @@ gtk_tool_item_group_real_size_query (GtkWidget *widget, } /* report effective widget size */ - inquery->width += item_area.width + 2 * border_width; - inquery->height += item_area.height + 2 * border_width; + inquery->width += item_area.width; + inquery->height += item_area.height; } static void @@ -929,11 +922,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, gint n_columns, n_rows = 1; gint min_rows; - guint border_width; GtkTextDirection direction; - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - direction = gtk_widget_get_direction (widget); orientation = gtk_tool_shell_get_orientation (GTK_TOOL_SHELL (group)); @@ -941,8 +931,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, /* chain up */ GTK_WIDGET_CLASS (gtk_tool_item_group_parent_class)->size_allocate (widget, allocation); - child_allocation.x = border_width; - child_allocation.y = border_width; + child_allocation.x = 0; + child_allocation.y = 0; /* place the header widget */ if (gtk_widget_get_visible (priv->header)) @@ -961,7 +951,7 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, child_allocation.height = allocation->height; if (GTK_TEXT_DIR_RTL == direction) - child_allocation.x = allocation->width - border_width - child_allocation.width; + child_allocation.x = allocation->width - child_allocation.width; } gtk_widget_size_allocate (priv->header, &child_allocation); @@ -971,7 +961,7 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, else if (GTK_TEXT_DIR_RTL != direction) child_allocation.x += child_allocation.width; else - child_allocation.x = border_width; + child_allocation.x = 0; } else child_requisition.width = child_requisition.height = 0; @@ -987,8 +977,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, { item_size.width = MIN (item_size.width, allocation->width); - item_area.width = allocation->width - 2 * border_width; - item_area.height = allocation->height - 2 * border_width - child_requisition.height; + item_area.width = allocation->width; + item_area.height = allocation->height - child_requisition.height; n_columns = MAX (item_area.width / item_size.width, 1); @@ -998,8 +988,8 @@ gtk_tool_item_group_real_size_allocate (GtkWidget *widget, { item_size.height = MIN (item_size.height, allocation->height); - item_area.width = allocation->width - 2 * border_width - child_requisition.width; - item_area.height = allocation->height - 2 * border_width; + item_area.width = allocation->width - child_requisition.width; + item_area.height = allocation->height; n_columns = MAX (item_area.width / item_size.width, 1); n_rows = MAX (item_area.height / item_size.height, min_rows); @@ -1242,18 +1232,16 @@ gtk_tool_item_group_realize (GtkWidget *widget) GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; - guint border_width; gtk_widget_set_realized (widget, TRUE); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); gtk_widget_get_allocation (widget, &allocation); attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = allocation.x + border_width; - attributes.y = allocation.y + border_width; - attributes.width = allocation.width - border_width * 2; - attributes.height = allocation.height - border_width * 2; + attributes.x = allocation.x; + attributes.y = allocation.y; + attributes.width = allocation.width; + attributes.height = allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events (widget) | GDK_VISIBILITY_NOTIFY_MASK diff --git a/gtk/gtktoolpalette.c b/gtk/gtktoolpalette.c index a5258233c5..93481bf0f5 100644 --- a/gtk/gtktoolpalette.c +++ b/gtk/gtktoolpalette.c @@ -420,11 +420,8 @@ gtk_tool_palette_size_request (GtkWidget *widget, { GtkToolPalette *palette = GTK_TOOL_PALETTE (widget); GtkRequisition child_requisition; - guint border_width; guint i; - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - requisition->width = 0; requisition->height = 0; @@ -449,9 +446,6 @@ gtk_tool_palette_size_request (GtkWidget *widget, requisition->height = MAX (requisition->height, child_requisition.height); } } - - requisition->width += border_width * 2; - requisition->height += border_width * 2; } static void @@ -494,7 +488,6 @@ gtk_tool_palette_size_allocate (GtkWidget *widget, gint total_size, page_size; gint offset = 0; guint i; - guint border_width; gint min_offset = -1, max_offset = -1; @@ -503,7 +496,6 @@ gtk_tool_palette_size_allocate (GtkWidget *widget, gint *group_sizes = g_newa (gint, palette->priv->groups->len); GtkTextDirection direction; - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); direction = gtk_widget_get_direction (widget); GTK_WIDGET_CLASS (gtk_tool_palette_parent_class)->size_allocate (widget, allocation); @@ -526,9 +518,9 @@ gtk_tool_palette_size_allocate (GtkWidget *widget, offset = -offset; if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation) - child_allocation.width = allocation->width - border_width * 2; + child_allocation.width = allocation->width; else - child_allocation.height = allocation->height - border_width * 2; + child_allocation.height = allocation->height; if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation) remaining_space = allocation->height; @@ -613,8 +605,8 @@ gtk_tool_palette_size_allocate (GtkWidget *widget, if (remaining_space > 0) offset = 0; - x = border_width; - child_allocation.y = border_width; + x = 0; + child_allocation.y = 0; if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation) child_allocation.y -= offset; @@ -664,14 +656,12 @@ gtk_tool_palette_size_allocate (GtkWidget *widget, if (GTK_ORIENTATION_VERTICAL == palette->priv->orientation) { - child_allocation.y += border_width; child_allocation.y += offset; total_size = child_allocation.y; } else { - x += border_width; x += offset; total_size = x; @@ -716,19 +706,16 @@ gtk_tool_palette_realize (GtkWidget *widget) GdkWindow *window; GdkWindowAttr attributes; gint attributes_mask; - guint border_width; gtk_widget_set_realized (widget, TRUE); - border_width = gtk_container_get_border_width (GTK_CONTAINER (widget)); - gtk_widget_get_allocation (widget, &allocation); attributes.window_type = GDK_WINDOW_CHILD; - attributes.x = allocation.x + border_width; - attributes.y = allocation.y + border_width; - attributes.width = allocation.width - border_width * 2; - attributes.height = allocation.height - border_width * 2; + attributes.x = allocation.x; + attributes.y = allocation.y; + attributes.width = allocation.width; + attributes.height = allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.event_mask = gtk_widget_get_events (widget) | GDK_VISIBILITY_NOTIFY_MASK diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index d03e47e13f..70dda49a85 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -11203,7 +11203,6 @@ gtk_tree_view_ensure_interactive_directory (GtkTreeView *tree_view) vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_widget_show (vbox); gtk_container_add (GTK_CONTAINER (frame), vbox); - gtk_container_set_border_width (GTK_CONTAINER (vbox), 3); /* add entry */ tree_view->priv->search_entry = gtk_entry_new (); diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c index 1f7b4949e8..ff6ffbae32 100644 --- a/gtk/gtkviewport.c +++ b/gtk/gtkviewport.c @@ -394,7 +394,6 @@ gtk_viewport_class_init (GtkViewportClass *class) container_class->remove = gtk_viewport_remove; container_class->add = gtk_viewport_add; - gtk_container_class_handle_border_width (container_class); /* GtkScrollable implementation */ g_object_class_override_property (gobject_class, PROP_HADJUSTMENT, "hadjustment"); diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 9a329cc9bb..93ad17120d 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7294,7 +7294,6 @@ _gtk_window_set_allocation (GtkWindow *window, GtkWidget *widget = (GtkWidget *)window; GtkWindowPrivate *priv = window->priv; GtkAllocation child_allocation; - gint border_width; GtkBorder window_border = { 0 }; GList *link; @@ -7356,12 +7355,6 @@ _gtk_window_set_allocation (GtkWindow *window, allocation->width, allocation->height); } - border_width = gtk_container_get_border_width (GTK_CONTAINER (window)); - child_allocation.x += border_width; - child_allocation.y += border_width; - child_allocation.width = MAX (1, child_allocation.width - border_width * 2); - child_allocation.height = MAX (1, child_allocation.height - border_width * 2); - *allocation_out = child_allocation; link = priv->popovers; @@ -8174,7 +8167,6 @@ gtk_window_get_preferred_width (GtkWidget *widget, GtkWindow *window; GtkWidget *child; GtkWindowPrivate *priv; - guint border_width; gint title_min = 0, title_nat = 0; gint child_min = 0, child_nat = 0; GtkBorder window_border = { 0 }; @@ -8185,8 +8177,6 @@ gtk_window_get_preferred_width (GtkWidget *widget, child = gtk_bin_get_child (GTK_BIN (window)); has_size_request = gtk_widget_has_size_request (widget); - border_width = gtk_container_get_border_width (GTK_CONTAINER (window)); - if (priv->decorated && !priv->fullscreen) { @@ -8208,10 +8198,8 @@ gtk_window_get_preferred_width (GtkWidget *widget, if (child_nat == 0 && !has_size_request) child_nat = NO_CONTENT_CHILD_NAT; - child_min += border_width * 2 + - window_border.left + window_border.right; - child_nat += border_width * 2 + - window_border.left + window_border.right; + child_min += window_border.left + window_border.right; + child_nat += window_border.left + window_border.right; } else if (!has_size_request) { @@ -8232,7 +8220,6 @@ gtk_window_get_preferred_width_for_height (GtkWidget *widget, GtkWindow *window; GtkWidget *child; GtkWindowPrivate *priv; - guint border_width; gint title_min = 0, title_nat = 0; gint child_min = 0, child_nat = 0; gint title_height = 0; @@ -8244,10 +8231,6 @@ gtk_window_get_preferred_width_for_height (GtkWidget *widget, child = gtk_bin_get_child (GTK_BIN (window)); has_size_request = gtk_widget_has_size_request (widget); - border_width = gtk_container_get_border_width (GTK_CONTAINER (window)); - - height -= 2 * border_width; - if (priv->decorated && !priv->fullscreen) { @@ -8279,10 +8262,8 @@ gtk_window_get_preferred_width_for_height (GtkWidget *widget, if (child_nat == 0 && height == 0 && !has_size_request) child_nat = NO_CONTENT_CHILD_NAT; - child_min += border_width * 2 + - window_border.left + window_border.right; - child_nat += border_width * 2 + - window_border.left + window_border.right; + child_min += window_border.left + window_border.right; + child_nat += window_border.left + window_border.right; } else if (!has_size_request) { @@ -8301,7 +8282,6 @@ gtk_window_get_preferred_height (GtkWidget *widget, GtkWindow *window; GtkWindowPrivate *priv; GtkWidget *child; - guint border_width; int title_min = 0; int title_height = 0; GtkBorder window_border = { 0 }; @@ -8315,8 +8295,6 @@ gtk_window_get_preferred_height (GtkWidget *widget, *minimum_size = 0; *natural_size = 0; - border_width = gtk_container_get_border_width (GTK_CONTAINER (window)); - if (priv->decorated && !priv->fullscreen) { @@ -8343,8 +8321,8 @@ gtk_window_get_preferred_height (GtkWidget *widget, if (child_nat == 0 && !has_size_request) child_nat = NO_CONTENT_CHILD_NAT; - *minimum_size += child_min + 2 * border_width; - *natural_size += child_nat + 2 * border_width; + *minimum_size += child_min; + *natural_size += child_nat; } else if (!has_size_request) { @@ -8362,7 +8340,6 @@ gtk_window_get_preferred_height_for_width (GtkWidget *widget, GtkWindow *window; GtkWindowPrivate *priv; GtkWidget *child; - guint border_width; int title_min = 0; int title_height = 0; GtkBorder window_border = { 0 }; @@ -8376,10 +8353,6 @@ gtk_window_get_preferred_height_for_width (GtkWidget *widget, *minimum_size = 0; *natural_size = 0; - border_width = gtk_container_get_border_width (GTK_CONTAINER (window)); - - width -= 2 * border_width; - if (priv->decorated && !priv->fullscreen) { @@ -8410,8 +8383,8 @@ gtk_window_get_preferred_height_for_width (GtkWidget *widget, if (child_nat == 0 && width == 0 && !has_size_request) child_nat = NO_CONTENT_CHILD_NAT; - *minimum_size += child_min + 2 * border_width; - *natural_size += child_nat + 2 * border_width; + *minimum_size += child_min; + *natural_size += child_nat; } else if (!has_size_request) { diff --git a/gtk/ui/gtkaboutdialog.ui b/gtk/ui/gtkaboutdialog.ui index 9dca96d3c7..aaa9ac20f8 100644 --- a/gtk/ui/gtkaboutdialog.ui +++ b/gtk/ui/gtkaboutdialog.ui @@ -6,7 +6,6 @@ help-about