diff --git a/rustfmt.toml b/rustfmt.toml index c3c8c37..c1578aa 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1 +1 @@ -imports_granularity = "Crate" +imports_granularity = "Module" diff --git a/src/backend/mock.rs b/src/backend/mock.rs index c65f1ad..084e0e5 100644 --- a/src/backend/mock.rs +++ b/src/backend/mock.rs @@ -1,37 +1,23 @@ // Copyright 2024 System76 // SPDX-License-Identifier: GPL-3.0-only -use cosmic::{ - cctk::{ - cosmic_protocols::{ - toplevel_info::v1::client::zcosmic_toplevel_handle_v1, - toplevel_management::v1::client::zcosmic_toplevel_manager_v1, - workspace::v2::client::zcosmic_workspace_handle_v2, - }, - wayland_client::{ - Connection, WEnum, - protocol::{wl_output, wl_shm}, - }, - wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1, - }, - iced::{ - self, - futures::{FutureExt, SinkExt, executor::block_on}, - }, - iced_winit::platform_specific::wayland::subsurface_widget::{Shmbuf, SubsurfaceBuffer}, -}; +use cosmic::cctk::cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1; +use cosmic::cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1; +use cosmic::cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2; +use cosmic::cctk::wayland_client::protocol::{wl_output, wl_shm}; +use cosmic::cctk::wayland_client::{Connection, WEnum}; +use cosmic::cctk::wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1; +use cosmic::iced::futures::executor::block_on; +use cosmic::iced::futures::{FutureExt, SinkExt}; +use cosmic::iced::{self}; +use cosmic::iced_winit::platform_specific::wayland::subsurface_widget::{Shmbuf, SubsurfaceBuffer}; use futures_channel::mpsc; -use std::{ - collections::HashSet, - fs, - io::{self, Write}, - sync::{ - Arc, - atomic::{AtomicU32, Ordering}, - }, - thread, -}; +use std::collections::HashSet; +use std::io::{self, Write}; +use std::sync::Arc; +use std::sync::atomic::{AtomicU32, Ordering}; +use std::{fs, thread}; use super::{CaptureImage, Cmd, Event}; use crate::utils; diff --git a/src/backend/mod.rs b/src/backend/mod.rs index ff433f5..df83810 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -7,13 +7,9 @@ //! There are two backends: one that uses cosmic-comp protocols, and a mock //! backend for testing without any special protocols. -use cosmic::{ - cctk::{ - cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1, - wayland_client::protocol::wl_output, - }, - iced::platform_specific::shell::subsurface_widget::SubsurfaceBuffer, -}; +use cosmic::cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1; +use cosmic::cctk::wayland_client::protocol::wl_output; +use cosmic::iced::platform_specific::shell::subsurface_widget::SubsurfaceBuffer; use std::collections::HashSet; // Wayland backend using cosmic-comp specific protocols diff --git a/src/backend/wayland/buffer.rs b/src/backend/wayland/buffer.rs index b86f77d..ff38ae3 100644 --- a/src/backend/wayland/buffer.rs +++ b/src/backend/wayland/buffer.rs @@ -1,15 +1,12 @@ -use cctk::{ - screencopy::{Formats, Rect}, - wayland_client::{ - Connection, Dispatch, QueueHandle, - protocol::{wl_buffer, wl_shm, wl_shm_pool}, - }, +use cctk::screencopy::{Formats, Rect}; +use cctk::wayland_client::protocol::{wl_buffer, wl_shm, wl_shm_pool}; +use cctk::wayland_client::{Connection, Dispatch, QueueHandle}; +use cosmic::cctk; +use cosmic::iced::platform_specific::shell::subsurface_widget::{ + BufferSource, Dmabuf, Plane, Shmbuf, }; -use cosmic::{ - cctk, - iced::platform_specific::shell::subsurface_widget::{BufferSource, Dmabuf, Plane, Shmbuf}, -}; -use std::{os::fd::AsFd, sync::Arc}; +use std::os::fd::AsFd; +use std::sync::Arc; use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1; use super::AppData; diff --git a/src/backend/wayland/capture.rs b/src/backend/wayland/capture.rs index 0634bd9..02bdff5 100644 --- a/src/backend/wayland/capture.rs +++ b/src/backend/wayland/capture.rs @@ -1,7 +1,5 @@ -use cctk::{ - screencopy::{CaptureSession, CaptureSource, ScreencopyState}, - wayland_client::QueueHandle, -}; +use cctk::screencopy::{CaptureSession, CaptureSource, ScreencopyState}; +use cctk::wayland_client::QueueHandle; use cosmic::cctk; use std::sync::{Arc, Mutex}; diff --git a/src/backend/wayland/dmabuf.rs b/src/backend/wayland/dmabuf.rs index 5eead73..11fb389 100644 --- a/src/backend/wayland/dmabuf.rs +++ b/src/backend/wayland/dmabuf.rs @@ -1,16 +1,11 @@ -use cctk::{ - sctk::{ - self, - dmabuf::{DmabufFeedback, DmabufHandler, DmabufState}, - }, - wayland_client::{Connection, QueueHandle, protocol::wl_buffer}, -}; +use cctk::sctk::dmabuf::{DmabufFeedback, DmabufHandler, DmabufState}; +use cctk::sctk::{self}; +use cctk::wayland_client::protocol::wl_buffer; +use cctk::wayland_client::{Connection, QueueHandle}; use cosmic::cctk; -use wayland_protocols::wp::linux_dmabuf::zv1::client::{ - zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1, - zwp_linux_dmabuf_feedback_v1::ZwpLinuxDmabufFeedbackV1, -}; +use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1; +use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_dmabuf_feedback_v1::ZwpLinuxDmabufFeedbackV1; use super::AppData; diff --git a/src/backend/wayland/gbm_devices.rs b/src/backend/wayland/gbm_devices.rs index 72de291..a62d9e2 100644 --- a/src/backend/wayland/gbm_devices.rs +++ b/src/backend/wayland/gbm_devices.rs @@ -1,9 +1,7 @@ -use std::{ - collections::hash_map::{self, HashMap}, - fs, io, - os::unix::fs::MetadataExt, - path::{Path, PathBuf}, -}; +use std::collections::hash_map::{self, HashMap}; +use std::os::unix::fs::MetadataExt; +use std::path::{Path, PathBuf}; +use std::{fs, io}; // TODO Purge gbm devices that are no longer needed/valid? #[derive(Default)] diff --git a/src/backend/wayland/mod.rs b/src/backend/wayland/mod.rs index cba466f..937622d 100644 --- a/src/backend/wayland/mod.rs +++ b/src/backend/wayland/mod.rs @@ -2,35 +2,29 @@ // subscription. use calloop_wayland_source::WaylandSource; -use cctk::{ - cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2, - screencopy::{CaptureSource, ScreencopyState}, - sctk::{ - self, - dmabuf::{DmabufFeedback, DmabufState}, - registry::{ProvidesRegistryState, RegistryState}, - seat::{SeatHandler, SeatState}, - shm::{Shm, ShmHandler}, - }, - toplevel_info::ToplevelInfoState, - toplevel_management::ToplevelManagerState, - wayland_client::{ - Connection, Proxy, QueueHandle, globals::registry_queue_init, protocol::wl_seat, - }, - workspace::WorkspaceState, -}; -use cosmic::{ - cctk, - iced::{ - self, - futures::{ - FutureExt, SinkExt, - channel::mpsc, - executor::{ThreadPool, block_on}, - }, - }, -}; -use std::{cell::RefCell, collections::HashMap, hash::Hash, sync::Arc, thread}; +use cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2; +use cctk::screencopy::{CaptureSource, ScreencopyState}; +use cctk::sctk::dmabuf::{DmabufFeedback, DmabufState}; +use cctk::sctk::registry::{ProvidesRegistryState, RegistryState}; +use cctk::sctk::seat::{SeatHandler, SeatState}; +use cctk::sctk::shm::{Shm, ShmHandler}; +use cctk::sctk::{self}; +use cctk::toplevel_info::ToplevelInfoState; +use cctk::toplevel_management::ToplevelManagerState; +use cctk::wayland_client::globals::registry_queue_init; +use cctk::wayland_client::protocol::wl_seat; +use cctk::wayland_client::{Connection, Proxy, QueueHandle}; +use cctk::workspace::WorkspaceState; +use cosmic::cctk; +use cosmic::iced::futures::channel::mpsc; +use cosmic::iced::futures::executor::{ThreadPool, block_on}; +use cosmic::iced::futures::{FutureExt, SinkExt}; +use cosmic::iced::{self}; +use std::cell::RefCell; +use std::collections::HashMap; +use std::hash::Hash; +use std::sync::Arc; +use std::thread; mod buffer; use buffer::Buffer; diff --git a/src/backend/wayland/screencopy.rs b/src/backend/wayland/screencopy.rs index 3438d3b..b9692e0 100644 --- a/src/backend/wayland/screencopy.rs +++ b/src/backend/wayland/screencopy.rs @@ -1,21 +1,15 @@ -use cosmic::{ - cctk::{ - self, - screencopy::{ - CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats, - Frame, ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler, - ScreencopySessionData, ScreencopySessionDataExt, ScreencopyState, - }, - wayland_client::{Connection, QueueHandle, WEnum}, - }, - iced::platform_specific::shell::subsurface_widget::{ - SubsurfaceBuffer, SubsurfaceBufferRelease, - }, +use cosmic::cctk::screencopy::{ + CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats, Frame, + ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler, ScreencopySessionData, + ScreencopySessionDataExt, ScreencopyState, }; -use std::{ - array, - sync::{Arc, Weak}, +use cosmic::cctk::wayland_client::{Connection, QueueHandle, WEnum}; +use cosmic::cctk::{self}; +use cosmic::iced::platform_specific::shell::subsurface_widget::{ + SubsurfaceBuffer, SubsurfaceBufferRelease, }; +use std::array; +use std::sync::{Arc, Weak}; use super::{AppData, Buffer, Capture, CaptureImage, Event}; diff --git a/src/backend/wayland/toplevel.rs b/src/backend/wayland/toplevel.rs index c0fae3e..1bf9cbf 100644 --- a/src/backend/wayland/toplevel.rs +++ b/src/backend/wayland/toplevel.rs @@ -1,9 +1,7 @@ -use cctk::{ - cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1, - toplevel_info::{ToplevelInfoHandler, ToplevelInfoState}, - toplevel_management::{ToplevelManagerHandler, ToplevelManagerState}, - wayland_client::{Connection, QueueHandle, WEnum}, -}; +use cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1; +use cctk::toplevel_info::{ToplevelInfoHandler, ToplevelInfoState}; +use cctk::toplevel_management::{ToplevelManagerHandler, ToplevelManagerState}; +use cctk::wayland_client::{Connection, QueueHandle, WEnum}; use cosmic::cctk; use wayland_protocols::ext::foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1; diff --git a/src/backend/wayland/vulkan.rs b/src/backend/wayland/vulkan.rs index a177452..6a63d7f 100644 --- a/src/backend/wayland/vulkan.rs +++ b/src/backend/wayland/vulkan.rs @@ -1,5 +1,7 @@ -use ash::{prelude::VkResult, vk}; -use std::{collections::HashMap, ffi::CStr}; +use ash::prelude::VkResult; +use ash::vk; +use std::collections::HashMap; +use std::ffi::CStr; pub struct Vulkan { instance: ash::Instance, diff --git a/src/dbus.rs b/src/dbus.rs index 6897bd6..349444c 100644 --- a/src/dbus.rs +++ b/src/dbus.rs @@ -1,5 +1,7 @@ -use cosmic::iced::{self, futures::StreamExt}; -use std::{any::TypeId, hash::Hash}; +use cosmic::iced::futures::StreamExt; +use cosmic::iced::{self}; +use std::any::TypeId; +use std::hash::Hash; use tokio::sync::broadcast; use tokio_stream::wrappers::BroadcastStream; diff --git a/src/dnd.rs b/src/dnd.rs index f3c2ea5..c3d4b9a 100644 --- a/src/dnd.rs +++ b/src/dnd.rs @@ -1,10 +1,10 @@ //! Types related to drag-and-drop -use cosmic::{ - cctk::wayland_client::{Proxy, protocol::wl_output}, - iced::clipboard::mime::AsMimeTypes, -}; -use std::{borrow::Cow, sync::LazyLock}; +use cosmic::cctk::wayland_client::Proxy; +use cosmic::cctk::wayland_client::protocol::wl_output; +use cosmic::iced::clipboard::mime::AsMimeTypes; +use std::borrow::Cow; +use std::sync::LazyLock; use crate::backend::{ExtForeignToplevelHandleV1, ExtWorkspaceHandleV1}; diff --git a/src/localize.rs b/src/localize.rs index 2cf98e6..20250a5 100644 --- a/src/localize.rs +++ b/src/localize.rs @@ -1,10 +1,8 @@ // Copyright 2023 System76 // SPDX-License-Identifier: GPL-3.0-only -use i18n_embed::{ - DefaultLocalizer, LanguageLoader, Localizer, - fluent::{FluentLanguageLoader, fluent_language_loader}, -}; +use i18n_embed::fluent::{FluentLanguageLoader, fluent_language_loader}; +use i18n_embed::{DefaultLocalizer, LanguageLoader, Localizer}; use rust_embed::RustEmbed; use std::sync::LazyLock; diff --git a/src/main.rs b/src/main.rs index 26ac085..5287c8b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,47 +3,38 @@ #![allow(clippy::single_match)] -use cctk::{ - cosmic_protocols::{ - toplevel_management::v1::client::zcosmic_toplevel_manager_v1, - workspace::v2::client::zcosmic_workspace_handle_v2, - }, - sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer}, - wayland_client::{Connection, Proxy, protocol::wl_output}, - wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1, -}; +use cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1; +use cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2; +use cctk::sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer}; +use cctk::wayland_client::protocol::wl_output; +use cctk::wayland_client::{Connection, Proxy}; +use cctk::wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1; use clap::Parser; -use cosmic::{ - app::{Application, CosmicFlags}, - cctk, dbus_activation, - iced::platform_specific::shell::commands::layer_surface::{ - destroy_layer_surface, get_layer_surface, - }, - iced::runtime::platform_specific::wayland::layer_surface::{ - IcedOutput, SctkLayerSurfaceSettings, - }, - iced::window::Id as SurfaceId, - iced::{ - self, Size, Subscription, Task, - clipboard::dnd::{DndEvent, SourceEvent}, - event::wayland::{Event as WaylandEvent, LayerEvent, OutputEvent}, - keyboard::key::{Key, Named}, - mouse::ScrollDelta, - }, - scroll::DiscreteScrollState, +use cosmic::app::{Application, CosmicFlags}; +use cosmic::iced::clipboard::dnd::{DndEvent, SourceEvent}; +use cosmic::iced::event::wayland::{Event as WaylandEvent, LayerEvent, OutputEvent}; +use cosmic::iced::keyboard::key::{Key, Named}; +use cosmic::iced::mouse::ScrollDelta; +use cosmic::iced::platform_specific::shell::commands::layer_surface::{ + destroy_layer_surface, get_layer_surface, }; +use cosmic::iced::runtime::platform_specific::wayland::layer_surface::{ + IcedOutput, SctkLayerSurfaceSettings, +}; +use cosmic::iced::window::Id as SurfaceId; +use cosmic::iced::{self, Size, Subscription, Task}; +use cosmic::scroll::DiscreteScrollState; +use cosmic::{cctk, dbus_activation}; use cosmic_comp_config::CosmicCompConfig; -use cosmic_config::{CosmicConfigEntry, cosmic_config_derive::CosmicConfigEntry}; +use cosmic_config::CosmicConfigEntry; +use cosmic_config::cosmic_config_derive::CosmicConfigEntry; use cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfigEntry, PanelAnchor}; use i18n_embed::DesktopLanguageRequester; -use std::{ - collections::{HashMap, HashSet}, - mem, - path::PathBuf, - process::Command, - str, - time::Duration, -}; +use std::collections::{HashMap, HashSet}; +use std::path::PathBuf; +use std::process::Command; +use std::time::Duration; +use std::{mem, str}; mod dbus; mod desktop_info; diff --git a/src/utils.rs b/src/utils.rs index 9b03a2b..fdf37e2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -1,8 +1,7 @@ -use rustix::{io::Errno, shm}; -use std::{ - os::fd::OwnedFd, - time::{SystemTime, UNIX_EPOCH}, -}; +use rustix::io::Errno; +use rustix::shm; +use std::os::fd::OwnedFd; +use std::time::{SystemTime, UNIX_EPOCH}; #[cfg(target_os = "linux")] fn create_memfd() -> rustix::io::Result { diff --git a/src/view/mod.rs b/src/view/mod.rs index d01e77b..6eee5a7 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -1,34 +1,22 @@ -use cosmic::{ - Apply, - cctk::{ - cosmic_protocols::{ - toplevel_info::v1::client::zcosmic_toplevel_handle_v1, - workspace::v2::client::zcosmic_workspace_handle_v2, - }, - wayland_client::protocol::wl_output, - wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1, - }, - iced::core::{ - Shadow, - text::{Ellipsize, EllipsizeHeightLimit}, - }, - iced::{ - self, Alignment, Border, Length, - advanced::layout::flex::Axis, - clipboard::mime::{AllowedMimeTypes, AsMimeTypes}, - platform_specific::shell::subsurface_widget::Subsurface, - widget::{column, row}, - }, - widget::{self, Widget}, -}; +use cosmic::Apply; +use cosmic::cctk::cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1; +use cosmic::cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2; +use cosmic::cctk::wayland_client::protocol::wl_output; +use cosmic::cctk::wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1; +use cosmic::iced::advanced::layout::flex::Axis; +use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes}; +use cosmic::iced::core::Shadow; +use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit}; +use cosmic::iced::platform_specific::shell::subsurface_widget::Subsurface; +use cosmic::iced::widget::{column, row}; +use cosmic::iced::{self, Alignment, Border, Length}; +use cosmic::widget::{self, Widget}; use cosmic_comp_config::workspace::WorkspaceLayout; use std::collections::HashSet; -use crate::{ - App, LayerSurface, Msg, Toplevel, Workspace, - backend::{self, CaptureImage}, - dnd::{Drag, DragSurface, DragToplevel, DragWorkspace, DropTarget}, -}; +use crate::backend::{self, CaptureImage}; +use crate::dnd::{Drag, DragSurface, DragToplevel, DragWorkspace, DropTarget}; +use crate::{App, LayerSurface, Msg, Toplevel, Workspace}; fn dnd_source_with_drag_surface( drag_content: D, diff --git a/src/widgets/image_bg.rs b/src/widgets/image_bg.rs index 3ced1e6..a6d2f45 100644 --- a/src/widgets/image_bg.rs +++ b/src/widgets/image_bg.rs @@ -1,16 +1,11 @@ // Renders image behind widget, and otherwise passes through all behavior -use cosmic::iced::{ - Length, Rectangle, Size, Vector, - advanced::{ - Clipboard, Layout, Shell, Widget, - layout::{self}, - mouse, overlay, renderer, - widget::{Operation, Tree, tree}, - }, - core::Renderer, - event::Event, -}; +use cosmic::iced::advanced::layout::{self}; +use cosmic::iced::advanced::widget::{Operation, Tree, tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, overlay, renderer}; +use cosmic::iced::core::Renderer; +use cosmic::iced::event::Event; +use cosmic::iced::{Length, Rectangle, Size, Vector}; use std::marker::PhantomData; diff --git a/src/widgets/match_size.rs b/src/widgets/match_size.rs index 957a78b..d5826bc 100644 --- a/src/widgets/match_size.rs +++ b/src/widgets/match_size.rs @@ -1,13 +1,9 @@ //! Show one surface, sized to match the size of another (invisible) widget -use cosmic::iced::{ - Length, Rectangle, Size, - advanced::{ - Clipboard, Layout, Shell, Widget, layout, mouse, renderer, - widget::{Operation, Tree}, - }, - event::{self, Event}, -}; +use cosmic::iced::advanced::widget::{Operation, Tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, renderer}; +use cosmic::iced::event::{self, Event}; +use cosmic::iced::{Length, Rectangle, Size}; use std::marker::PhantomData; pub fn match_size< diff --git a/src/widgets/mod.rs b/src/widgets/mod.rs index 9354518..f9d44ec 100644 --- a/src/widgets/mod.rs +++ b/src/widgets/mod.rs @@ -1,11 +1,7 @@ -use cosmic::iced::{ - Length, Rectangle, Size, Vector, - advanced::{ - Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer, - widget::{Id, Operation, Tree, tree}, - }, - event::{self, Event}, -}; +use cosmic::iced::advanced::widget::{Id, Operation, Tree, tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer}; +use cosmic::iced::event::{self, Event}; +use cosmic::iced::{Length, Rectangle, Size, Vector}; use std::marker::PhantomData; mod image_bg; diff --git a/src/widgets/mouse_interaction_wrapper.rs b/src/widgets/mouse_interaction_wrapper.rs index ea7d4ad..05239e6 100644 --- a/src/widgets/mouse_interaction_wrapper.rs +++ b/src/widgets/mouse_interaction_wrapper.rs @@ -1,11 +1,7 @@ -use cosmic::iced::{ - Length, Rectangle, Size, Vector, - advanced::{ - Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer, - widget::{Id, Operation, Tree, tree}, - }, - event::{self, Event}, -}; +use cosmic::iced::advanced::widget::{Id, Operation, Tree, tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer}; +use cosmic::iced::event::{self, Event}; +use cosmic::iced::{Length, Rectangle, Size, Vector}; use std::marker::PhantomData; diff --git a/src/widgets/size_cross_nth.rs b/src/widgets/size_cross_nth.rs index 94c8ca5..9b33e7f 100644 --- a/src/widgets/size_cross_nth.rs +++ b/src/widgets/size_cross_nth.rs @@ -1,15 +1,11 @@ // This widget defines it's cross axis size as the `index`th child's size -use cosmic::iced::{ - Length, Point, Rectangle, Size, - advanced::{ - Clipboard, Layout, Shell, Widget, - layout::{self, flex::Axis}, - mouse, renderer, - widget::{Operation, Tree}, - }, - event::{self, Event}, -}; +use cosmic::iced::advanced::layout::flex::Axis; +use cosmic::iced::advanced::layout::{self}; +use cosmic::iced::advanced::widget::{Operation, Tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, renderer}; +use cosmic::iced::event::{self, Event}; +use cosmic::iced::{Length, Point, Rectangle, Size}; use std::marker::PhantomData; // Duplicate of private methods diff --git a/src/widgets/toplevels/mod.rs b/src/widgets/toplevels/mod.rs index 8921e05..2156d7d 100644 --- a/src/widgets/toplevels/mod.rs +++ b/src/widgets/toplevels/mod.rs @@ -1,13 +1,9 @@ -use cosmic::iced::{ - Length, Rectangle, Size, Vector, - advanced::{ - Clipboard, Layout, Shell, Widget, - layout::{self, flex::Axis}, - mouse, renderer, - widget::{Operation, Tree}, - }, - event::{self, Event}, -}; +use cosmic::iced::advanced::layout::flex::Axis; +use cosmic::iced::advanced::layout::{self}; +use cosmic::iced::advanced::widget::{Operation, Tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, renderer}; +use cosmic::iced::event::{self, Event}; +use cosmic::iced::{Length, Rectangle, Size, Vector}; use std::marker::PhantomData; mod toplevel_layout; diff --git a/src/widgets/toplevels/toplevel_layout/axis_toplevel_layout.rs b/src/widgets/toplevels/toplevel_layout/axis_toplevel_layout.rs index 4338703..89733d1 100644 --- a/src/widgets/toplevels/toplevel_layout/axis_toplevel_layout.rs +++ b/src/widgets/toplevels/toplevel_layout/axis_toplevel_layout.rs @@ -1,5 +1,6 @@ use aliasable::vec::AliasableVec; -use cosmic::iced::{Length, Point, Rectangle, Size, advanced::layout::flex::Axis}; +use cosmic::iced::advanced::layout::flex::Axis; +use cosmic::iced::{Length, Point, Rectangle, Size}; use std::marker::PhantomData; use super::{LayoutToplevel, ToplevelLayout}; diff --git a/src/widgets/toplevels/toplevel_layout/row_col_toplevel_layout.rs b/src/widgets/toplevels/toplevel_layout/row_col_toplevel_layout.rs index 659ce4a..f1c8b2e 100644 --- a/src/widgets/toplevels/toplevel_layout/row_col_toplevel_layout.rs +++ b/src/widgets/toplevels/toplevel_layout/row_col_toplevel_layout.rs @@ -1,9 +1,8 @@ -use cosmic::iced::{Length, advanced::layout::flex::Axis}; +use cosmic::iced::Length; +use cosmic::iced::advanced::layout::flex::Axis; -use super::{ - LayoutToplevel, - axis_toplevel_layout::{AxisPoint, AxisRectangle, AxisSize, AxisToplevelLayout}, -}; +use super::LayoutToplevel; +use super::axis_toplevel_layout::{AxisPoint, AxisRectangle, AxisSize, AxisToplevelLayout}; pub(crate) struct RowColToplevelLayout { pub axis: Axis, diff --git a/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs b/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs index 6d653af..1341410 100644 --- a/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs +++ b/src/widgets/toplevels/toplevel_layout/two_row_col_toplevel_layout.rs @@ -1,10 +1,9 @@ -use cosmic::iced::{Length, advanced::layout::flex::Axis}; +use cosmic::iced::Length; +use cosmic::iced::advanced::layout::flex::Axis; -use super::{ - LayoutToplevel, - axis_toplevel_layout::{AxisRectangle, AxisSize, AxisToplevelLayout}, - row_col_toplevel_layout::RowColToplevelLayout, -}; +use super::LayoutToplevel; +use super::axis_toplevel_layout::{AxisRectangle, AxisSize, AxisToplevelLayout}; +use super::row_col_toplevel_layout::RowColToplevelLayout; pub(crate) struct TwoRowColToplevelLayout(RowColToplevelLayout); diff --git a/src/widgets/visibility_wrapper.rs b/src/widgets/visibility_wrapper.rs index f74c832..dd79774 100644 --- a/src/widgets/visibility_wrapper.rs +++ b/src/widgets/visibility_wrapper.rs @@ -1,14 +1,10 @@ //! If `visible` is set to `true`, behaves exactly as wrapped widget. If `false`, //! takes the same space but does not draw. -use cosmic::iced::{ - Length, Rectangle, Size, - advanced::{ - Clipboard, Layout, Shell, Widget, layout, mouse, renderer, - widget::{Operation, Tree}, - }, - event::{self, Event}, -}; +use cosmic::iced::advanced::widget::{Operation, Tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, renderer}; +use cosmic::iced::event::{self, Event}; +use cosmic::iced::{Length, Rectangle, Size}; use std::marker::PhantomData; pub fn visibility_wrapper<'a, Msg, T: Into>>( diff --git a/src/widgets/workspace_bar.rs b/src/widgets/workspace_bar.rs index 078d192..d6164bb 100644 --- a/src/widgets/workspace_bar.rs +++ b/src/widgets/workspace_bar.rs @@ -1,17 +1,13 @@ // Custom varian of row/column // Gives each child widget a maximum size on main axis of total/n -use cosmic::iced::{ - Length, Point, Rectangle, Size, - advanced::{ - Clipboard, Layout, Shell, Widget, - layout::{self, flex::Axis}, - mouse, renderer, - widget::{Operation, Tree}, - }, - core::clipboard::DndDestinationRectangles, - event::{self, Event}, -}; +use cosmic::iced::advanced::layout::flex::Axis; +use cosmic::iced::advanced::layout::{self}; +use cosmic::iced::advanced::widget::{Operation, Tree}; +use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, renderer}; +use cosmic::iced::core::clipboard::DndDestinationRectangles; +use cosmic::iced::event::{self, Event}; +use cosmic::iced::{Length, Point, Rectangle, Size}; use std::marker::PhantomData; // Duplicate of private methods