mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-03-13 06:01:21 +00:00
init label components
This commit is contained in:
parent
9e27fb0165
commit
b759ad72ee
@ -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…
x
Reference in New Issue
Block a user