--- a/ui/winui/window.cpp Tue Oct 10 10:58:14 2023 +0200 +++ b/ui/winui/window.cpp Wed Oct 11 10:54:24 2023 +0200 @@ -93,10 +93,16 @@ } if (uic_toolbar_isenabled()) { - // create/add toolbar - CommandBar toolbar = ui_create_toolbar(); - toolbar.VerticalAlignment(VerticalAlignment::Top); - obj->container->Add(toolbar, false); + // create commandbar + CommandBar toolbar = ui_create_toolbar(obj); + // wrap the commandbar in a stackpanel, because we + // don't want to fill the horizontal space + StackPanel toolbar_panel = StackPanel(); + toolbar_panel.Orientation(Orientation::Horizontal); + toolbar_panel.Children().Append(toolbar); + + toolbar_panel.VerticalAlignment(VerticalAlignment::Top); + obj->container->Add(toolbar_panel, false); } obj->window = window_data;