mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
draft pin tab feature
This commit is contained in:
parent
4b78ccb779
commit
f2427c453e
8 changed files with 64 additions and 20 deletions
|
|
@ -10,21 +10,33 @@ pub struct Label {
|
|||
title: Arc<title::Title>,
|
||||
|
||||
// Extras
|
||||
is_pinned: bool,
|
||||
widget: widget::Label,
|
||||
}
|
||||
|
||||
impl Label {
|
||||
// Construct
|
||||
pub fn new() -> Arc<Label> {
|
||||
// Init components
|
||||
let pin = pin::Pin::new();
|
||||
pub fn new(is_pinned: bool) -> Arc<Label> {
|
||||
// Components
|
||||
let pin = pin::Pin::new(is_pinned);
|
||||
let title = title::Title::new();
|
||||
|
||||
// Init extras
|
||||
// Extras
|
||||
let widget = widget::Label::new(pin.widget().image(), title.widget().label());
|
||||
|
||||
// Result
|
||||
Arc::new(Self { pin, title, widget })
|
||||
Arc::new(Self {
|
||||
pin,
|
||||
title,
|
||||
is_pinned,
|
||||
widget,
|
||||
})
|
||||
}
|
||||
|
||||
// Actions
|
||||
pub fn pin(&mut self) {
|
||||
self.is_pinned = !self.is_pinned; // toggle
|
||||
// @TODO
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue