From 738203aaab0b29b169c18c661556b058e4fe0f21 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 24 Sep 2024 00:56:46 +0300 Subject: [PATCH] implement close all tabs action --- src/browser/main/mod.rs | 2 +- src/browser/main/tab/mod.rs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/browser/main/mod.rs b/src/browser/main/mod.rs index 94b6f140..35996a0e 100644 --- a/src/browser/main/mod.rs +++ b/src/browser/main/mod.rs @@ -35,7 +35,7 @@ impl Main { } pub fn tab_close_all(&self) { - self.tab.close(); + self.tab.close_all(); } pub fn tab_pin(&self) { diff --git a/src/browser/main/tab/mod.rs b/src/browser/main/tab/mod.rs index 4558037b..5b0dad5d 100644 --- a/src/browser/main/tab/mod.rs +++ b/src/browser/main/tab/mod.rs @@ -58,10 +58,11 @@ impl Tab { self.widget.remove_page(self.widget.current_page()); } - /* @TODO pub fn close_all(&self) { - todo!() - }*/ + while let Some(page_number) = self.widget.current_page() { + self.widget.remove_page(Some(page_number)); + } + } pub fn pin(&self) -> bool { todo!()