mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-25 01:34:02 +00:00
Render a tooltip on toggle screen sharing button
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
This commit is contained in:
parent
011085a93f
commit
8c2ff69515
1 changed files with 17 additions and 4 deletions
|
@ -259,11 +259,17 @@ impl CollabTitlebarItem {
|
|||
) -> Option<ElementBox> {
|
||||
let active_call = ActiveCall::global(cx);
|
||||
let room = active_call.read(cx).room().cloned()?;
|
||||
let icon = if room.read(cx).is_screen_sharing() {
|
||||
"icons/disable_screen_sharing_12.svg"
|
||||
let icon;
|
||||
let tooltip;
|
||||
|
||||
if room.read(cx).is_screen_sharing() {
|
||||
icon = "icons/disable_screen_sharing_12.svg";
|
||||
tooltip = "Stop Sharing Screen"
|
||||
} else {
|
||||
"icons/enable_screen_sharing_12.svg"
|
||||
};
|
||||
icon = "icons/enable_screen_sharing_12.svg";
|
||||
tooltip = "Share Screen";
|
||||
}
|
||||
|
||||
let titlebar = &theme.workspace.titlebar;
|
||||
Some(
|
||||
MouseEventHandler::<ToggleScreenSharing>::new(0, cx, |state, _| {
|
||||
|
@ -284,6 +290,13 @@ impl CollabTitlebarItem {
|
|||
.on_click(MouseButton::Left, move |_, cx| {
|
||||
cx.dispatch_action(ToggleScreenSharing);
|
||||
})
|
||||
.with_tooltip::<ToggleScreenSharing, _>(
|
||||
0,
|
||||
tooltip.into(),
|
||||
Some(Box::new(ToggleScreenSharing)),
|
||||
theme.tooltip.clone(),
|
||||
cx,
|
||||
)
|
||||
.aligned()
|
||||
.boxed(),
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue