add per-tab sidebar toggle buttons to dock
Rust / build (macos-latest, stable) (pull_request) Canceled after 0s
Rust / build (ubuntu-latest, stable) (pull_request) Canceled after 0s
Rust / build (windows-latest, stable) (pull_request) Canceled after 0s
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s
Rust / build (macos-latest, stable) (pull_request) Canceled after 0s
Rust / build (ubuntu-latest, stable) (pull_request) Canceled after 0s
Rust / build (windows-latest, stable) (pull_request) Canceled after 0s
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s
This commit is contained in:
Generated
+14
-14
@@ -1579,7 +1579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3059,7 +3059,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-core"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"cpal",
|
||||
"flume 0.12.0",
|
||||
@@ -3075,7 +3075,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-data"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"gpui",
|
||||
"gpui-native-core",
|
||||
@@ -3087,7 +3087,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-editor"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"gpui",
|
||||
"gpui-native-core",
|
||||
@@ -3106,7 +3106,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-icons"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"gpui",
|
||||
@@ -3115,7 +3115,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-kit"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"gpui",
|
||||
"gpui-native-core",
|
||||
@@ -3129,7 +3129,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-layout"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"gpui",
|
||||
"gpui-native-core",
|
||||
@@ -3142,7 +3142,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-theme"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-channel",
|
||||
@@ -3163,7 +3163,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gpui-native-utils"
|
||||
version = "0.1.0"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=bf8a92a133ac2066eb7b6fda7958d19233599923#bf8a92a133ac2066eb7b6fda7958d19233599923"
|
||||
source = "git+https://git.reya.info/reya/gpui-native-kit?rev=33f8856bc2332c426e90f5392b3f0e50d711ea05#33f8856bc2332c426e90f5392b3f0e50d711ea05"
|
||||
dependencies = [
|
||||
"gpui",
|
||||
"gpui-native-theme",
|
||||
@@ -5940,7 +5940,7 @@ dependencies = [
|
||||
"once_cell",
|
||||
"socket2",
|
||||
"tracing",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6438,7 +6438,7 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"linux-raw-sys",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6506,7 +6506,7 @@ dependencies = [
|
||||
"security-framework",
|
||||
"security-framework-sys",
|
||||
"webpki-root-certs",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -7382,7 +7382,7 @@ dependencies = [
|
||||
"getrandom 0.4.3",
|
||||
"once_cell",
|
||||
"rustix",
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -8575,7 +8575,7 @@ version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
|
||||
dependencies = [
|
||||
"windows-sys 0.52.0",
|
||||
"windows-sys 0.61.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ gpui = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503de
|
||||
gpui_platform = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503def9479138894f3139f5400cc", features = ["font-kit"] }
|
||||
reqwest_client = { git = "https://github.com/zed-industries/zed", rev = "f8cfc7ed9e57503def9479138894f3139f5400cc" }
|
||||
|
||||
gpui-native-kit = { git = "https://git.reya.info/reya/gpui-native-kit", rev = "bf8a92a133ac2066eb7b6fda7958d19233599923", features = ["layout", "editor"] }
|
||||
gpui-native-kit = { git = "https://git.reya.info/reya/gpui-native-kit", rev = "33f8856bc2332c426e90f5392b3f0e50d711ea05", features = ["layout", "editor"] }
|
||||
|
||||
settings = { path = "crates/settings" }
|
||||
signed_app = { path = "crates/signed_app" }
|
||||
|
||||
@@ -6,10 +6,11 @@ use gpui::{
|
||||
AppContext as _, Context, Entity, InteractiveElement as _, IntoElement, ParentElement as _,
|
||||
Render, Styled as _, Subscription, Window, div,
|
||||
};
|
||||
use gpui_native_kit::common::h_flex;
|
||||
use gpui_native_kit::button::{Button, ButtonVariant};
|
||||
use gpui_native_kit::common::{Sizable as _, h_flex};
|
||||
use gpui_native_kit::icons::IconRole;
|
||||
use gpui_native_kit::layout::dock::{Dock, DockSidebar, DockState};
|
||||
use gpui_native_kit::layout::shell::{LayoutState, Shell, SidebarToggles};
|
||||
use gpui_native_kit::layout::shell::{LayoutState, Shell};
|
||||
use gpui_native_kit::layout::window_controls::{TRAFFIC_LIGHT_PAD, titlebar_strip};
|
||||
use gpui_native_kit::theme::ActiveTheme as _;
|
||||
use gpui_native_kit::toast::Toast;
|
||||
@@ -35,10 +36,6 @@ impl AppRoot {
|
||||
let dock = DockState::new(cx);
|
||||
let layout = LayoutState::new(cx);
|
||||
|
||||
layout.update(cx, |layout, cx| {
|
||||
layout.set_sidebar_toggles(SidebarToggles::Tabbar, cx);
|
||||
});
|
||||
|
||||
dock.update(cx, |dock, cx| {
|
||||
dock.register_panel("welcome", |_, cx| {
|
||||
cx.new(|_| PlaceholderView::new("Welcome"))
|
||||
@@ -114,6 +111,11 @@ impl Render for AppRoot {
|
||||
let left_visible = layout.is_left_sidebar_visible();
|
||||
let sidebar_width = layout.left_sidebar_width();
|
||||
|
||||
let repo_active =
|
||||
self.dock.read(cx).active_panel().is_some_and(|panel| {
|
||||
panel.starts_with("repo:") || panel.starts_with("repo-local:")
|
||||
});
|
||||
|
||||
let titlebar = if left_visible {
|
||||
self.sidebar.read(cx).render_titlebar(cx)
|
||||
} else {
|
||||
@@ -142,13 +144,48 @@ impl Render for AppRoot {
|
||||
.text_color(theme.colors.foreground)
|
||||
.child(
|
||||
Shell::new("signed-shell", self.layout.clone())
|
||||
.toggle_button(false)
|
||||
.left_sidebar(self.sidebar.read(cx).build(cx))
|
||||
.right_sidebar(DockSidebar::new("signed-dock-sidebar", self.dock.clone()))
|
||||
.center(
|
||||
Dock::new("signed-dock", self.dock.clone())
|
||||
.window_controls(true)
|
||||
.traffic_light_pad(!left_visible)
|
||||
.sidebar_toggles(self.layout.clone()),
|
||||
.tab_prefix({
|
||||
let layout = self.layout.clone();
|
||||
move || {
|
||||
let layout = layout.clone();
|
||||
Button::new("toggle-left-sidebar")
|
||||
.icon(IconRole::PanelLeft)
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.small()
|
||||
.on_click(move |_, _, cx| {
|
||||
layout.update(cx, |layout, cx| {
|
||||
layout.toggle_left_sidebar(cx)
|
||||
});
|
||||
})
|
||||
.into_any_element()
|
||||
}
|
||||
})
|
||||
.tab_suffix({
|
||||
let layout = self.layout.clone();
|
||||
move || {
|
||||
if !repo_active {
|
||||
return div().into_any_element();
|
||||
}
|
||||
let layout = layout.clone();
|
||||
Button::new("toggle-right-sidebar")
|
||||
.icon(IconRole::PanelRight)
|
||||
.variant(ButtonVariant::Ghost)
|
||||
.small()
|
||||
.on_click(move |_, _, cx| {
|
||||
layout.update(cx, |layout, cx| {
|
||||
layout.toggle_right_sidebar(cx)
|
||||
});
|
||||
})
|
||||
.into_any_element()
|
||||
}
|
||||
}),
|
||||
),
|
||||
)
|
||||
.when_some(titlebar, |root, titlebar| {
|
||||
|
||||
Reference in New Issue
Block a user