Browse Source

init label components

master
yggverse 2 months ago
parent
commit
b759ad72ee
  1. 19
      src/app/browser/main/tab/label.rs
  2. 10
      src/app/browser/main/tab/label/pin.rs
  3. 24
      src/app/browser/main/tab/label/title.rs

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

@ -1,9 +1,22 @@ @@ -1,9 +1,22 @@
#[path = "label/pin.rs"] mod pin;
#[path = "label/title.rs"] mod title;
use gtk::Box;
// use gtk::prelude::BoxExt; @TODO append
use gtk::prelude::BoxExt;
pub fn new() -> Box
{
return Box::builder().orientation(
gtk::Orientation::Vertical
let label = Box::builder().orientation(
gtk::Orientation::Horizontal
).build();
label.append(
&pin::new()
);
label.append(
&title::new()
);
return label;
}

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

@ -0,0 +1,10 @@ @@ -0,0 +1,10 @@
use gtk::Image;
pub fn new() -> Image
{
let pin = Image::builder().icon_name(
"view-pin-symbolic"
).build();
return pin;
}

24
src/app/browser/main/tab/label/title.rs

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
use gtk::Label;
pub fn new() -> Label
{
return Label::builder()
.label(
"New page"
)
.ellipsize(
gtk::pango::EllipsizeMode::End
)
.width_chars(
16
)
.single_line_mode(
true
)
.build();
}
Loading…
Cancel
Save