update
This commit is contained in:
@@ -6,6 +6,7 @@ publish.workspace = true
|
||||
|
||||
[dependencies]
|
||||
gpui.workspace = true
|
||||
gpui-component.workspace = true
|
||||
anyhow.workspace = true
|
||||
log.workspace = true
|
||||
rust-embed.workspace = true
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M10 18H14V16H10V18ZM3 6V8H21V6H3ZM6 13H18V11H6V13Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 155 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M22.0361 16.3789L19.9141 18.5L22.0361 20.6221L20.6221 22.0361L18.5 19.9141L16.3789 22.0361L14.9648 20.6221L17.0859 18.5L14.9648 16.3789L16.3789 14.9648L18.5 17.0859L20.6221 14.9648L22.0361 16.3789ZM12.4785 2.01172C17.7796 2.26189 22 6.63756 22 12V13H10.0332C10.1896 15.5386 10.9356 17.9153 12.1387 19.9961C12.2207 19.9947 12.3024 19.995 12.3838 19.9912C12.5538 19.9832 12.7227 19.9696 12.8896 19.9512L13.1104 21.9395C12.9017 21.9625 12.6907 21.9783 12.4785 21.9883C12.3199 21.9958 12.1603 22 12 22C11.8397 22 11.6801 21.9958 11.5215 21.9883C6.22043 21.7381 2 17.3624 2 12C2 6.63756 6.22043 2.26189 11.5215 2.01172C11.6801 2.00424 11.8397 2 12 2C12.1603 2 12.3199 2.00424 12.4785 2.01172ZM4.06445 13C4.46083 16.1773 6.71821 18.7761 9.71289 19.668C8.74978 17.6256 8.16038 15.3738 8.03027 13H4.06445ZM9.71289 4.33105C6.71807 5.22285 4.46084 7.82258 4.06445 11H8.03027C8.1604 8.62585 8.74956 6.3736 9.71289 4.33105ZM12 4.25195C10.8789 6.27297 10.1835 8.56136 10.0332 11H13.9668C13.8165 8.56136 13.1211 6.27297 12 4.25195ZM14.2861 4.33105C15.2496 6.3737 15.8396 8.6257 15.9697 11H19.9355C19.5391 7.82226 17.2814 5.2226 14.2861 4.33105Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM9.71002 19.6674C8.74743 17.6259 8.15732 15.3742 8.02731 13H4.06189C4.458 16.1765 6.71639 18.7747 9.71002 19.6674ZM10.0307 13C10.1811 15.4388 10.8778 17.7297 12 19.752C13.1222 17.7297 13.8189 15.4388 13.9693 13H10.0307ZM19.9381 13H15.9727C15.8427 15.3742 15.2526 17.6259 14.29 19.6674C17.2836 18.7747 19.542 16.1765 19.9381 13ZM4.06189 11H8.02731C8.15732 8.62577 8.74743 6.37407 9.71002 4.33256C6.71639 5.22533 4.458 7.8235 4.06189 11ZM10.0307 11H13.9693C13.8189 8.56122 13.1222 6.27025 12 4.24799C10.8778 6.27025 10.1811 8.56122 10.0307 11ZM14.29 4.33256C15.2526 6.37407 15.8427 8.62577 15.9727 11H19.9381C19.542 7.8235 17.2836 5.22533 14.29 4.33256Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 869 B |
@@ -1,5 +1,6 @@
|
||||
use anyhow::Context;
|
||||
use gpui::{App, AssetSource, Result, SharedString};
|
||||
use gpui_component::IconNamed;
|
||||
use rust_embed::RustEmbed;
|
||||
|
||||
#[derive(RustEmbed)]
|
||||
@@ -45,3 +46,20 @@ impl Assets {
|
||||
cx.text_system().add_fonts(embedded_fonts)
|
||||
}
|
||||
}
|
||||
|
||||
pub enum CustomIconName {
|
||||
Filter,
|
||||
GlobalOn,
|
||||
GlobalOff,
|
||||
}
|
||||
|
||||
impl IconNamed for CustomIconName {
|
||||
fn path(self) -> gpui::SharedString {
|
||||
match self {
|
||||
CustomIconName::Filter => "icons/filter.svg",
|
||||
CustomIconName::GlobalOn => "icons/global-on.svg",
|
||||
CustomIconName::GlobalOff => "icons/global-off.svg",
|
||||
}
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ edition.workspace = true
|
||||
publish.workspace = true
|
||||
|
||||
[dependencies]
|
||||
assets = { path = "../assets" }
|
||||
signed_core = { path = "../signed_core" }
|
||||
signed_state = { path = "../signed_state" }
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::*;
|
||||
use gpui::{
|
||||
App, ClickEvent, Context, ElementId, EventEmitter, FocusHandle, Focusable, Render,
|
||||
@@ -221,7 +222,7 @@ impl Render for SidebarPanel {
|
||||
.px_2()
|
||||
.gap_2()
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
.child(Icon::new(IconName::Folder).small())
|
||||
.child(Icon::new(CustomIconName::Filter).small())
|
||||
.child(
|
||||
div()
|
||||
.text_xs()
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use assets::CustomIconName;
|
||||
use gpui::prelude::*;
|
||||
use gpui::{Context, Entity, Render, SharedString, Subscription, Window, div, px};
|
||||
use gpui_component::button::{Button, ButtonVariants};
|
||||
use gpui_component::dock::{DockArea, DockItem};
|
||||
use gpui_component::{ActiveTheme, Root, StyledExt, TitleBar, h_flex, v_flex};
|
||||
use gpui_component::{ActiveTheme, Root, Sizable, StyledExt, TitleBar, h_flex, v_flex};
|
||||
use signed_state::{Backend, BackendEvent};
|
||||
|
||||
use crate::views::SidebarPanel;
|
||||
@@ -50,11 +52,11 @@ impl Workspace {
|
||||
|
||||
let subscription = cx.subscribe(&backend, |this, _backend, event, cx| {
|
||||
match event {
|
||||
BackendEvent::Connected => this.status = "Connected".into(),
|
||||
BackendEvent::SyncProgress { total, current } => {
|
||||
this.status = format!("Syncing repositories... {current}/{total}").into()
|
||||
}
|
||||
BackendEvent::Synced => this.status = "Connected".into(),
|
||||
BackendEvent::Connected => this.status = "Connected".into(),
|
||||
BackendEvent::Error(error) => this.status = error.clone().into(),
|
||||
_ => return,
|
||||
}
|
||||
@@ -105,14 +107,23 @@ impl Render for Workspace {
|
||||
// Left
|
||||
.child(div())
|
||||
// Right
|
||||
.child(
|
||||
h_flex().px_2().child(
|
||||
div()
|
||||
.text_xs()
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
.child(self.status.clone()),
|
||||
),
|
||||
),
|
||||
.child(h_flex().px_2().map(|this| {
|
||||
if self.status == "Connected" {
|
||||
this.child(
|
||||
Button::new("relay")
|
||||
.icon(CustomIconName::GlobalOn)
|
||||
.small()
|
||||
.ghost(),
|
||||
)
|
||||
} else {
|
||||
this.child(
|
||||
div()
|
||||
.text_xs()
|
||||
.text_color(cx.theme().muted_foreground)
|
||||
.child(self.status.clone()),
|
||||
)
|
||||
}
|
||||
})),
|
||||
)
|
||||
// Dock Area
|
||||
.child(self.dock.clone()),
|
||||
|
||||
Reference in New Issue
Block a user