mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
init label components
This commit is contained in:
parent
9e27fb0165
commit
b759ad72ee
3 changed files with 50 additions and 3 deletions
|
|
@ -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
Normal file
10
src/app/browser/main/tab/label/pin.rs
Normal file
|
|
@ -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
Normal file
24
src/app/browser/main/tab/label/title.rs
Normal file
|
|
@ -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…
Add table
Add a link
Reference in a new issue