mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
define ptr container outside
This commit is contained in:
parent
7b2c07ac45
commit
a5fc2a7475
58 changed files with 230 additions and 272 deletions
|
|
@ -5,7 +5,6 @@ use database::Database;
|
|||
use adw::{TabPage, TabView};
|
||||
use gtk::prelude::IsA;
|
||||
use sqlite::Transaction;
|
||||
use std::rc::Rc;
|
||||
|
||||
const DEFAULT_TITLE: &str = "New page";
|
||||
|
||||
|
|
@ -15,7 +14,7 @@ pub struct Widget {
|
|||
|
||||
impl Widget {
|
||||
// Construct
|
||||
pub fn new_rc(
|
||||
pub fn new(
|
||||
keyword: &str, // ID
|
||||
tab_view: &TabView,
|
||||
child: &impl IsA<gtk::Widget>,
|
||||
|
|
@ -23,7 +22,7 @@ impl Widget {
|
|||
position: Option<i32>,
|
||||
is_pinned: bool,
|
||||
is_selected: bool,
|
||||
) -> Rc<Self> {
|
||||
) -> Self {
|
||||
let gobject = match position {
|
||||
Some(value) => {
|
||||
// If given `position` match pinned tab, GTK will panic with notice:
|
||||
|
|
@ -51,7 +50,7 @@ impl Widget {
|
|||
tab_view.set_selected_page(&gobject);
|
||||
}
|
||||
|
||||
Rc::new(Self { gobject })
|
||||
Self { gobject }
|
||||
}
|
||||
|
||||
// Actions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue