ToolSplitButton
One pill-shaped button with two compartments: an action and a menu caret, divided by a hairline separator.
| Inherits | QWidget |
Declared in src/libs/libwidgets/components/ToolSplitButton.hpp.
Detailed description
Replaces QToolButton::MenuButtonPopup, which draws two adjacent rectangles — a wide icon button and a narrow caret button — with their own borders and their own hover states. In a toolbar of single buttons that reads as two controls that happen to be touching, and the seam between them catches the eye far more than either half deserves.
Here the silhouette is a single pill. The BACKGROUND is drawn by the active style (PE_PanelButtonTool over the whole widget), so the control matches every other toolbar button in whatever theme is loaded rather than hard-coding a palette that drifts the moment the theme changes. Only the separator, the icon and the caret are painted here, and hover highlights the compartment under the pointer so the split is discovered by using it rather than by a permanent border.
Shape borrowed from paint's SpectralColorPill: one rounded silhouette, compartments divided by a 1 px rule, no per-compartment frames.