Browse Source

hide pin widget by argument

master
yggverse 2 months ago
parent
commit
77303d548e
  1. 14
      src/app/browser/main/tab/label.rs
  2. 16
      src/app/browser/main/tab/label/pin.rs

14
src/app/browser/main/tab/label.rs

@ -6,12 +6,20 @@ use gtk::prelude::BoxExt;
pub fn new() -> Box pub fn new() -> Box
{ {
let label = Box::builder().orientation( let label = Box::builder()
// Tuneup
.orientation(
gtk::Orientation::Horizontal gtk::Orientation::Horizontal
).build(); )
.build();
// Components
label.append( label.append(
&pin::new() &pin::new(
false
)
); );
label.append( label.append(

16
src/app/browser/main/tab/label/pin.rs

@ -1,10 +1,18 @@
use gtk::Image; use gtk::Image;
pub fn new() -> Image pub fn new(
visible : bool
) -> Image
{ {
let pin = Image::builder().icon_name( return Image::builder()
.icon_name(
"view-pin-symbolic" "view-pin-symbolic"
).build(); )
.visible(
visible
)
return pin; .build();
} }
Loading…
Cancel
Save