mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
implement separated mods for navigation widgets
This commit is contained in:
parent
2e8d907c22
commit
2d9eec9b02
15 changed files with 401 additions and 194 deletions
|
|
@ -1,19 +1,20 @@
|
|||
mod widget;
|
||||
|
||||
use widget::Widget;
|
||||
|
||||
use gtk::Button;
|
||||
use std::sync::Arc;
|
||||
|
||||
pub struct Bookmark {
|
||||
widget: Button,
|
||||
widget: Arc<Widget>,
|
||||
}
|
||||
|
||||
impl Bookmark {
|
||||
// Construct
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
widget: Button::builder()
|
||||
.icon_name("starred-symbolic")
|
||||
.tooltip_text("Bookmark")
|
||||
.sensitive(false)
|
||||
.build(),
|
||||
}
|
||||
pub fn new_arc() -> Arc<Self> {
|
||||
Arc::new(Self {
|
||||
widget: Widget::new_arc(),
|
||||
})
|
||||
}
|
||||
|
||||
// Actions
|
||||
|
|
@ -22,7 +23,7 @@ impl Bookmark {
|
|||
}
|
||||
|
||||
// Getters
|
||||
pub fn widget(&self) -> &Button {
|
||||
&self.widget
|
||||
pub fn gobject(&self) -> &Button {
|
||||
&self.widget.gobject()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue