mirror of
https://github.com/YGGverse/Yoda.git
synced 2025-01-15 17:20:08 +00:00
use any widget for child
This commit is contained in:
parent
2466463d53
commit
51f543143d
@ -3,7 +3,7 @@ mod database;
|
|||||||
use database::Database;
|
use database::Database;
|
||||||
|
|
||||||
use adw::{TabPage, TabView};
|
use adw::{TabPage, TabView};
|
||||||
use gtk::Box;
|
use gtk::prelude::IsA;
|
||||||
use sqlite::Transaction;
|
use sqlite::Transaction;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
@ -18,15 +18,15 @@ impl Widget {
|
|||||||
pub fn new_arc(
|
pub fn new_arc(
|
||||||
keyword: &str, // ID
|
keyword: &str, // ID
|
||||||
tab_view: &TabView,
|
tab_view: &TabView,
|
||||||
page: &Box,
|
child: &impl IsA<gtk::Widget>,
|
||||||
title: Option<&str>,
|
title: Option<&str>,
|
||||||
position: Option<i32>,
|
position: Option<i32>,
|
||||||
is_pinned: bool,
|
is_pinned: bool,
|
||||||
is_selected: bool,
|
is_selected: bool,
|
||||||
) -> Arc<Self> {
|
) -> Arc<Self> {
|
||||||
let gobject = match position {
|
let gobject = match position {
|
||||||
Some(number) => tab_view.insert(page, number),
|
Some(number) => tab_view.insert(child, number),
|
||||||
None => tab_view.append(page),
|
None => tab_view.append(child),
|
||||||
};
|
};
|
||||||
|
|
||||||
gobject.set_keyword(keyword);
|
gobject.set_keyword(keyword);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user