Wire download row controls

This commit is contained in:
2026-05-07 21:50:31 -04:00
parent 6d47b26090
commit f3c9a933c9
3 changed files with 248 additions and 108 deletions
+33 -1
View File
@@ -2,7 +2,7 @@ mod internal_pages;
mod render;
use ely_browser_core::{BrowserCore, InitialBrowserConfig};
use ely_domain::{CommandIntent, SpaceId, TabId, UrlText};
use ely_domain::{CommandIntent, DownloadId, SpaceId, TabId, UrlText};
use gpui::{App, AppContext, Context, Entity, FocusHandle, Focusable, Subscription, Window};
use gpui_component::input::{InputEvent, InputState, SelectAll};
@@ -215,6 +215,38 @@ impl ElyShell {
}
}
fn pause_download(&mut self, download_id: &DownloadId, cx: &mut Context<Self>) {
if let ShellState::Ready(core) = &mut self.state
&& core.pause_download(download_id).is_ok()
{
cx.notify();
}
}
fn resume_download(&mut self, download_id: &DownloadId, cx: &mut Context<Self>) {
if let ShellState::Ready(core) = &mut self.state
&& core.resume_download(download_id).is_ok()
{
cx.notify();
}
}
fn cancel_download(&mut self, download_id: &DownloadId, cx: &mut Context<Self>) {
if let ShellState::Ready(core) = &mut self.state
&& core.cancel_download(download_id).is_ok()
{
cx.notify();
}
}
fn retry_download(&mut self, download_id: &DownloadId, cx: &mut Context<Self>) {
if let ShellState::Ready(core) = &mut self.state
&& core.retry_download(download_id).is_ok()
{
cx.notify();
}
}
fn on_close_current_tab(
&mut self,
_: &CloseCurrentTab,