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
|
|
@ -1,37 +1,22 @@
|
|||
use std::cell::RefCell;
|
||||
use std::rc::Rc;
|
||||
|
||||
use glib::SignalHandlerId;
|
||||
use gtk4::glib;
|
||||
use gtk4::subclass::prelude::*;
|
||||
use gtk4::DragSource;
|
||||
use gtk4::Box;
|
||||
use gtk4::DropTarget;
|
||||
use gtk4::EventControllerMotion;
|
||||
use gtk4::ListView;
|
||||
use gtk4::Revealer;
|
||||
use gtk4::{gio, glib};
|
||||
use gtk4::{Box, GestureClick};
|
||||
use once_cell::sync::OnceCell;
|
||||
|
||||
use crate::dock_list::DockList;
|
||||
|
||||
// Object holding the state
|
||||
#[derive(Default)]
|
||||
pub struct Window {
|
||||
pub saved_app_list_view: OnceCell<ListView>,
|
||||
pub active_app_list_view: OnceCell<ListView>,
|
||||
pub revealer: OnceCell<Revealer>,
|
||||
pub cursor_handle: OnceCell<Box>,
|
||||
pub saved_app_model: OnceCell<gio::ListStore>,
|
||||
pub active_app_model: OnceCell<gio::ListStore>,
|
||||
pub cursor_motion_controller: OnceCell<EventControllerMotion>,
|
||||
pub saved_click_controller: Rc<OnceCell<GestureClick>>,
|
||||
pub active_click_controller: Rc<OnceCell<GestureClick>>,
|
||||
pub drop_controller: OnceCell<DropTarget>,
|
||||
pub saved_drag_source: Rc<OnceCell<DragSource>>,
|
||||
pub active_drag_source: Rc<OnceCell<DragSource>>,
|
||||
pub saved_drag_end_signal: Rc<RefCell<Option<SignalHandlerId>>>,
|
||||
pub active_drag_end_signal: Rc<RefCell<Option<SignalHandlerId>>>,
|
||||
pub saved_drag_cancel_signal: Rc<RefCell<Option<SignalHandlerId>>>,
|
||||
pub active_drag_cancel_signal: Rc<RefCell<Option<SignalHandlerId>>>,
|
||||
pub window_drop_controller: Rc<OnceCell<DropTarget>>,
|
||||
pub window_drop_controller: OnceCell<DropTarget>,
|
||||
pub saved_list: OnceCell<DockList>,
|
||||
pub active_list: OnceCell<DockList>,
|
||||
}
|
||||
|
||||
// The central trait for subclassing a GObject
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue