From 77303d548e981628b7bbcf606606b662b89b1b33 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 19 Sep 2024 00:17:51 +0300 Subject: [PATCH] hide pin widget by argument --- src/app/browser/main/tab/label.rs | 26 +++++++++++++++++--------- src/app/browser/main/tab/label/pin.rs | 18 +++++++++++++----- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/src/app/browser/main/tab/label.rs b/src/app/browser/main/tab/label.rs index 56962b97..4325a8dc 100644 --- a/src/app/browser/main/tab/label.rs +++ b/src/app/browser/main/tab/label.rs @@ -6,17 +6,25 @@ use gtk::prelude::BoxExt; pub fn new() -> Box { - let label = Box::builder().orientation( - gtk::Orientation::Horizontal - ).build(); + let label = Box::builder() - label.append( - &pin::new() - ); + // Tuneup + .orientation( + gtk::Orientation::Horizontal + ) - label.append( - &title::new() - ); + .build(); + + // Components + label.append( + &pin::new( + false + ) + ); + + label.append( + &title::new() + ); return label; } \ No newline at end of file diff --git a/src/app/browser/main/tab/label/pin.rs b/src/app/browser/main/tab/label/pin.rs index fc8340b0..6a286120 100644 --- a/src/app/browser/main/tab/label/pin.rs +++ b/src/app/browser/main/tab/label/pin.rs @@ -1,10 +1,18 @@ use gtk::Image; -pub fn new() -> Image +pub fn new( + visible : bool +) -> Image { - let pin = Image::builder().icon_name( - "view-pin-symbolic" - ).build(); + return Image::builder() - return pin; + .icon_name( + "view-pin-symbolic" + ) + + .visible( + visible + ) + + .build(); } \ No newline at end of file