I’m developing an Adw application. As such, the buttons in my toolbar are flat following the Adw guidelines.
My toolbar contains a Dropdown widget and libadwaita doesn’t take care of automatically flattening it.I work around this by getting the first child of the dropdown (the togglebutton) and add the ‘flat’ CSS style.
Given there’s no ‘get_toggle_button’ method for the dropdown, is there a better way of doing this? It works, but it will break if the order of widgets under Gtk.Dropdown ever changes.
You can add css directly to the button. First you must add a “name” property to the dropdown and choose a name for it. This name will serve as a selector to css (for example: “my_dd”). So just add it to your general css using the background color of your toolbar as background (probably @headerbar_bg_color)