diff --git a/src/browser/main/tab/label/mod.rs b/src/browser/main/tab/label/mod.rs index 47854a27..e3f88705 100644 --- a/src/browser/main/tab/label/mod.rs +++ b/src/browser/main/tab/label/mod.rs @@ -35,22 +35,17 @@ impl Label { Self { pin, title, widget } } - // Actions - pub fn pin(&self) -> bool { - // Toggle status - let is_pinned = !self.pin.widget().is_visible(); - - // Update pin widget + // Setters + pub fn pin(&self, is_pinned: bool) { self.pin.widget().set_visible(is_pinned); - - // Update label widget self.title.widget().set_visible(!is_pinned); - - // Result - is_pinned } // Getters + pub fn is_pinned(&self) -> bool { + self.pin.widget().is_visible() + } + pub fn widget(&self) -> &Box { &self.widget } diff --git a/src/browser/main/tab/mod.rs b/src/browser/main/tab/mod.rs index c818242d..a4f85cc7 100644 --- a/src/browser/main/tab/mod.rs +++ b/src/browser/main/tab/mod.rs @@ -34,7 +34,7 @@ impl Tab { move |_, n: i32, _, _| { // double click if n == 2 { - label.pin(); + label.pin(!label.is_pinned()); // toggle } } });