Rounded corners on inline-toolbar when it is not the last child
A GtkToolbar with the .inline-toolbar
style class has rounded corners on the bottom, which look jarring when it is not the last-child of its container.
This issue occurs only with GTK 3 (.inline-toolbar
does not exist in GTK 4).
Steps to reproduce
Code to illustrate the issue:
#include <gtk/gtk.h>
int main(int argc, char** argv) {
gtk_init(&argc, &argv);
GtkWidget *tool = gtk_toolbar_new();
GtkStyleContext *style = gtk_widget_get_style_context(tool);
gtk_style_context_add_class(style, GTK_STYLE_CLASS_INLINE_TOOLBAR);
gtk_toolbar_insert(GTK_TOOLBAR(tool), gtk_tool_button_new(NULL, "The toolbar"), 0);
GtkWidget *box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
gtk_container_add(GTK_CONTAINER(box), gtk_label_new("The top label"));
gtk_container_add(GTK_CONTAINER(box), tool);
gtk_container_add(GTK_CONTAINER(box), gtk_label_new("The bottom label"));
GtkWidget *win = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add(GTK_CONTAINER(win), box);
gtk_widget_show_all(win);
g_signal_connect(win, "destroy", gtk_main_quit, NULL);
gtk_main();
return 0;
}
Current behavior
Here's a screenshot showing the rounded corners on the bottom of the toolbar:
Expected outcome
When the toolbar is not the last child of its container, I'd expect it to look more like this:
Version information
- GTK 3.24.31
- Fedora Linux 35.20220113.0 (Silverblue)
Additional information
If a merge request for this would be welcome, I'd be happy to do it myself. I think I know how to fix it.