mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +00:00
begin titan file uploads implementation
This commit is contained in:
parent
00877ee36f
commit
f5e850ead3
10 changed files with 184 additions and 98 deletions
|
|
@ -4,7 +4,11 @@ mod titan;
|
|||
|
||||
use super::ItemAction;
|
||||
use adw::Clamp;
|
||||
use gtk::{glib::Uri, prelude::WidgetExt};
|
||||
use gtk::{
|
||||
glib::Uri,
|
||||
prelude::{IsA, WidgetExt},
|
||||
Widget,
|
||||
};
|
||||
use response::Response;
|
||||
use sensitive::Sensitive;
|
||||
use std::rc::Rc;
|
||||
|
|
@ -37,10 +41,10 @@ impl Input {
|
|||
|
||||
// Actions
|
||||
pub fn unset(&self) {
|
||||
self.update(None);
|
||||
self.update(Widget::NONE);
|
||||
}
|
||||
|
||||
pub fn update(&self, child: Option<>k::Box>) {
|
||||
pub fn update(&self, child: Option<&impl IsA<Widget>>) {
|
||||
if child.is_some() {
|
||||
self.clamp.set_visible(true); // widget may be hidden, make it visible to child redraw
|
||||
self.clamp.set_child(child);
|
||||
|
|
@ -71,6 +75,6 @@ impl Input {
|
|||
}
|
||||
|
||||
pub fn set_new_titan(&self, on_send: impl Fn(&[u8], Box<dyn Fn()>) + 'static) {
|
||||
self.update(Some(>k::Box::titan(on_send)));
|
||||
self.update(Some(>k::Notebook::titan(on_send)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue