use gpui::Corners; use gpui::{ Anchor, App, Context, Edges, ElementId, InteractiveElement as _, IntoElement, ParentElement, RenderOnce, StyleRefinement, Styled, Window, div, prelude::FluentBuilder, }; use crate::{ Disableable, Selectable, Sizable, Size, StyledExt as _, menu::{DropdownMenu, PopupMenu}, }; use super::{Button, ButtonVariant, ButtonVariants}; /// Group name shared by both halves, so hovering one can style the other. const HALVES_GROUP: &str = "dropdown-button"; /// A split button: an action button with an attached menu trigger. /// /// The two halves stay visually joined. A `ghost` split is transparent at /// rest; hovering either half surfaces the whole control with the hovered half /// emphasized, and it stays surfaced while the menu is open, so the pair reads /// as one control rather than two buttons. /// #[derive(IntoElement)] pub struct DropdownButton { id: ElementId, style: StyleRefinement, button: Option