Add new Button and IconButton components (#3448)

This PR adds new `Button` and `IconButton` components built on top of
our new button abstractions.

Both of these buttons are built from the common `ButtonLike` base, and
implement the `ButtonCommon` (name TBD) trait in order to provide a
common interface.

There are still some visual tweaks that we'll need to make to the new
buttons, but those should be straightforward to make after we land this.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-11-29 17:41:44 -05:00 committed by GitHub
parent df5de47a78
commit b357ae4dc3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 324 additions and 682 deletions

View file

@ -99,7 +99,8 @@ use text::{OffsetUtf16, Rope};
use theme::{
ActiveTheme, DiagnosticStyle, PlayerColor, SyntaxTheme, Theme, ThemeColors, ThemeSettings,
};
use ui::{h_stack, v_stack, HighlightedLabel, IconButton, Popover, StyledExt, Tooltip};
use ui::prelude::*;
use ui::{h_stack, v_stack, HighlightedLabel, IconButton, Popover, Tooltip};
use util::{post_inc, RangeExt, ResultExt, TryFutureExt};
use workspace::{
item::{ItemEvent, ItemHandle},
@ -4391,7 +4392,7 @@ impl Editor {
editor.fold_at(&FoldAt { buffer_row }, cx);
}
}))
.color(ui::Color::Muted)
.icon_color(ui::Color::Muted)
})
})
.flatten()

View file

@ -48,6 +48,7 @@ use std::{
};
use sum_tree::Bias;
use theme::{ActiveTheme, PlayerColor};
use ui::prelude::*;
use ui::{h_stack, IconButton, Tooltip};
use util::ResultExt;
use workspace::item::Item;