From d9e8223b038d5a865c7752cc162706f1cccac080 Mon Sep 17 00:00:00 2001 From: nana-4 Date: Fri, 7 Aug 2020 00:54:42 +0900 Subject: [PATCH 1/4] gtk-demo: Avoid double borders in the panes demo Using frames for the children of the panes looks bad. --- demos/gtk-demo/panes.c | 46 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/demos/gtk-demo/panes.c b/demos/gtk-demo/panes.c index 134d3bea97..e6312054f1 100644 --- a/demos/gtk-demo/panes.c +++ b/demos/gtk-demo/panes.c @@ -61,10 +61,6 @@ create_pane_options (GtkPaned *paned, child2 = gtk_paned_get_end_child (paned); frame = gtk_frame_new (frame_label); - gtk_widget_set_margin_start (frame, 4); - gtk_widget_set_margin_end (frame, 4); - gtk_widget_set_margin_top (frame, 4); - gtk_widget_set_margin_bottom (frame, 4); table = gtk_grid_new (); gtk_frame_set_child (GTK_FRAME (frame), table); @@ -110,6 +106,7 @@ do_panes (GtkWidget *do_widget) GtkWidget *vpaned; GtkWidget *button; GtkWidget *vbox; + GtkWidget *box; if (!window) { @@ -120,33 +117,42 @@ do_panes (GtkWidget *do_widget) gtk_window_set_title (GTK_WINDOW (window), "Paned Widgets"); - vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8); + gtk_widget_set_margin_start (vbox, 8); + gtk_widget_set_margin_end (vbox, 8); + gtk_widget_set_margin_top (vbox, 8); + gtk_widget_set_margin_bottom (vbox, 8); gtk_window_set_child (GTK_WINDOW (window), vbox); + frame = gtk_frame_new (NULL); + gtk_box_append (GTK_BOX (vbox), frame); + vpaned = gtk_paned_new (GTK_ORIENTATION_VERTICAL); - gtk_widget_set_margin_start (vpaned, 5); - gtk_widget_set_margin_end (vpaned, 5); - gtk_widget_set_margin_top (vpaned, 5); - gtk_widget_set_margin_bottom (vpaned, 5); - gtk_box_append (GTK_BOX (vbox), vpaned); + gtk_frame_set_child (GTK_FRAME (frame), vpaned); hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); gtk_paned_set_start_child (GTK_PANED (vpaned), hpaned); - frame = gtk_frame_new (NULL); - gtk_widget_set_size_request (frame, 60, 60); - gtk_paned_set_start_child (GTK_PANED (hpaned), frame); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_set_size_request (box, 60, 60); + gtk_paned_set_start_child (GTK_PANED (hpaned), box); button = gtk_button_new_with_mnemonic ("_Hi there"); - gtk_frame_set_child (GTK_FRAME (frame), button); + gtk_widget_set_margin_start (button, 4); + gtk_widget_set_margin_end (button, 4); + gtk_widget_set_margin_top (button, 4); + gtk_widget_set_margin_bottom (button, 4); + gtk_widget_set_hexpand (button, TRUE); + gtk_widget_set_vexpand (button, TRUE); + gtk_box_append (GTK_BOX (box), button); - frame = gtk_frame_new (NULL); - gtk_widget_set_size_request (frame, 80, 60); - gtk_paned_set_end_child (GTK_PANED (hpaned), frame); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_set_size_request (box, 80, 60); + gtk_paned_set_end_child (GTK_PANED (hpaned), box); - frame = gtk_frame_new (NULL); - gtk_widget_set_size_request (frame, 60, 80); - gtk_paned_set_end_child (GTK_PANED (vpaned), frame); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + gtk_widget_set_size_request (box, 60, 80); + gtk_paned_set_end_child (GTK_PANED (vpaned), box); /* Now create toggle buttons to control sizing */ From d906242c78fad0ba554ed68cb24d8bbcb924d06c Mon Sep 17 00:00:00 2001 From: nana-4 Date: Fri, 7 Aug 2020 00:54:41 +0900 Subject: [PATCH 2/4] gtk-demo: Avoid double borders in the dnd demo Replace the frame with a separator. --- demos/gtk-demo/dnd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demos/gtk-demo/dnd.c b/demos/gtk-demo/dnd.c index 1aff3b1bcd..83e6e92359 100644 --- a/demos/gtk-demo/dnd.c +++ b/demos/gtk-demo/dnd.c @@ -566,7 +566,6 @@ canvas_new (void) canvas = gtk_fixed_new (); gtk_widget_set_hexpand (canvas, TRUE); gtk_widget_set_vexpand (canvas, TRUE); - gtk_widget_add_css_class (canvas, "frame"); source = gtk_drag_source_new (); gtk_drag_source_set_actions (source, GDK_ACTION_MOVE); @@ -764,6 +763,8 @@ do_dnd (GtkWidget *do_widget) y += 100; } + gtk_box_append (GTK_BOX (box), gtk_separator_new (GTK_ORIENTATION_HORIZONTAL)); + sw = gtk_scrolled_window_new (); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, From bb7d5b2de6b130de82131987622445d5d6da9f98 Mon Sep 17 00:00:00 2001 From: nana-4 Date: Fri, 7 Aug 2020 00:54:44 +0900 Subject: [PATCH 3/4] gtk-demo: Avoid double borders in the fontrendering demo Replace the frame with a separator. --- demos/gtk-demo/fontrendering.ui | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/demos/gtk-demo/fontrendering.ui b/demos/gtk-demo/fontrendering.ui index e9fcea53d5..f2551e29a5 100644 --- a/demos/gtk-demo/fontrendering.ui +++ b/demos/gtk-demo/fontrendering.ui @@ -198,10 +198,12 @@ + + + 1 - 1 1 1 From 09fa3886ba07813b34fb66a16e76c82402a4d473 Mon Sep 17 00:00:00 2001 From: nana-4 Date: Fri, 7 Aug 2020 00:54:46 +0900 Subject: [PATCH 4/4] gtk-demo: Avoid double borders in the blendmodes demo --- demos/gtk-demo/blendmodes.ui | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/demos/gtk-demo/blendmodes.ui b/demos/gtk-demo/blendmodes.ui index e87a0a8970..5826f41d44 100644 --- a/demos/gtk-demo/blendmodes.ui +++ b/demos/gtk-demo/blendmodes.ui @@ -8,6 +8,10 @@ 300 + 12 + 12 + 12 + 12 12 12