update comments

This commit is contained in:
yggverse 2024-11-04 21:19:13 +02:00
parent 5058c1be8a
commit 71f7cbcd2b

View File

@ -33,18 +33,20 @@ impl Widget {
// Actions // Actions
/// Close page at given `position`, `None` to close selected page (if available) /// Close page at given `position`, `None` to close selected page (if available)
/// * this action does not close pinned pages
pub fn close(&self, position: Option<i32>) { pub fn close(&self, position: Option<i32>) {
if let Some(page) = self.page(position) { if let Some(page) = self.page(position) {
self.gobject.close_page(&page); self.gobject.close_page(&page);
} }
} }
/// Close all pages, including selected one /// Close all pages
/// * this action does not close pinned pages
pub fn close_all(&self) { pub fn close_all(&self) {
// @TODO skip pinned or make confirmation alert (GTK>=4.10) // @TODO skip pinned or make confirmation alert (GTK>=4.10)
if let Some(selected_page) = self.gobject.selected_page() { if let Some(selected_page) = self.gobject.selected_page() {
self.gobject.close_other_pages(&selected_page); self.gobject.close_other_pages(&selected_page);
self.close(None); self.gobject.close_page(&selected_page);
} }
} }