Add task manager internal page
This commit is contained in:
@@ -13,8 +13,8 @@ use plugins::{PendingPluginInstall, PendingPluginUninstall};
|
||||
|
||||
use crate::{
|
||||
CloseCurrentTab, FocusAddressBar, FocusCommandMode, OpenDownloads, OpenHistory, OpenNewTab,
|
||||
OpenSettings, RestoreClosedTab, SelectNextTab, SelectPreviousTab, ToggleFavoriteTab,
|
||||
TogglePinnedTab,
|
||||
OpenSettings, OpenTaskManager, RestoreClosedTab, SelectNextTab, SelectPreviousTab,
|
||||
ToggleFavoriteTab, TogglePinnedTab,
|
||||
};
|
||||
|
||||
enum ShellState {
|
||||
@@ -114,6 +114,10 @@ impl ElyShell {
|
||||
self.open_internal_tab("ely://settings", window, cx);
|
||||
}
|
||||
|
||||
fn open_task_manager(&mut self, window: &mut Window, cx: &mut Context<Self>) {
|
||||
self.open_internal_tab("ely://task-manager", window, cx);
|
||||
}
|
||||
|
||||
fn open_internal_tab(&mut self, url_text: &str, window: &mut Window, cx: &mut Context<Self>) {
|
||||
if let Ok(url) = UrlText::parse(url_text) {
|
||||
self.open_url(url, window, cx);
|
||||
@@ -294,6 +298,15 @@ impl ElyShell {
|
||||
self.open_settings(window, cx);
|
||||
}
|
||||
|
||||
fn on_open_task_manager(
|
||||
&mut self,
|
||||
_: &OpenTaskManager,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Self>,
|
||||
) {
|
||||
self.open_task_manager(window, cx);
|
||||
}
|
||||
|
||||
fn on_restore_closed_tab(
|
||||
&mut self,
|
||||
_: &RestoreClosedTab,
|
||||
|
||||
Reference in New Issue
Block a user