add profile panel
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m50s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m49s
Some checks failed
Rust / build (ubuntu-latest, stable) (push) Failing after 1m50s
Rust / build (ubuntu-latest, stable) (pull_request) Failing after 1m49s
This commit is contained in:
@@ -5,9 +5,9 @@ use gpui::{
|
||||
div, px, rems, App, AppContext, Context, Corner, DefiniteLength, DismissEvent, DragMoveEvent,
|
||||
Empty, Entity, EventEmitter, FocusHandle, Focusable, InteractiveElement as _, IntoElement,
|
||||
MouseButton, ParentElement, Pixels, Render, ScrollHandle, SharedString,
|
||||
StatefulInteractiveElement, Styled, WeakEntity, Window, WindowControlArea,
|
||||
StatefulInteractiveElement, Styled, WeakEntity, Window,
|
||||
};
|
||||
use theme::{ActiveTheme, PlatformKind, CLIENT_SIDE_DECORATION_ROUNDING, TITLEBAR_HEIGHT};
|
||||
use theme::{ActiveTheme, CLIENT_SIDE_DECORATION_ROUNDING, TITLEBAR_HEIGHT};
|
||||
use ui::button::{Button, ButtonVariants as _};
|
||||
use ui::popup_menu::{PopupMenu, PopupMenuExt};
|
||||
use ui::{h_flex, v_flex, AxisExt, IconName, Placement, Selectable, Sizable, StyledExt};
|
||||
@@ -88,9 +88,6 @@ pub struct TabPanel {
|
||||
/// Whether the tab panel is collapsed
|
||||
collapsed: bool,
|
||||
|
||||
/// Whether window is moving
|
||||
window_move: bool,
|
||||
|
||||
/// When drag move, will get the placement of the panel to be split
|
||||
will_split_placement: Option<Placement>,
|
||||
}
|
||||
@@ -160,7 +157,6 @@ impl TabPanel {
|
||||
will_split_placement: None,
|
||||
zoomed: false,
|
||||
collapsed: false,
|
||||
window_move: false,
|
||||
closable: true,
|
||||
}
|
||||
}
|
||||
@@ -577,8 +573,6 @@ impl TabPanel {
|
||||
return div().into_any_element();
|
||||
};
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
let supported_controls = window.window_controls();
|
||||
let left_dock_button = self.render_dock_toggle_button(DockPlacement::Left, window, cx);
|
||||
let bottom_dock_button = self.render_dock_toggle_button(DockPlacement::Bottom, window, cx);
|
||||
let right_dock_button = self.render_dock_toggle_button(DockPlacement::Right, window, cx);
|
||||
@@ -737,40 +731,9 @@ impl TabPanel {
|
||||
// empty space to allow move to last tab right
|
||||
div()
|
||||
.id("tab-bar-empty-space")
|
||||
.window_control_area(WindowControlArea::Drag)
|
||||
.h_full()
|
||||
.flex_grow()
|
||||
.min_w_16()
|
||||
.when(!window.is_fullscreen(), |this| match cx.theme().platform {
|
||||
PlatformKind::Linux => this
|
||||
.when(supported_controls.window_menu, |this| {
|
||||
this.on_mouse_down(MouseButton::Right, move |ev, window, _| {
|
||||
window.show_window_menu(ev.position)
|
||||
})
|
||||
})
|
||||
.on_mouse_move(cx.listener(move |this, _ev, window, _| {
|
||||
if this.window_move {
|
||||
this.window_move = false;
|
||||
window.start_window_move();
|
||||
}
|
||||
}))
|
||||
.on_mouse_down_out(cx.listener(move |this, _ev, _window, _cx| {
|
||||
this.window_move = false;
|
||||
}))
|
||||
.on_mouse_up(
|
||||
MouseButton::Left,
|
||||
cx.listener(move |this, _ev, _window, _cx| {
|
||||
this.window_move = false;
|
||||
}),
|
||||
)
|
||||
.on_mouse_down(
|
||||
MouseButton::Left,
|
||||
cx.listener(move |this, _ev, _window, _cx| {
|
||||
this.window_move = true;
|
||||
}),
|
||||
),
|
||||
_ => this,
|
||||
})
|
||||
.when(state.droppable, |this| {
|
||||
let view = cx.entity();
|
||||
|
||||
@@ -804,7 +767,6 @@ impl TabPanel {
|
||||
.border_color(cx.theme().border)
|
||||
.border_l_1()
|
||||
.border_b_1()
|
||||
.when(!cx.theme().platform.is_mac(), |this| this.border_r_1())
|
||||
.child(self.render_toolbar(state, window, cx))
|
||||
.when_some(right_dock_button, |this, btn| this.child(btn)),
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user