clean up
This commit is contained in:
@@ -84,11 +84,7 @@ impl RenderOnce for Nav {
|
|||||||
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
|
fn render(self, _window: &mut Window, cx: &mut App) -> impl IntoElement {
|
||||||
let clickable = self.on_click.is_some();
|
let clickable = self.on_click.is_some();
|
||||||
|
|
||||||
v_flex()
|
v_flex().w_full().h_10().child(
|
||||||
.id(format!("nav-{}", self.id))
|
|
||||||
.w_full()
|
|
||||||
.h_10()
|
|
||||||
.child(
|
|
||||||
h_flex()
|
h_flex()
|
||||||
.id(self.id)
|
.id(self.id)
|
||||||
.h_9()
|
.h_9()
|
||||||
|
|||||||
@@ -345,7 +345,7 @@ impl NewChat {
|
|||||||
let profile = persons.read(cx).get(public_key, cx);
|
let profile = persons.read(cx).get(public_key, cx);
|
||||||
let public_key = *public_key;
|
let public_key = *public_key;
|
||||||
|
|
||||||
Nav::new(SharedString::from(format!("contact-{}", start + offset)))
|
Nav::new(start + offset)
|
||||||
.label(profile.name())
|
.label(profile.name())
|
||||||
.text_sm()
|
.text_sm()
|
||||||
.when(!AppSettings::get_hide_avatar(cx), |this| {
|
.when(!AppSettings::get_hide_avatar(cx), |this| {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ use chat::{ChatRegistry, Room, RoomKind};
|
|||||||
use common::DebouncedDelay;
|
use common::DebouncedDelay;
|
||||||
use gpui::prelude::FluentBuilder;
|
use gpui::prelude::FluentBuilder;
|
||||||
use gpui::{
|
use gpui::{
|
||||||
AnyElement, App, AppContext, Context, ElementId, Entity, EventEmitter, FocusHandle, Focusable,
|
AnyElement, App, AppContext, Context, Entity, EventEmitter, FocusHandle, Focusable,
|
||||||
IntoElement, ParentElement, Render, SharedString, Styled, Subscription, Task, WeakEntity,
|
IntoElement, ParentElement, Render, SharedString, Styled, Subscription, Task, WeakEntity,
|
||||||
Window, div, uniform_list,
|
Window, div, uniform_list,
|
||||||
};
|
};
|
||||||
@@ -359,10 +359,7 @@ impl SearchPanel {
|
|||||||
this.select(&pkey_clone, cx);
|
this.select(&pkey_clone, cx);
|
||||||
});
|
});
|
||||||
|
|
||||||
Nav::new(ElementId::NamedInteger(
|
Nav::new(range.start + ix)
|
||||||
"search-result".into(),
|
|
||||||
(range.start + ix) as u64,
|
|
||||||
))
|
|
||||||
.label(profile.name())
|
.label(profile.name())
|
||||||
.text_sm()
|
.text_sm()
|
||||||
.font_medium()
|
.font_medium()
|
||||||
@@ -409,10 +406,7 @@ impl SearchPanel {
|
|||||||
this.select(&pkey_clone, cx);
|
this.select(&pkey_clone, cx);
|
||||||
});
|
});
|
||||||
|
|
||||||
Nav::new(ElementId::NamedInteger(
|
Nav::new(range.start + ix)
|
||||||
"contact".into(),
|
|
||||||
(range.start + ix) as u64,
|
|
||||||
))
|
|
||||||
.label(profile.name().trim())
|
.label(profile.name().trim())
|
||||||
.text_sm()
|
.text_sm()
|
||||||
.font_medium()
|
.font_medium()
|
||||||
|
|||||||
@@ -853,7 +853,7 @@ impl Sidebar {
|
|||||||
let dock = self.dock.clone();
|
let dock = self.dock.clone();
|
||||||
let room = room.clone();
|
let room = room.clone();
|
||||||
|
|
||||||
Nav::new(SharedString::from(format!("room-{index}")))
|
Nav::new(index)
|
||||||
.label(name)
|
.label(name)
|
||||||
.text_sm()
|
.text_sm()
|
||||||
.font_medium()
|
.font_medium()
|
||||||
@@ -907,7 +907,7 @@ impl Sidebar {
|
|||||||
let sidebar = cx.entity().downgrade();
|
let sidebar = cx.entity().downgrade();
|
||||||
let public_key = public_key.to_owned();
|
let public_key = public_key.to_owned();
|
||||||
|
|
||||||
Nav::new(SharedString::from(format!("contact-{index}")))
|
Nav::new(index)
|
||||||
.label(person.name())
|
.label(person.name())
|
||||||
.text_sm()
|
.text_sm()
|
||||||
.font_medium()
|
.font_medium()
|
||||||
@@ -937,7 +937,7 @@ impl Sidebar {
|
|||||||
let sidebar = cx.entity().downgrade();
|
let sidebar = cx.entity().downgrade();
|
||||||
let community = community.clone();
|
let community = community.clone();
|
||||||
|
|
||||||
Nav::new(SharedString::from(format!("com-{index}")))
|
Nav::new(index)
|
||||||
.label(name)
|
.label(name)
|
||||||
.text_sm()
|
.text_sm()
|
||||||
.when(!hide_avatar, |this| {
|
.when(!hide_avatar, |this| {
|
||||||
|
|||||||
Reference in New Issue
Block a user