refactor: replace shell with root view wrapping app content
This commit is contained in:
@@ -10,13 +10,12 @@ use gpui::{
|
||||
use helpers::apply_appearance_mode;
|
||||
use settings::SettingsStore;
|
||||
use signed_state::{Backend, BackendEvent};
|
||||
use ui::common::h_flex;
|
||||
use ui::common::{h_flex, v_flex};
|
||||
use ui::icons::IconRole;
|
||||
use ui::layout::panel::PanelRow;
|
||||
use ui::layout::shell::Shell;
|
||||
use ui::layout::root::Root;
|
||||
use ui::layout::titlebar::Titlebar;
|
||||
use ui::theme::ActiveTheme as _;
|
||||
use ui::toast::{Toast, Toasts};
|
||||
use ui::toast::Toast;
|
||||
|
||||
use crate::app::placeholder::PlaceholderView;
|
||||
use crate::app::sign_in::SignedOutView;
|
||||
@@ -32,7 +31,6 @@ use crate::workspace::Workspace;
|
||||
pub struct AppRoot {
|
||||
workspace: Entity<Workspace>,
|
||||
titlebar: Entity<TitlebarView>,
|
||||
toasts: Entity<Toasts>,
|
||||
sign_in: Entity<SignedOutView>,
|
||||
explore: Entity<ExploreView>,
|
||||
empty: Entity<PlaceholderView>,
|
||||
@@ -47,7 +45,6 @@ impl AppRoot {
|
||||
let workspace = cx.new(|_| Workspace::new());
|
||||
let titlebar = cx.new(|cx| TitlebarView::new(workspace.downgrade(), window, cx));
|
||||
|
||||
let toasts = cx.new(|_| Toasts::default());
|
||||
let sign_in = cx.new(|_| SignedOutView::new());
|
||||
let explore = cx.new(|cx| ExploreView::new(workspace.downgrade(), cx));
|
||||
let empty = cx.new(|_| PlaceholderView::new("Select a repository"));
|
||||
@@ -64,9 +61,7 @@ impl AppRoot {
|
||||
this.open_passphrase(cx);
|
||||
}
|
||||
BackendEvent::Error(message) => {
|
||||
this.toasts.update(cx, |toasts, cx| {
|
||||
toasts.push(Toast::new(message.clone()).icon(IconRole::Warning), cx);
|
||||
});
|
||||
Root::push_toast(Toast::new(message.clone()).icon(IconRole::Warning), cx);
|
||||
}
|
||||
BackendEvent::SignerChanged => {
|
||||
this.workspace.update(cx, |workspace, cx| {
|
||||
@@ -95,7 +90,6 @@ impl AppRoot {
|
||||
Self {
|
||||
workspace,
|
||||
titlebar,
|
||||
toasts,
|
||||
sign_in,
|
||||
explore,
|
||||
empty,
|
||||
@@ -105,8 +99,12 @@ impl AppRoot {
|
||||
}
|
||||
|
||||
fn open_passphrase(&mut self, cx: &mut Context<Self>) {
|
||||
self.passphrase = Some(PassphraseDialog::new(cx));
|
||||
cx.notify();
|
||||
if self.passphrase.is_some() {
|
||||
return;
|
||||
}
|
||||
let dialog = PassphraseDialog::new(cx);
|
||||
self.passphrase = Some(dialog.clone());
|
||||
Root::open_dialog(dialog, cx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,8 +120,6 @@ impl Render for AppRoot {
|
||||
div()
|
||||
.relative()
|
||||
.size_full()
|
||||
.font_family(cx.theme().ui_font())
|
||||
.text_color(cx.theme().colors.foreground)
|
||||
.key_context(REPOSITORY_KEY_CONTEXT)
|
||||
.on_action(cx.listener(|this, action: &SwitchRepository, window, cx| {
|
||||
this.titlebar.update(cx, |titlebar, cx| {
|
||||
@@ -136,8 +132,10 @@ impl Render for AppRoot {
|
||||
});
|
||||
}))
|
||||
.child(
|
||||
Shell::new("signed-shell")
|
||||
.titlebar(
|
||||
v_flex()
|
||||
.size_full()
|
||||
.overflow_hidden()
|
||||
.child(
|
||||
Titlebar::new("signed-titlebar")
|
||||
.prefix(
|
||||
h_flex()
|
||||
@@ -154,7 +152,7 @@ impl Render for AppRoot {
|
||||
titlebar.suffix(menu)
|
||||
}),
|
||||
)
|
||||
.panel(
|
||||
.child(
|
||||
PanelRow::new("signed-panel")
|
||||
.when_some(main.as_ref(), |row, main| {
|
||||
row.main(main.clone()).when(workspace.has_details(), |row| {
|
||||
@@ -168,11 +166,7 @@ impl Render for AppRoot {
|
||||
row.main(self.sign_in.clone())
|
||||
.split_at(self.explore.clone(), px(300.))
|
||||
}),
|
||||
)
|
||||
.toasts(self.toasts.clone()),
|
||||
),
|
||||
)
|
||||
.child(titlebar_view.palette())
|
||||
.children(titlebar_view.dialogs())
|
||||
.when_some(self.passphrase.clone(), |el, view| el.child(view))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,9 @@ use ui::field::Field;
|
||||
use ui::icons::IconRole;
|
||||
use ui::input::{Input, InputState, InputStateEvent};
|
||||
|
||||
use crate::shared::progress::{DialogProgress, dialog_submit_button, error_row, push_steps_row, run_dialog_task};
|
||||
use crate::shared::progress::{
|
||||
DialogProgress, dialog_submit_button, error_row, push_steps_row, run_dialog_task,
|
||||
};
|
||||
|
||||
pub struct PassphraseDialog {
|
||||
handle: DialogHandle,
|
||||
|
||||
@@ -14,7 +14,12 @@ mod workspace;
|
||||
pub use app::AppRoot;
|
||||
pub use app::helpers::apply_appearance_mode;
|
||||
use gpui::{App, AppContext as _, Entity, Window};
|
||||
use ui::layout::root::Root;
|
||||
|
||||
pub fn root(window: &mut Window, cx: &mut App) -> Entity<AppRoot> {
|
||||
cx.new(|cx| AppRoot::new(window, cx))
|
||||
pub fn root(window: &mut Window, cx: &mut App) -> Entity<Root> {
|
||||
let root = cx.new(|cx| Root::new(window, cx));
|
||||
let content: Entity<AppRoot> = cx.new(|cx| AppRoot::new(window, cx));
|
||||
|
||||
root.update(cx, |root, cx| root.set_content(content, cx));
|
||||
root
|
||||
}
|
||||
|
||||
@@ -78,8 +78,10 @@ pub fn source_menu_items(
|
||||
.file_name()
|
||||
.map(|name| name.to_string_lossy().into_owned())
|
||||
.unwrap_or_else(|| path.display().to_string());
|
||||
|
||||
let target = view.clone();
|
||||
let path_for_action = path.clone();
|
||||
|
||||
items.push(
|
||||
MenuItem::new(truncate_label(&label))
|
||||
.checked(active_path.as_ref() == Some(&path))
|
||||
@@ -114,14 +116,12 @@ pub fn source_menu_items(
|
||||
} else {
|
||||
SharedString::from(format!("by {}", shorten_owner(&candidate.owner)))
|
||||
};
|
||||
let title = format!(
|
||||
"{} — {}",
|
||||
announcement_display_name(&candidate),
|
||||
subtitle
|
||||
);
|
||||
|
||||
let title = format!("{} — {}", announcement_display_name(&candidate), subtitle);
|
||||
let target = view.clone();
|
||||
let checked = active_fork == Some(candidate.addr());
|
||||
let announcement = candidate;
|
||||
|
||||
items.push(
|
||||
MenuItem::new(truncate_label(&title))
|
||||
.checked(checked)
|
||||
@@ -136,5 +136,6 @@ pub fn source_menu_items(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
items
|
||||
}
|
||||
|
||||
@@ -276,9 +276,7 @@ impl NewPullRequestView {
|
||||
let active_fork = self.fork.as_ref().map(|fork| fork.announcement.addr());
|
||||
let can_submit = self.submit_enabled(cx);
|
||||
let source_label = match &self.fork {
|
||||
Some(fork) => truncate_label(&announcement_display_name(
|
||||
&fork.announcement,
|
||||
)),
|
||||
Some(fork) => truncate_label(&announcement_display_name(&fork.announcement)),
|
||||
None => self.repo_path.as_ref().map_or_else(
|
||||
|| SharedString::from("No source"),
|
||||
|path| truncate_label(&path.display().to_string()),
|
||||
@@ -305,32 +303,35 @@ impl NewPullRequestView {
|
||||
.child(div().w(px(160.)).child(self.compare_select.clone())),
|
||||
)
|
||||
.child(
|
||||
v_flex().gap_1().child(div().text_xs().font_medium().child("Source")).child(
|
||||
Menu::new("pr-source")
|
||||
.open(self.source_open)
|
||||
.on_change(move |open, _, cx| {
|
||||
log_dropped(weak_menu.update(cx, |this, cx| {
|
||||
this.source_open = open;
|
||||
cx.notify();
|
||||
}));
|
||||
})
|
||||
.trigger(move |_, _| {
|
||||
Button::new("compare-source")
|
||||
.label(source_label.clone())
|
||||
.variant(ButtonVariant::Secondary)
|
||||
.into_any_element()
|
||||
})
|
||||
.items(move |_, _| {
|
||||
super::helpers::source_menu_items(
|
||||
source_view.clone(),
|
||||
associated.clone(),
|
||||
active_path.clone(),
|
||||
candidates.clone(),
|
||||
user,
|
||||
active_fork.clone(),
|
||||
)
|
||||
}),
|
||||
),
|
||||
v_flex()
|
||||
.gap_1()
|
||||
.child(div().text_xs().font_medium().child("Source"))
|
||||
.child(
|
||||
Menu::new("pr-source")
|
||||
.open(self.source_open)
|
||||
.on_change(move |open, _, cx| {
|
||||
log_dropped(weak_menu.update(cx, |this, cx| {
|
||||
this.source_open = open;
|
||||
cx.notify();
|
||||
}));
|
||||
})
|
||||
.trigger(move |_, _| {
|
||||
Button::new("compare-source")
|
||||
.label(source_label.clone())
|
||||
.variant(ButtonVariant::Secondary)
|
||||
.into_any_element()
|
||||
})
|
||||
.items(move |_, _| {
|
||||
super::helpers::source_menu_items(
|
||||
source_view.clone(),
|
||||
associated.clone(),
|
||||
active_path.clone(),
|
||||
candidates.clone(),
|
||||
user,
|
||||
active_fork.clone(),
|
||||
)
|
||||
}),
|
||||
),
|
||||
)
|
||||
.when_some(refresh_fork, |this, fork| {
|
||||
this.child(
|
||||
@@ -349,9 +350,7 @@ impl NewPullRequestView {
|
||||
.loading(self.submitting)
|
||||
.disabled(!can_submit)
|
||||
.on_click(move |_, window, cx| {
|
||||
log_dropped(
|
||||
weak.update(cx, |this, cx| this.submit(window, cx)),
|
||||
);
|
||||
log_dropped(weak.update(cx, |this, cx| this.submit(window, cx)));
|
||||
}),
|
||||
)
|
||||
.into_any_element()
|
||||
@@ -385,9 +384,7 @@ impl NewPullRequestView {
|
||||
return Spinner::centered("new-pr-loading");
|
||||
}
|
||||
if !self.has_source() {
|
||||
return EmptyState::centered(
|
||||
"Choose a local checkout or an announced fork to compare",
|
||||
);
|
||||
return EmptyState::centered("Choose a local checkout or an announced fork to compare");
|
||||
}
|
||||
if self.commits.is_none() && self.error.is_some() {
|
||||
return EmptyState::centered("Nothing to compare");
|
||||
|
||||
@@ -287,10 +287,7 @@ impl DiffPane {
|
||||
let view = view;
|
||||
move |index, _, cx| {
|
||||
if let Err(error) = view.update(cx, |this, cx| {
|
||||
let id = this
|
||||
.rows
|
||||
.get(index)
|
||||
.map(|row| row.key().to_string());
|
||||
let id = this.rows.get(index).map(|row| row.key().to_string());
|
||||
if let Some(id) = id {
|
||||
this.toggle_folder(&id, cx);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,9 @@ use ui::tooltip::Tooltip;
|
||||
|
||||
use super::grasp_servers::{GraspServersState, grasp_servers_field, load_user_grasp_servers};
|
||||
use crate::repo::actions::open_repo_panel;
|
||||
use crate::shared::progress::{DialogProgress, dialog_submit_button, error_row, push_steps_row, run_dialog_task_with};
|
||||
use crate::shared::progress::{
|
||||
DialogProgress, dialog_submit_button, error_row, push_steps_row, run_dialog_task_with,
|
||||
};
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
/// Progress of the create-repository flow, so async results can be rendered.
|
||||
|
||||
@@ -20,7 +20,9 @@ use ui::theme::ActiveTheme as _;
|
||||
|
||||
use super::grasp_servers::{GraspServersState, grasp_servers_field, load_user_grasp_servers};
|
||||
use crate::repo::RepoDetailView;
|
||||
use crate::shared::progress::{DialogProgress, dialog_submit_button, error_row, push_steps_row, run_dialog_task_with};
|
||||
use crate::shared::progress::{
|
||||
DialogProgress, dialog_submit_button, error_row, push_steps_row, run_dialog_task_with,
|
||||
};
|
||||
|
||||
pub struct InitRepoDialog {
|
||||
handle: DialogHandle,
|
||||
|
||||
@@ -119,14 +119,11 @@ impl RepoFilesView {
|
||||
|
||||
fn rebuild_rows(&mut self) {
|
||||
self.rows = TreeItemSeed::flatten_all(&self.seeds, &self.expanded);
|
||||
self.selected_index = self
|
||||
.selected_file
|
||||
.as_ref()
|
||||
.and_then(|path| {
|
||||
self.rows
|
||||
.iter()
|
||||
.position(|row| row.key().to_string() == path.as_ref())
|
||||
});
|
||||
self.selected_index = self.selected_file.as_ref().and_then(|path| {
|
||||
self.rows
|
||||
.iter()
|
||||
.position(|row| row.key().to_string() == path.as_ref())
|
||||
});
|
||||
}
|
||||
|
||||
fn toggle_folder(&mut self, id: &str) {
|
||||
@@ -281,10 +278,7 @@ impl RepoFilesView {
|
||||
let view = disclosure_view;
|
||||
move |index, _, cx| {
|
||||
if let Err(error) = view.update(cx, |this, cx| {
|
||||
let id = this
|
||||
.rows
|
||||
.get(index)
|
||||
.map(|row| row.key().to_string());
|
||||
let id = this.rows.get(index).map(|row| row.key().to_string());
|
||||
if let Some(id) = id {
|
||||
this.toggle_folder(&id);
|
||||
cx.emit(RepoFilesEvent::Activated);
|
||||
@@ -310,9 +304,9 @@ impl RepoFilesView {
|
||||
self.code_element(path.as_ref())
|
||||
}
|
||||
}
|
||||
Some(FileContent::Binary) => EmptyState::centered(
|
||||
"Binary file - preview not supported",
|
||||
),
|
||||
Some(FileContent::Binary) => {
|
||||
EmptyState::centered("Binary file - preview not supported")
|
||||
}
|
||||
Some(FileContent::TooLarge) => EmptyState::centered("File is too large to preview"),
|
||||
Some(FileContent::Failed(message)) => EmptyState::centered(message),
|
||||
None => Spinner::centered("repo-preview-spinner"),
|
||||
|
||||
@@ -174,7 +174,10 @@ pub(super) fn nostr_clone_url(announcement: &Announcement, nip05: Option<&str>)
|
||||
}
|
||||
|
||||
/// The display name of the announcement addressing `addr`, falling back to its identifier.
|
||||
pub(crate) fn upstream_display_name(addr: &RepoAddr, announcements: &[Announcement]) -> SharedString {
|
||||
pub(crate) fn upstream_display_name(
|
||||
addr: &RepoAddr,
|
||||
announcements: &[Announcement],
|
||||
) -> SharedString {
|
||||
announcements
|
||||
.iter()
|
||||
.find(|a| a.addr() == *addr)
|
||||
@@ -195,10 +198,8 @@ pub(super) fn fork_row(
|
||||
|
||||
let (label, clickable) = match &upstream.addr {
|
||||
Some(addr) => {
|
||||
let name = upstream_display_name(
|
||||
addr,
|
||||
&RepoListStore::global(cx).read(cx).announcements,
|
||||
);
|
||||
let name =
|
||||
upstream_display_name(addr, &RepoListStore::global(cx).read(cx).announcements);
|
||||
(SharedString::from(format!("Forked from {name}")), true)
|
||||
}
|
||||
None => (SharedString::from(upstream.display().as_str()), false),
|
||||
|
||||
@@ -43,8 +43,8 @@ pub mod refs;
|
||||
|
||||
use files::RepoFilesView;
|
||||
use helpers::{
|
||||
RepoData, announcement_display_name, bound_repo_label, clone_group, fork_row,
|
||||
load_repo_data, nostr_clone_url, repo_display_name, snapshot_worktree,
|
||||
RepoData, announcement_display_name, bound_repo_label, clone_group, fork_row, load_repo_data,
|
||||
nostr_clone_url, repo_display_name, snapshot_worktree,
|
||||
};
|
||||
use history::RepoHistoryView;
|
||||
use refs::RefSwitcher;
|
||||
@@ -52,11 +52,10 @@ use utils::relative_time_secs;
|
||||
|
||||
use crate::issues::IssuesView;
|
||||
use crate::pull_requests::PullRequestsView;
|
||||
use crate::repo::helpers::{short_id, sorted_worktree_paths};
|
||||
use crate::shared::log_dropped;
|
||||
use crate::workspace::Workspace;
|
||||
|
||||
use crate::repo::helpers::{short_id, sorted_worktree_paths};
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub(super) enum RepoSection {
|
||||
Files,
|
||||
@@ -479,6 +478,7 @@ impl RepoDetailView {
|
||||
if let Ok(Some((moved, snapshot))) = refresh {
|
||||
let branches: Vec<SharedString> =
|
||||
snapshot.branches.iter().map(Into::into).collect();
|
||||
|
||||
let tags: Vec<SharedString> = snapshot.tags.iter().map(Into::into).collect();
|
||||
let current_branch = snapshot.current_branch.clone();
|
||||
let head_commit = snapshot.head_commit.clone();
|
||||
|
||||
@@ -96,14 +96,7 @@ pub fn open_primary<P, F>(
|
||||
P: Panel + 'static,
|
||||
F: Fn(&mut Window, &mut App) -> Entity<P> + 'static,
|
||||
{
|
||||
open_slot(
|
||||
PanelSlot::Main,
|
||||
workspace,
|
||||
id,
|
||||
build,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
open_slot(PanelSlot::Main, workspace, id, build, window, cx);
|
||||
}
|
||||
|
||||
/// Opens a detail panel beside the main panel, reusing it when it is already cached.
|
||||
@@ -117,12 +110,5 @@ pub fn open_detail<P, F>(
|
||||
P: Panel + 'static,
|
||||
F: Fn(&mut Window, &mut App) -> Entity<P> + 'static,
|
||||
{
|
||||
open_slot(
|
||||
PanelSlot::Detail,
|
||||
workspace,
|
||||
id,
|
||||
build,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
open_slot(PanelSlot::Detail, workspace, id, build, window, cx);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
|
||||
use gpui::{
|
||||
AnyElement, AnyView, App, AppContext as _, Context, Entity, IntoElement, KeyBinding,
|
||||
AnyElement, App, AppContext as _, Context, Entity, IntoElement, KeyBinding,
|
||||
KeyBindingContextPredicate, ParentElement as _, SharedString, Subscription, WeakEntity, Window,
|
||||
};
|
||||
use metadata::{Profile, ProfileDirectory};
|
||||
@@ -16,6 +16,7 @@ use ui::button::{Button, ButtonVariant};
|
||||
use ui::command_palette::{Command, CommandPalette, CommandPaletteState};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::layout::panel::PanelView;
|
||||
use ui::layout::root::Root;
|
||||
use ui::menu::{Menu, MenuItem};
|
||||
use ui::tabs::{Tab, Tabs, TabsVariant};
|
||||
use ui::tooltip::Tooltip;
|
||||
@@ -65,12 +66,7 @@ pub struct TitlebarView {
|
||||
local_repos: Arc<Vec<ResolvedLocalRepo>>,
|
||||
/// Profiles rendered by the repository switcher.
|
||||
directory: Entity<ProfileDirectory>,
|
||||
/// The command palette opened from the titlebar.
|
||||
palette: Entity<CommandPaletteState>,
|
||||
repository_switcher: Entity<RepositorySwitcher>,
|
||||
settings: Option<Entity<SettingsDialog>>,
|
||||
exit: Option<Entity<ExitDialog>>,
|
||||
create: Option<Entity<dialogs::create::CreateRepoDialog>>,
|
||||
user_menu_open: bool,
|
||||
_subscriptions: Vec<Subscription>,
|
||||
}
|
||||
@@ -84,10 +80,10 @@ impl TitlebarView {
|
||||
let backend = Backend::global(cx);
|
||||
let repos = RepoListStore::global(cx);
|
||||
let local = LocalReposStore::global(cx);
|
||||
let directory = ProfileDirectory::new(cx);
|
||||
|
||||
let weak = cx.entity().downgrade();
|
||||
let palette = Self::new_palette(weak.clone(), window, cx);
|
||||
let directory = ProfileDirectory::new(cx);
|
||||
Root::open_dialog(Self::new_palette(weak.clone(), window, cx), cx);
|
||||
|
||||
let entity = cx.entity();
|
||||
let mut subscriptions = Vec::new();
|
||||
@@ -156,11 +152,7 @@ impl TitlebarView {
|
||||
announcements: Arc::new(Vec::new()),
|
||||
local_repos: Arc::new(Vec::new()),
|
||||
directory,
|
||||
palette,
|
||||
repository_switcher,
|
||||
settings: None,
|
||||
exit: None,
|
||||
create: None,
|
||||
user_menu_open: false,
|
||||
_subscriptions: subscriptions,
|
||||
}
|
||||
@@ -215,10 +207,6 @@ impl TitlebarView {
|
||||
]
|
||||
}
|
||||
|
||||
pub fn palette(&self) -> Entity<CommandPaletteState> {
|
||||
self.palette.clone()
|
||||
}
|
||||
|
||||
fn refresh(&mut self, cx: &mut Context<Self>) -> bool {
|
||||
let backend = Backend::global(cx);
|
||||
let user = backend.read(cx).current_user();
|
||||
@@ -377,33 +365,21 @@ impl TitlebarView {
|
||||
}
|
||||
|
||||
fn open_settings(&mut self, cx: &mut Context<Self>) {
|
||||
self.settings = Some(SettingsDialog::new(cx));
|
||||
Root::open_dialog(SettingsDialog::new(cx), cx);
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn open_exit(&mut self, cx: &mut Context<Self>) {
|
||||
self.exit = Some(ExitDialog::new(cx));
|
||||
Root::open_dialog(ExitDialog::new(cx), cx);
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
fn open_create(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
let view = dialogs::create::CreateRepoDialog::new(self.workspace.clone(), window, cx);
|
||||
self.create = Some(view);
|
||||
Root::open_dialog(view, cx);
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
/// The dialogs this titlebar opens, rendered at the window root.
|
||||
pub fn dialogs(&self) -> Vec<AnyView> {
|
||||
[
|
||||
self.settings.clone().map(Into::into),
|
||||
self.exit.clone().map(Into::into),
|
||||
self.create.clone().map(Into::into),
|
||||
]
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn activate(&mut self, index: usize, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if let Some(announcement) = self.announcements.get(index) {
|
||||
let addr = announcement.addr();
|
||||
|
||||
Reference in New Issue
Block a user