-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: content: Add pinned messages bar and view
- Loading branch information
Showing
10 changed files
with
299 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
use gtk::subclass::prelude::*; | ||
use gtk::{glib, CompositeTemplate}; | ||
|
||
mod imp { | ||
use super::*; | ||
|
||
#[derive(Debug, Default, CompositeTemplate)] | ||
#[template(string = r#" | ||
template PinnedMessagesBar { | ||
Box content_box { | ||
styles ["toolbar"] | ||
Box { | ||
orientation: vertical; | ||
hexpand: true; | ||
Inscription { | ||
} | ||
Inscription { | ||
} | ||
} | ||
Button { | ||
icon-name: "view-list-symbolic"; | ||
action-name: "content.show-pinned-messages"; | ||
} | ||
} | ||
} | ||
"#)] | ||
pub(crate) struct PinnedMessagesBar { | ||
#[template_child] | ||
pub(super) content_box: TemplateChild<gtk::Box>, | ||
} | ||
|
||
#[glib::object_subclass] | ||
impl ObjectSubclass for PinnedMessagesBar { | ||
const NAME: &'static str = "PinnedMessagesBar"; | ||
type Type = super::PinnedMessagesBar; | ||
type ParentType = gtk::Widget; | ||
|
||
fn class_init(klass: &mut Self::Class) { | ||
klass.bind_template(); | ||
klass.set_layout_manager_type::<gtk::BinLayout>(); | ||
} | ||
|
||
fn instance_init(obj: &glib::subclass::InitializingObject<Self>) { | ||
obj.init_template(); | ||
} | ||
} | ||
|
||
impl ObjectImpl for PinnedMessagesBar { | ||
fn dispose(&self) { | ||
self.dispose_template(); | ||
} | ||
} | ||
|
||
impl WidgetImpl for PinnedMessagesBar {} | ||
} | ||
|
||
glib::wrapper! { | ||
pub(crate) struct PinnedMessagesBar(ObjectSubclass<imp::PinnedMessagesBar>) | ||
@extends gtk::Widget; | ||
} |
Oops, something went wrong.