Browse Source

hide pin widget by argument

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

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

@ -6,17 +6,25 @@ use gtk::prelude::BoxExt; @@ -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;
}

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

@ -1,10 +1,18 @@ @@ -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();
}
Loading…
Cancel
Save