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 adw::{TabPage, TabView};
|
||||
use gtk::Box;
|
||||
use gtk::prelude::IsA;
|
||||
use sqlite::Transaction;
|
||||
use std::sync::Arc;
|
||||
|
||||
@ -18,15 +18,15 @@ impl Widget {
|
||||
pub fn new_arc(
|
||||
keyword: &str, // ID
|
||||
tab_view: &TabView,
|
||||
page: &Box,
|
||||
child: &impl IsA<gtk::Widget>,
|
||||
title: Option<&str>,
|
||||
position: Option<i32>,
|
||||
is_pinned: bool,
|
||||
is_selected: bool,
|
||||
) -> Arc<Self> {
|
||||
let gobject = match position {
|
||||
Some(number) => tab_view.insert(page, number),
|
||||
None => tab_view.append(page),
|
||||
Some(number) => tab_view.insert(child, number),
|
||||
None => tab_view.append(child),
|
||||
};
|
||||
|
||||
gobject.set_keyword(keyword);
|
||||
|
Loading…
x
Reference in New Issue
Block a user