update pin toggle action

This commit is contained in:
yggverse 2024-09-23 21:50:13 +03:00
parent 4e3ba05195
commit 02715ea8aa

View File

@ -34,10 +34,17 @@ impl Label {
// Actions
pub fn pin(&self) -> bool {
self.pin
.widget()
.set_visible(!self.pin.widget().is_visible());
self.pin.widget().is_visible()
// Toggle status
let is_pinned = !self.pin.widget().is_visible();
// Update pin widget
self.pin.widget().set_visible(is_pinned);
// Update label widget
self.title.widget().set_visible(!is_pinned);
// Result
is_pinned
}
// Getters