big refactor and cleanup of dock + use tokio mpsc
This commit is contained in:
parent
346701b16d
commit
35eb571528
14 changed files with 578 additions and 674 deletions
33
examples/dock/dock_list/imp.rs
Normal file
33
examples/dock/dock_list/imp.rs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use glib::SignalHandlerId;
|
||||
use gtk4::subclass::prelude::*;
|
||||
use gtk4::{gio, glib};
|
||||
use gtk4::{Box, DragSource, DropTarget, GestureClick, ListView};
|
||||
use once_cell::sync::OnceCell;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
pub struct DockList {
|
||||
pub list_view: OnceCell<ListView>,
|
||||
pub type_: OnceCell<super::DockListType>,
|
||||
pub model: OnceCell<gio::ListStore>,
|
||||
pub click_controller: OnceCell<GestureClick>,
|
||||
pub drop_controller: OnceCell<DropTarget>,
|
||||
pub drag_source: OnceCell<DragSource>,
|
||||
pub drag_end_signal: Rc<RefCell<Option<SignalHandlerId>>>,
|
||||
pub drag_cancel_signal: Rc<RefCell<Option<SignalHandlerId>>>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
impl ObjectSubclass for DockList {
|
||||
const NAME: &'static str = "DockList";
|
||||
type Type = super::DockList;
|
||||
type ParentType = Box;
|
||||
}
|
||||
|
||||
impl ObjectImpl for DockList {}
|
||||
|
||||
impl WidgetImpl for DockList {}
|
||||
|
||||
impl BoxImpl for DockList {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue