Merge branch 'main' into rename
This commit is contained in:
commit
514d69e83d
15 changed files with 131 additions and 173 deletions
|
@ -466,7 +466,7 @@ impl Pane {
|
|||
let theme = &settings.theme;
|
||||
|
||||
enum Tabs {}
|
||||
let tabs = MouseEventHandler::new::<Tabs, _, _, _>(cx.view_id(), cx, |mouse_state, cx| {
|
||||
let tabs = MouseEventHandler::new::<Tabs, _, _>(0, cx, |mouse_state, cx| {
|
||||
let mut row = Flex::row();
|
||||
for (ix, (_, item_view)) in self.item_views.iter().enumerate() {
|
||||
let is_active = ix == self.active_item_index;
|
||||
|
@ -543,7 +543,7 @@ impl Pane {
|
|||
let item_id = item_view.id();
|
||||
enum TabCloseButton {}
|
||||
let icon = Svg::new("icons/x.svg");
|
||||
MouseEventHandler::new::<TabCloseButton, _, _, _>(
|
||||
MouseEventHandler::new::<TabCloseButton, _, _>(
|
||||
item_id,
|
||||
cx,
|
||||
|mouse_state, _| {
|
||||
|
|
|
@ -83,26 +83,22 @@ impl Sidebar {
|
|||
&theme.item
|
||||
};
|
||||
enum SidebarButton {}
|
||||
MouseEventHandler::new::<SidebarButton, _, _, _>(
|
||||
item.view.id(),
|
||||
cx,
|
||||
|_, _| {
|
||||
ConstrainedBox::new(
|
||||
Align::new(
|
||||
ConstrainedBox::new(
|
||||
Svg::new(item.icon_path)
|
||||
.with_color(theme.icon_color)
|
||||
.boxed(),
|
||||
)
|
||||
.with_height(theme.icon_size)
|
||||
.boxed(),
|
||||
MouseEventHandler::new::<SidebarButton, _, _>(item.view.id(), cx, |_, _| {
|
||||
ConstrainedBox::new(
|
||||
Align::new(
|
||||
ConstrainedBox::new(
|
||||
Svg::new(item.icon_path)
|
||||
.with_color(theme.icon_color)
|
||||
.boxed(),
|
||||
)
|
||||
.with_height(theme.icon_size)
|
||||
.boxed(),
|
||||
)
|
||||
.with_height(theme.height)
|
||||
.boxed()
|
||||
},
|
||||
)
|
||||
.boxed(),
|
||||
)
|
||||
.with_height(theme.height)
|
||||
.boxed()
|
||||
})
|
||||
.with_cursor_style(CursorStyle::PointingHand)
|
||||
.on_mouse_down(move |cx| {
|
||||
cx.dispatch_action(ToggleSidebarItem(SidebarItemId {
|
||||
|
@ -161,7 +157,7 @@ impl Sidebar {
|
|||
) -> ElementBox {
|
||||
let width = self.width.clone();
|
||||
let side = self.side;
|
||||
MouseEventHandler::new::<Self, _, _, _>((cx.view_id(), self.side.id()), cx, |_, _| {
|
||||
MouseEventHandler::new::<Self, _, _>(side as usize, cx, |_, _| {
|
||||
Container::new(Empty::new().boxed())
|
||||
.with_style(self.theme(settings).resize_handle)
|
||||
.boxed()
|
||||
|
@ -184,12 +180,3 @@ impl Sidebar {
|
|||
.boxed()
|
||||
}
|
||||
}
|
||||
|
||||
impl Side {
|
||||
fn id(self) -> usize {
|
||||
match self {
|
||||
Side::Left => 0,
|
||||
Side::Right => 1,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1191,7 +1191,7 @@ impl Workspace {
|
|||
if let Some(avatar) = user.and_then(|user| user.avatar.clone()) {
|
||||
self.render_avatar(avatar, replica_id, theme)
|
||||
} else {
|
||||
MouseEventHandler::new::<Authenticate, _, _, _>(cx.view_id(), cx, |state, _| {
|
||||
MouseEventHandler::new::<Authenticate, _, _>(0, cx, |state, _| {
|
||||
let style = if state.hovered {
|
||||
&theme.workspace.titlebar.hovered_sign_in_prompt
|
||||
} else {
|
||||
|
@ -1252,7 +1252,7 @@ impl Workspace {
|
|||
theme.workspace.titlebar.share_icon_color
|
||||
};
|
||||
Some(
|
||||
MouseEventHandler::new::<Share, _, _, _>(cx.view_id(), cx, |_, _| {
|
||||
MouseEventHandler::new::<Share, _, _>(0, cx, |_, _| {
|
||||
Align::new(
|
||||
ConstrainedBox::new(
|
||||
Svg::new("icons/broadcast-24.svg").with_color(color).boxed(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue