summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2020-02-03 04:29:10 +0100
committerBenjamin Otte <otte@redhat.com>2020-02-07 14:08:08 +0100
commit8a60f5dc78b7aac9d3773a4229ca2565fe8214f8 (patch)
treee7e0aec79c6d29cdef072352fa50447e83994e99 /examples
parent3d9e622fda47087eb5a4236f6d85c79328c0a54b (diff)
downloadgtk+-8a60f5dc78b7aac9d3773a4229ca2565fe8214f8.tar.gz
bloatpad: Use a box, not a toolbar
Diffstat (limited to 'examples')
-rw-r--r--examples/bp/bloatpad.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c
index 0cac3c7111..fcbca05484 100644
--- a/examples/bp/bloatpad.c
+++ b/examples/bp/bloatpad.c
@@ -213,7 +213,7 @@ new_window (GApplication *app,
{
GtkWidget *window, *grid, *scrolled, *view;
GtkWidget *toolbar;
- GtkToolItem *button;
+ GtkWidget *button;
GtkWidget *sw, *box, *label;
window = gtk_application_window_new (GTK_APPLICATION (app));
@@ -224,37 +224,31 @@ new_window (GApplication *app,
grid = gtk_grid_new ();
gtk_container_add (GTK_CONTAINER (window), grid);
- toolbar = gtk_toolbar_new ();
- button = gtk_toggle_tool_button_new ();
- gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (button), "format-justify-left");
+ toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ button = gtk_toggle_button_new ();
+ gtk_button_set_icon_name (GTK_BUTTON (button), "format-justify-left");
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::left");
- gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
+ gtk_container_add (GTK_CONTAINER (toolbar), button);
- button = gtk_toggle_tool_button_new ();
- gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (button), "format-justify-center");
+ button = gtk_toggle_button_new ();
+ gtk_button_set_icon_name (GTK_BUTTON (button), "format-justify-center");
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::center");
- gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
+ gtk_container_add (GTK_CONTAINER (toolbar), button);
- button = gtk_toggle_tool_button_new ();
- gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (button), "format-justify-right");
+ button = gtk_toggle_button_new ();
+ gtk_button_set_icon_name (GTK_BUTTON (button), "format-justify-right");
gtk_actionable_set_detailed_action_name (GTK_ACTIONABLE (button), "win.justify::right");
- gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
+ gtk_container_add (GTK_CONTAINER (toolbar), button);
- button = gtk_separator_tool_item_new ();
- gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (button), FALSE);
- gtk_tool_item_set_expand (GTK_TOOL_ITEM (button), TRUE);
- gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
-
- button = gtk_tool_item_new ();
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- gtk_container_add (GTK_CONTAINER (button), box);
+ gtk_widget_set_halign (box, GTK_ALIGN_END);
label = gtk_label_new ("Fullscreen:");
gtk_container_add (GTK_CONTAINER (box), label);
sw = gtk_switch_new ();
gtk_widget_set_valign (sw, GTK_ALIGN_CENTER);
gtk_actionable_set_action_name (GTK_ACTIONABLE (sw), "win.fullscreen");
gtk_container_add (GTK_CONTAINER (box), sw);
- gtk_container_add (GTK_CONTAINER (toolbar), GTK_WIDGET (button));
+ gtk_container_add (GTK_CONTAINER (toolbar), box);
gtk_grid_attach (GTK_GRID (grid), toolbar, 0, 0, 1, 1);