mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
remove extra getters
This commit is contained in:
parent
3ce272cd70
commit
0af69d99f6
56 changed files with 240 additions and 710 deletions
|
|
@ -30,18 +30,18 @@ pub use append::Position; // public enum
|
|||
/// [SimpleActionGroup](https://docs.gtk.org/gio/class.SimpleActionGroup.html) wrapper for `Browser` actions
|
||||
pub struct Action {
|
||||
// Actions
|
||||
append: Rc<Append>,
|
||||
bookmark: Rc<Bookmark>,
|
||||
close_all: Rc<CloseAll>,
|
||||
close: Rc<Close>,
|
||||
history_back: Rc<HistoryBack>,
|
||||
history_forward: Rc<HistoryForward>,
|
||||
home: Rc<Home>,
|
||||
pin: Rc<Pin>,
|
||||
reload: Rc<Reload>,
|
||||
pub append: Rc<Append>,
|
||||
pub bookmark: Rc<Bookmark>,
|
||||
pub close_all: Rc<CloseAll>,
|
||||
pub close: Rc<Close>,
|
||||
pub history_back: Rc<HistoryBack>,
|
||||
pub history_forward: Rc<HistoryForward>,
|
||||
pub home: Rc<Home>,
|
||||
pub pin: Rc<Pin>,
|
||||
pub reload: Rc<Reload>,
|
||||
// Group
|
||||
id: GString,
|
||||
gobject: SimpleActionGroup,
|
||||
pub id: GString,
|
||||
pub gobject: SimpleActionGroup,
|
||||
}
|
||||
|
||||
impl Action {
|
||||
|
|
@ -67,15 +67,15 @@ impl Action {
|
|||
let gobject = SimpleActionGroup::new();
|
||||
|
||||
// Add action to given group
|
||||
gobject.add_action(append.gobject());
|
||||
gobject.add_action(bookmark.gobject());
|
||||
gobject.add_action(close_all.gobject());
|
||||
gobject.add_action(close.gobject());
|
||||
gobject.add_action(history_back.gobject());
|
||||
gobject.add_action(history_forward.gobject());
|
||||
gobject.add_action(home.gobject());
|
||||
gobject.add_action(pin.gobject());
|
||||
gobject.add_action(reload.gobject());
|
||||
gobject.add_action(&append.gobject);
|
||||
gobject.add_action(&bookmark.gobject);
|
||||
gobject.add_action(&close_all.gobject);
|
||||
gobject.add_action(&close.gobject);
|
||||
gobject.add_action(&history_back.gobject);
|
||||
gobject.add_action(&history_forward.gobject);
|
||||
gobject.add_action(&home.gobject);
|
||||
gobject.add_action(&pin.gobject);
|
||||
gobject.add_action(&reload.gobject);
|
||||
|
||||
// Done
|
||||
Self {
|
||||
|
|
@ -92,64 +92,4 @@ impl Action {
|
|||
gobject,
|
||||
}
|
||||
}
|
||||
|
||||
// Getters
|
||||
|
||||
/// Get reference to `Append` action
|
||||
pub fn append(&self) -> &Rc<Append> {
|
||||
&self.append
|
||||
}
|
||||
|
||||
/// Get reference to `Bookmark` action
|
||||
pub fn bookmark(&self) -> &Rc<Bookmark> {
|
||||
&self.bookmark
|
||||
}
|
||||
|
||||
/// Get reference to `CloseAll` action
|
||||
pub fn close_all(&self) -> &Rc<CloseAll> {
|
||||
&self.close_all
|
||||
}
|
||||
|
||||
/// Get reference to `Close` action
|
||||
pub fn close(&self) -> &Rc<Close> {
|
||||
&self.close
|
||||
}
|
||||
|
||||
/// Get reference to `HistoryBack` action
|
||||
pub fn history_back(&self) -> &Rc<HistoryBack> {
|
||||
&self.history_back
|
||||
}
|
||||
|
||||
/// Get reference to `HistoryForward` action
|
||||
pub fn history_forward(&self) -> &Rc<HistoryForward> {
|
||||
&self.history_forward
|
||||
}
|
||||
|
||||
/// Get reference to `Home` action
|
||||
pub fn home(&self) -> &Rc<Home> {
|
||||
&self.home
|
||||
}
|
||||
|
||||
/// Get reference to `Pin` action
|
||||
pub fn pin(&self) -> &Rc<Pin> {
|
||||
&self.pin
|
||||
}
|
||||
|
||||
/// Get reference to `Reload` action
|
||||
pub fn reload(&self) -> &Rc<Reload> {
|
||||
&self.reload
|
||||
}
|
||||
|
||||
/// Get auto-generated name for action group
|
||||
/// * useful for manual relationship with GObjects or as the `detailed_name`
|
||||
/// for [Accels](https://docs.gtk.org/gtk4/method.Application.set_accels_for_action.html) or
|
||||
/// [Menu](https://docs.gtk.org/gio/class.Menu.html) builder
|
||||
pub fn id(&self) -> &GString {
|
||||
&self.id
|
||||
}
|
||||
|
||||
/// Get reference to [SimpleActionGroup](https://docs.gtk.org/gio/class.SimpleActionGroup.html) GObject
|
||||
pub fn gobject(&self) -> &SimpleActionGroup {
|
||||
&self.gobject
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue