Merge remote-tracking branch 'origin/main' into cache
# Conflicts: # crates/copilot/src/sign_in.rs # crates/gpui/src/window.rs # crates/workspace/src/pane_group.rs
This commit is contained in:
@@ -424,7 +424,6 @@ impl TerminalElement {
|
||||
let line_height = font_pixels * line_height.to_pixels(rem_size);
|
||||
let font_id = cx.text_system().resolve_font(&text_style.font());
|
||||
|
||||
// todo!(do we need to keep this unwrap?)
|
||||
let cell_width = text_system
|
||||
.advance(font_id, font_pixels, 'm')
|
||||
.unwrap()
|
||||
@@ -451,6 +450,18 @@ impl TerminalElement {
|
||||
}
|
||||
});
|
||||
|
||||
let interactive_text_bounds = InteractiveBounds {
|
||||
bounds,
|
||||
stacking_order: cx.stacking_order().clone(),
|
||||
};
|
||||
if interactive_text_bounds.visibly_contains(&cx.mouse_position(), cx) {
|
||||
if self.can_navigate_to_selected_word && last_hovered_word.is_some() {
|
||||
cx.set_cursor_style(gpui::CursorStyle::PointingHand)
|
||||
} else {
|
||||
cx.set_cursor_style(gpui::CursorStyle::IBeam)
|
||||
}
|
||||
}
|
||||
|
||||
let hyperlink_tooltip = last_hovered_word.clone().map(|hovered_word| {
|
||||
div()
|
||||
.size_full()
|
||||
@@ -512,7 +523,6 @@ impl TerminalElement {
|
||||
underline: Default::default(),
|
||||
}],
|
||||
)
|
||||
//todo!(do we need to keep this unwrap?)
|
||||
.unwrap()
|
||||
};
|
||||
|
||||
@@ -652,21 +662,6 @@ impl TerminalElement {
|
||||
},
|
||||
),
|
||||
);
|
||||
self.interactivity.on_click({
|
||||
let terminal = terminal.clone();
|
||||
move |e, cx| {
|
||||
if e.down.button == MouseButton::Right {
|
||||
let mouse_mode = terminal.update(cx, |terminal, _cx| {
|
||||
terminal.mouse_mode(e.down.modifiers.shift)
|
||||
});
|
||||
|
||||
if !mouse_mode {
|
||||
//todo!(context menu)
|
||||
// view.deploy_context_menu(e.position, cx);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
self.interactivity.on_scroll_wheel({
|
||||
let terminal = terminal.clone();
|
||||
move |e, cx| {
|
||||
|
||||
@@ -19,7 +19,7 @@ use workspace::{
|
||||
dock::{DockPosition, Panel, PanelEvent},
|
||||
item::Item,
|
||||
pane,
|
||||
ui::Icon,
|
||||
ui::IconName,
|
||||
DraggedTab, Pane, Workspace,
|
||||
};
|
||||
|
||||
@@ -71,7 +71,7 @@ impl TerminalPanel {
|
||||
h_stack()
|
||||
.gap_2()
|
||||
.child(
|
||||
IconButton::new("plus", Icon::Plus)
|
||||
IconButton::new("plus", IconName::Plus)
|
||||
.icon_size(IconSize::Small)
|
||||
.on_click(move |_, cx| {
|
||||
terminal_panel
|
||||
@@ -82,10 +82,10 @@ impl TerminalPanel {
|
||||
)
|
||||
.child({
|
||||
let zoomed = pane.is_zoomed();
|
||||
IconButton::new("toggle_zoom", Icon::Maximize)
|
||||
IconButton::new("toggle_zoom", IconName::Maximize)
|
||||
.icon_size(IconSize::Small)
|
||||
.selected(zoomed)
|
||||
.selected_icon(Icon::Minimize)
|
||||
.selected_icon(IconName::Minimize)
|
||||
.on_click(cx.listener(|pane, _, cx| {
|
||||
pane.toggle_zoom(&workspace::ToggleZoom, cx);
|
||||
}))
|
||||
@@ -477,8 +477,8 @@ impl Panel for TerminalPanel {
|
||||
"TerminalPanel"
|
||||
}
|
||||
|
||||
fn icon(&self, _cx: &WindowContext) -> Option<Icon> {
|
||||
Some(Icon::Terminal)
|
||||
fn icon(&self, _cx: &WindowContext) -> Option<IconName> {
|
||||
Some(IconName::Terminal)
|
||||
}
|
||||
|
||||
fn icon_tooltip(&self, _cx: &WindowContext) -> Option<&'static str> {
|
||||
|
||||
@@ -2,8 +2,6 @@ mod persistence;
|
||||
pub mod terminal_element;
|
||||
pub mod terminal_panel;
|
||||
|
||||
// todo!()
|
||||
// use crate::terminal_element::TerminalElement;
|
||||
use editor::{scroll::autoscroll::Autoscroll, Editor};
|
||||
use gpui::{
|
||||
div, impl_actions, overlay, AnyElement, AppContext, DismissEvent, EventEmitter, FocusHandle,
|
||||
@@ -22,7 +20,7 @@ use terminal::{
|
||||
Clear, Copy, Event, MaybeNavigationTarget, Paste, ShowCharacterPalette, Terminal,
|
||||
};
|
||||
use terminal_element::TerminalElement;
|
||||
use ui::{h_stack, prelude::*, ContextMenu, Icon, IconElement, Label};
|
||||
use ui::{h_stack, prelude::*, ContextMenu, Icon, IconName, Label};
|
||||
use util::{paths::PathLikeWithPosition, ResultExt};
|
||||
use workspace::{
|
||||
item::{BreadcrumbText, Item, ItemEvent},
|
||||
@@ -653,8 +651,10 @@ impl Render for TerminalView {
|
||||
.on_mouse_down(
|
||||
MouseButton::Right,
|
||||
cx.listener(|this, event: &MouseDownEvent, cx| {
|
||||
this.deploy_context_menu(event.position, cx);
|
||||
cx.notify();
|
||||
if !this.terminal.read(cx).mouse_mode(event.modifiers.shift) {
|
||||
this.deploy_context_menu(event.position, cx);
|
||||
cx.notify();
|
||||
}
|
||||
}),
|
||||
)
|
||||
.child(
|
||||
@@ -692,7 +692,7 @@ impl Item for TerminalView {
|
||||
let title = self.terminal().read(cx).title(true);
|
||||
h_stack()
|
||||
.gap_2()
|
||||
.child(IconElement::new(Icon::Terminal))
|
||||
.child(Icon::new(IconName::Terminal))
|
||||
.child(Label::new(title).color(if selected {
|
||||
Color::Default
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user