chore: apply rustfmt config with module import granulatiry
This commit is contained in:
parent
2b9906f941
commit
2acf6f9f14
28 changed files with 190 additions and 288 deletions
|
|
@ -1 +1 @@
|
||||||
imports_granularity = "Crate"
|
imports_granularity = "Module"
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,23 @@
|
||||||
// Copyright 2024 System76 <info@system76.com>
|
// Copyright 2024 System76 <info@system76.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::cctk::cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1;
|
||||||
cctk::{
|
use cosmic::cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1;
|
||||||
cosmic_protocols::{
|
use cosmic::cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2;
|
||||||
toplevel_info::v1::client::zcosmic_toplevel_handle_v1,
|
use cosmic::cctk::wayland_client::protocol::{wl_output, wl_shm};
|
||||||
toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
|
use cosmic::cctk::wayland_client::{Connection, WEnum};
|
||||||
workspace::v2::client::zcosmic_workspace_handle_v2,
|
use cosmic::cctk::wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1;
|
||||||
},
|
use cosmic::iced::futures::executor::block_on;
|
||||||
wayland_client::{
|
use cosmic::iced::futures::{FutureExt, SinkExt};
|
||||||
Connection, WEnum,
|
use cosmic::iced::{self};
|
||||||
protocol::{wl_output, wl_shm},
|
use cosmic::iced_winit::platform_specific::wayland::subsurface_widget::{Shmbuf, SubsurfaceBuffer};
|
||||||
},
|
|
||||||
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 futures_channel::mpsc;
|
use futures_channel::mpsc;
|
||||||
use std::{
|
use std::collections::HashSet;
|
||||||
collections::HashSet,
|
use std::io::{self, Write};
|
||||||
fs,
|
use std::sync::Arc;
|
||||||
io::{self, Write},
|
use std::sync::atomic::{AtomicU32, Ordering};
|
||||||
sync::{
|
use std::{fs, thread};
|
||||||
Arc,
|
|
||||||
atomic::{AtomicU32, Ordering},
|
|
||||||
},
|
|
||||||
thread,
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::{CaptureImage, Cmd, Event};
|
use super::{CaptureImage, Cmd, Event};
|
||||||
use crate::utils;
|
use crate::utils;
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,9 @@
|
||||||
//! There are two backends: one that uses cosmic-comp protocols, and a mock
|
//! There are two backends: one that uses cosmic-comp protocols, and a mock
|
||||||
//! backend for testing without any special protocols.
|
//! backend for testing without any special protocols.
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1;
|
||||||
cctk::{
|
use cosmic::cctk::wayland_client::protocol::wl_output;
|
||||||
cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
|
use cosmic::iced::platform_specific::shell::subsurface_widget::SubsurfaceBuffer;
|
||||||
wayland_client::protocol::wl_output,
|
|
||||||
},
|
|
||||||
iced::platform_specific::shell::subsurface_widget::SubsurfaceBuffer,
|
|
||||||
};
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
// Wayland backend using cosmic-comp specific protocols
|
// Wayland backend using cosmic-comp specific protocols
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
use cctk::{
|
use cctk::screencopy::{Formats, Rect};
|
||||||
screencopy::{Formats, Rect},
|
use cctk::wayland_client::protocol::{wl_buffer, wl_shm, wl_shm_pool};
|
||||||
wayland_client::{
|
use cctk::wayland_client::{Connection, Dispatch, QueueHandle};
|
||||||
Connection, Dispatch, QueueHandle,
|
use cosmic::cctk;
|
||||||
protocol::{wl_buffer, wl_shm, wl_shm_pool},
|
use cosmic::iced::platform_specific::shell::subsurface_widget::{
|
||||||
},
|
BufferSource, Dmabuf, Plane, Shmbuf,
|
||||||
};
|
};
|
||||||
use cosmic::{
|
use std::os::fd::AsFd;
|
||||||
cctk,
|
use std::sync::Arc;
|
||||||
iced::platform_specific::shell::subsurface_widget::{BufferSource, Dmabuf, Plane, Shmbuf},
|
|
||||||
};
|
|
||||||
use std::{os::fd::AsFd, sync::Arc};
|
|
||||||
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1;
|
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1;
|
||||||
|
|
||||||
use super::AppData;
|
use super::AppData;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
use cctk::{
|
use cctk::screencopy::{CaptureSession, CaptureSource, ScreencopyState};
|
||||||
screencopy::{CaptureSession, CaptureSource, ScreencopyState},
|
use cctk::wayland_client::QueueHandle;
|
||||||
wayland_client::QueueHandle,
|
|
||||||
};
|
|
||||||
use cosmic::cctk;
|
use cosmic::cctk;
|
||||||
|
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
use cctk::{
|
use cctk::sctk::dmabuf::{DmabufFeedback, DmabufHandler, DmabufState};
|
||||||
sctk::{
|
use cctk::sctk::{self};
|
||||||
self,
|
use cctk::wayland_client::protocol::wl_buffer;
|
||||||
dmabuf::{DmabufFeedback, DmabufHandler, DmabufState},
|
use cctk::wayland_client::{Connection, QueueHandle};
|
||||||
},
|
|
||||||
wayland_client::{Connection, QueueHandle, protocol::wl_buffer},
|
|
||||||
};
|
|
||||||
use cosmic::cctk;
|
use cosmic::cctk;
|
||||||
|
|
||||||
use wayland_protocols::wp::linux_dmabuf::zv1::client::{
|
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1;
|
||||||
zwp_linux_buffer_params_v1::ZwpLinuxBufferParamsV1,
|
use wayland_protocols::wp::linux_dmabuf::zv1::client::zwp_linux_dmabuf_feedback_v1::ZwpLinuxDmabufFeedbackV1;
|
||||||
zwp_linux_dmabuf_feedback_v1::ZwpLinuxDmabufFeedbackV1,
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::AppData;
|
use super::AppData;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
use std::{
|
use std::collections::hash_map::{self, HashMap};
|
||||||
collections::hash_map::{self, HashMap},
|
use std::os::unix::fs::MetadataExt;
|
||||||
fs, io,
|
use std::path::{Path, PathBuf};
|
||||||
os::unix::fs::MetadataExt,
|
use std::{fs, io};
|
||||||
path::{Path, PathBuf},
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO Purge gbm devices that are no longer needed/valid?
|
// TODO Purge gbm devices that are no longer needed/valid?
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|
|
||||||
|
|
@ -2,35 +2,29 @@
|
||||||
// subscription.
|
// subscription.
|
||||||
|
|
||||||
use calloop_wayland_source::WaylandSource;
|
use calloop_wayland_source::WaylandSource;
|
||||||
use cctk::{
|
use cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2;
|
||||||
cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2,
|
use cctk::screencopy::{CaptureSource, ScreencopyState};
|
||||||
screencopy::{CaptureSource, ScreencopyState},
|
use cctk::sctk::dmabuf::{DmabufFeedback, DmabufState};
|
||||||
sctk::{
|
use cctk::sctk::registry::{ProvidesRegistryState, RegistryState};
|
||||||
self,
|
use cctk::sctk::seat::{SeatHandler, SeatState};
|
||||||
dmabuf::{DmabufFeedback, DmabufState},
|
use cctk::sctk::shm::{Shm, ShmHandler};
|
||||||
registry::{ProvidesRegistryState, RegistryState},
|
use cctk::sctk::{self};
|
||||||
seat::{SeatHandler, SeatState},
|
use cctk::toplevel_info::ToplevelInfoState;
|
||||||
shm::{Shm, ShmHandler},
|
use cctk::toplevel_management::ToplevelManagerState;
|
||||||
},
|
use cctk::wayland_client::globals::registry_queue_init;
|
||||||
toplevel_info::ToplevelInfoState,
|
use cctk::wayland_client::protocol::wl_seat;
|
||||||
toplevel_management::ToplevelManagerState,
|
use cctk::wayland_client::{Connection, Proxy, QueueHandle};
|
||||||
wayland_client::{
|
use cctk::workspace::WorkspaceState;
|
||||||
Connection, Proxy, QueueHandle, globals::registry_queue_init, protocol::wl_seat,
|
use cosmic::cctk;
|
||||||
},
|
use cosmic::iced::futures::channel::mpsc;
|
||||||
workspace::WorkspaceState,
|
use cosmic::iced::futures::executor::{ThreadPool, block_on};
|
||||||
};
|
use cosmic::iced::futures::{FutureExt, SinkExt};
|
||||||
use cosmic::{
|
use cosmic::iced::{self};
|
||||||
cctk,
|
use std::cell::RefCell;
|
||||||
iced::{
|
use std::collections::HashMap;
|
||||||
self,
|
use std::hash::Hash;
|
||||||
futures::{
|
use std::sync::Arc;
|
||||||
FutureExt, SinkExt,
|
use std::thread;
|
||||||
channel::mpsc,
|
|
||||||
executor::{ThreadPool, block_on},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
use std::{cell::RefCell, collections::HashMap, hash::Hash, sync::Arc, thread};
|
|
||||||
|
|
||||||
mod buffer;
|
mod buffer;
|
||||||
use buffer::Buffer;
|
use buffer::Buffer;
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,15 @@
|
||||||
use cosmic::{
|
use cosmic::cctk::screencopy::{
|
||||||
cctk::{
|
CaptureFrame, CaptureOptions, CaptureSession, CaptureSource, FailureReason, Formats, Frame,
|
||||||
self,
|
ScreencopyFrameData, ScreencopyFrameDataExt, ScreencopyHandler, ScreencopySessionData,
|
||||||
screencopy::{
|
ScreencopySessionDataExt, ScreencopyState,
|
||||||
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 std::{
|
use cosmic::cctk::wayland_client::{Connection, QueueHandle, WEnum};
|
||||||
array,
|
use cosmic::cctk::{self};
|
||||||
sync::{Arc, Weak},
|
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};
|
use super::{AppData, Buffer, Capture, CaptureImage, Event};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
use cctk::{
|
use cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1;
|
||||||
cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
|
use cctk::toplevel_info::{ToplevelInfoHandler, ToplevelInfoState};
|
||||||
toplevel_info::{ToplevelInfoHandler, ToplevelInfoState},
|
use cctk::toplevel_management::{ToplevelManagerHandler, ToplevelManagerState};
|
||||||
toplevel_management::{ToplevelManagerHandler, ToplevelManagerState},
|
use cctk::wayland_client::{Connection, QueueHandle, WEnum};
|
||||||
wayland_client::{Connection, QueueHandle, WEnum},
|
|
||||||
};
|
|
||||||
use cosmic::cctk;
|
use cosmic::cctk;
|
||||||
use wayland_protocols::ext::foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1;
|
use wayland_protocols::ext::foreign_toplevel_list::v1::client::ext_foreign_toplevel_handle_v1::ExtForeignToplevelHandleV1;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
use ash::{prelude::VkResult, vk};
|
use ash::prelude::VkResult;
|
||||||
use std::{collections::HashMap, ffi::CStr};
|
use ash::vk;
|
||||||
|
use std::collections::HashMap;
|
||||||
|
use std::ffi::CStr;
|
||||||
|
|
||||||
pub struct Vulkan {
|
pub struct Vulkan {
|
||||||
instance: ash::Instance,
|
instance: ash::Instance,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
use cosmic::iced::{self, futures::StreamExt};
|
use cosmic::iced::futures::StreamExt;
|
||||||
use std::{any::TypeId, hash::Hash};
|
use cosmic::iced::{self};
|
||||||
|
use std::any::TypeId;
|
||||||
|
use std::hash::Hash;
|
||||||
use tokio::sync::broadcast;
|
use tokio::sync::broadcast;
|
||||||
use tokio_stream::wrappers::BroadcastStream;
|
use tokio_stream::wrappers::BroadcastStream;
|
||||||
|
|
||||||
|
|
|
||||||
10
src/dnd.rs
10
src/dnd.rs
|
|
@ -1,10 +1,10 @@
|
||||||
//! Types related to drag-and-drop
|
//! Types related to drag-and-drop
|
||||||
|
|
||||||
use cosmic::{
|
use cosmic::cctk::wayland_client::Proxy;
|
||||||
cctk::wayland_client::{Proxy, protocol::wl_output},
|
use cosmic::cctk::wayland_client::protocol::wl_output;
|
||||||
iced::clipboard::mime::AsMimeTypes,
|
use cosmic::iced::clipboard::mime::AsMimeTypes;
|
||||||
};
|
use std::borrow::Cow;
|
||||||
use std::{borrow::Cow, sync::LazyLock};
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
use crate::backend::{ExtForeignToplevelHandleV1, ExtWorkspaceHandleV1};
|
use crate::backend::{ExtForeignToplevelHandleV1, ExtWorkspaceHandleV1};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
// Copyright 2023 System76 <info@system76.com>
|
// Copyright 2023 System76 <info@system76.com>
|
||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
use i18n_embed::{
|
use i18n_embed::fluent::{FluentLanguageLoader, fluent_language_loader};
|
||||||
DefaultLocalizer, LanguageLoader, Localizer,
|
use i18n_embed::{DefaultLocalizer, LanguageLoader, Localizer};
|
||||||
fluent::{FluentLanguageLoader, fluent_language_loader},
|
|
||||||
};
|
|
||||||
use rust_embed::RustEmbed;
|
use rust_embed::RustEmbed;
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
|
|
||||||
|
|
|
||||||
63
src/main.rs
63
src/main.rs
|
|
@ -3,47 +3,38 @@
|
||||||
|
|
||||||
#![allow(clippy::single_match)]
|
#![allow(clippy::single_match)]
|
||||||
|
|
||||||
use cctk::{
|
use cctk::cosmic_protocols::toplevel_management::v1::client::zcosmic_toplevel_manager_v1;
|
||||||
cosmic_protocols::{
|
use cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2;
|
||||||
toplevel_management::v1::client::zcosmic_toplevel_manager_v1,
|
use cctk::sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer};
|
||||||
workspace::v2::client::zcosmic_workspace_handle_v2,
|
use cctk::wayland_client::protocol::wl_output;
|
||||||
},
|
use cctk::wayland_client::{Connection, Proxy};
|
||||||
sctk::shell::wlr_layer::{Anchor, KeyboardInteractivity, Layer},
|
use cctk::wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1;
|
||||||
wayland_client::{Connection, Proxy, protocol::wl_output},
|
|
||||||
wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1,
|
|
||||||
};
|
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
use cosmic::{
|
use cosmic::app::{Application, CosmicFlags};
|
||||||
app::{Application, CosmicFlags},
|
use cosmic::iced::clipboard::dnd::{DndEvent, SourceEvent};
|
||||||
cctk, dbus_activation,
|
use cosmic::iced::event::wayland::{Event as WaylandEvent, LayerEvent, OutputEvent};
|
||||||
iced::platform_specific::shell::commands::layer_surface::{
|
use cosmic::iced::keyboard::key::{Key, Named};
|
||||||
destroy_layer_surface, get_layer_surface,
|
use cosmic::iced::mouse::ScrollDelta;
|
||||||
},
|
use cosmic::iced::platform_specific::shell::commands::layer_surface::{
|
||||||
iced::runtime::platform_specific::wayland::layer_surface::{
|
destroy_layer_surface, get_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::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_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 cosmic_panel_config::{CosmicPanelConfig, CosmicPanelContainerConfigEntry, PanelAnchor};
|
||||||
use i18n_embed::DesktopLanguageRequester;
|
use i18n_embed::DesktopLanguageRequester;
|
||||||
use std::{
|
use std::collections::{HashMap, HashSet};
|
||||||
collections::{HashMap, HashSet},
|
use std::path::PathBuf;
|
||||||
mem,
|
use std::process::Command;
|
||||||
path::PathBuf,
|
use std::time::Duration;
|
||||||
process::Command,
|
use std::{mem, str};
|
||||||
str,
|
|
||||||
time::Duration,
|
|
||||||
};
|
|
||||||
|
|
||||||
mod dbus;
|
mod dbus;
|
||||||
mod desktop_info;
|
mod desktop_info;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,7 @@
|
||||||
use rustix::{io::Errno, shm};
|
use rustix::io::Errno;
|
||||||
use std::{
|
use rustix::shm;
|
||||||
os::fd::OwnedFd,
|
use std::os::fd::OwnedFd;
|
||||||
time::{SystemTime, UNIX_EPOCH},
|
use std::time::{SystemTime, UNIX_EPOCH};
|
||||||
};
|
|
||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
fn create_memfd() -> rustix::io::Result<OwnedFd> {
|
fn create_memfd() -> rustix::io::Result<OwnedFd> {
|
||||||
|
|
|
||||||
|
|
@ -1,34 +1,22 @@
|
||||||
use cosmic::{
|
use cosmic::Apply;
|
||||||
Apply,
|
use cosmic::cctk::cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1;
|
||||||
cctk::{
|
use cosmic::cctk::cosmic_protocols::workspace::v2::client::zcosmic_workspace_handle_v2;
|
||||||
cosmic_protocols::{
|
use cosmic::cctk::wayland_client::protocol::wl_output;
|
||||||
toplevel_info::v1::client::zcosmic_toplevel_handle_v1,
|
use cosmic::cctk::wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1;
|
||||||
workspace::v2::client::zcosmic_workspace_handle_v2,
|
use cosmic::iced::advanced::layout::flex::Axis;
|
||||||
},
|
use cosmic::iced::clipboard::mime::{AllowedMimeTypes, AsMimeTypes};
|
||||||
wayland_client::protocol::wl_output,
|
use cosmic::iced::core::Shadow;
|
||||||
wayland_protocols::ext::workspace::v1::client::ext_workspace_handle_v1,
|
use cosmic::iced::core::text::{Ellipsize, EllipsizeHeightLimit};
|
||||||
},
|
use cosmic::iced::platform_specific::shell::subsurface_widget::Subsurface;
|
||||||
iced::core::{
|
use cosmic::iced::widget::{column, row};
|
||||||
Shadow,
|
use cosmic::iced::{self, Alignment, Border, Length};
|
||||||
text::{Ellipsize, EllipsizeHeightLimit},
|
use cosmic::widget::{self, Widget};
|
||||||
},
|
|
||||||
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_comp_config::workspace::WorkspaceLayout;
|
use cosmic_comp_config::workspace::WorkspaceLayout;
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
||||||
use crate::{
|
use crate::backend::{self, CaptureImage};
|
||||||
App, LayerSurface, Msg, Toplevel, Workspace,
|
use crate::dnd::{Drag, DragSurface, DragToplevel, DragWorkspace, DropTarget};
|
||||||
backend::{self, CaptureImage},
|
use crate::{App, LayerSurface, Msg, Toplevel, Workspace};
|
||||||
dnd::{Drag, DragSurface, DragToplevel, DragWorkspace, DropTarget},
|
|
||||||
};
|
|
||||||
|
|
||||||
fn dnd_source_with_drag_surface<D: AsMimeTypes + Send + Clone + 'static>(
|
fn dnd_source_with_drag_surface<D: AsMimeTypes + Send + Clone + 'static>(
|
||||||
drag_content: D,
|
drag_content: D,
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
// Renders image behind widget, and otherwise passes through all behavior
|
// Renders image behind widget, and otherwise passes through all behavior
|
||||||
|
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::layout::{self};
|
||||||
Length, Rectangle, Size, Vector,
|
use cosmic::iced::advanced::widget::{Operation, Tree, tree};
|
||||||
advanced::{
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, overlay, renderer};
|
||||||
Clipboard, Layout, Shell, Widget,
|
use cosmic::iced::core::Renderer;
|
||||||
layout::{self},
|
use cosmic::iced::event::Event;
|
||||||
mouse, overlay, renderer,
|
use cosmic::iced::{Length, Rectangle, Size, Vector};
|
||||||
widget::{Operation, Tree, tree},
|
|
||||||
},
|
|
||||||
core::Renderer,
|
|
||||||
event::Event,
|
|
||||||
};
|
|
||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
//! Show one surface, sized to match the size of another (invisible) widget
|
//! Show one surface, sized to match the size of another (invisible) widget
|
||||||
|
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::widget::{Operation, Tree};
|
||||||
Length, Rectangle, Size,
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, renderer};
|
||||||
advanced::{
|
use cosmic::iced::event::{self, Event};
|
||||||
Clipboard, Layout, Shell, Widget, layout, mouse, renderer,
|
use cosmic::iced::{Length, Rectangle, Size};
|
||||||
widget::{Operation, Tree},
|
|
||||||
},
|
|
||||||
event::{self, Event},
|
|
||||||
};
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
pub fn match_size<
|
pub fn match_size<
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::widget::{Id, Operation, Tree, tree};
|
||||||
Length, Rectangle, Size, Vector,
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer};
|
||||||
advanced::{
|
use cosmic::iced::event::{self, Event};
|
||||||
Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer,
|
use cosmic::iced::{Length, Rectangle, Size, Vector};
|
||||||
widget::{Id, Operation, Tree, tree},
|
|
||||||
},
|
|
||||||
event::{self, Event},
|
|
||||||
};
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
mod image_bg;
|
mod image_bg;
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,7 @@
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::widget::{Id, Operation, Tree, tree};
|
||||||
Length, Rectangle, Size, Vector,
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer};
|
||||||
advanced::{
|
use cosmic::iced::event::{self, Event};
|
||||||
Clipboard, Layout, Shell, Widget, layout, mouse, overlay, renderer,
|
use cosmic::iced::{Length, Rectangle, Size, Vector};
|
||||||
widget::{Id, Operation, Tree, tree},
|
|
||||||
},
|
|
||||||
event::{self, Event},
|
|
||||||
};
|
|
||||||
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,11 @@
|
||||||
// This widget defines it's cross axis size as the `index`th child's size
|
// This widget defines it's cross axis size as the `index`th child's size
|
||||||
|
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::layout::flex::Axis;
|
||||||
Length, Point, Rectangle, Size,
|
use cosmic::iced::advanced::layout::{self};
|
||||||
advanced::{
|
use cosmic::iced::advanced::widget::{Operation, Tree};
|
||||||
Clipboard, Layout, Shell, Widget,
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, renderer};
|
||||||
layout::{self, flex::Axis},
|
use cosmic::iced::event::{self, Event};
|
||||||
mouse, renderer,
|
use cosmic::iced::{Length, Point, Rectangle, Size};
|
||||||
widget::{Operation, Tree},
|
|
||||||
},
|
|
||||||
event::{self, Event},
|
|
||||||
};
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
// Duplicate of private methods
|
// Duplicate of private methods
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::layout::flex::Axis;
|
||||||
Length, Rectangle, Size, Vector,
|
use cosmic::iced::advanced::layout::{self};
|
||||||
advanced::{
|
use cosmic::iced::advanced::widget::{Operation, Tree};
|
||||||
Clipboard, Layout, Shell, Widget,
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, renderer};
|
||||||
layout::{self, flex::Axis},
|
use cosmic::iced::event::{self, Event};
|
||||||
mouse, renderer,
|
use cosmic::iced::{Length, Rectangle, Size, Vector};
|
||||||
widget::{Operation, Tree},
|
|
||||||
},
|
|
||||||
event::{self, Event},
|
|
||||||
};
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
mod toplevel_layout;
|
mod toplevel_layout;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
use aliasable::vec::AliasableVec;
|
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 std::marker::PhantomData;
|
||||||
|
|
||||||
use super::{LayoutToplevel, ToplevelLayout};
|
use super::{LayoutToplevel, ToplevelLayout};
|
||||||
|
|
|
||||||
|
|
@ -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::{
|
use super::LayoutToplevel;
|
||||||
LayoutToplevel,
|
use super::axis_toplevel_layout::{AxisPoint, AxisRectangle, AxisSize, AxisToplevelLayout};
|
||||||
axis_toplevel_layout::{AxisPoint, AxisRectangle, AxisSize, AxisToplevelLayout},
|
|
||||||
};
|
|
||||||
|
|
||||||
pub(crate) struct RowColToplevelLayout {
|
pub(crate) struct RowColToplevelLayout {
|
||||||
pub axis: Axis,
|
pub axis: Axis,
|
||||||
|
|
|
||||||
|
|
@ -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::{
|
use super::LayoutToplevel;
|
||||||
LayoutToplevel,
|
use super::axis_toplevel_layout::{AxisRectangle, AxisSize, AxisToplevelLayout};
|
||||||
axis_toplevel_layout::{AxisRectangle, AxisSize, AxisToplevelLayout},
|
use super::row_col_toplevel_layout::RowColToplevelLayout;
|
||||||
row_col_toplevel_layout::RowColToplevelLayout,
|
|
||||||
};
|
|
||||||
|
|
||||||
pub(crate) struct TwoRowColToplevelLayout(RowColToplevelLayout);
|
pub(crate) struct TwoRowColToplevelLayout(RowColToplevelLayout);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
||||||
//! If `visible` is set to `true`, behaves exactly as wrapped widget. If `false`,
|
//! If `visible` is set to `true`, behaves exactly as wrapped widget. If `false`,
|
||||||
//! takes the same space but does not draw.
|
//! takes the same space but does not draw.
|
||||||
|
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::widget::{Operation, Tree};
|
||||||
Length, Rectangle, Size,
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, layout, mouse, renderer};
|
||||||
advanced::{
|
use cosmic::iced::event::{self, Event};
|
||||||
Clipboard, Layout, Shell, Widget, layout, mouse, renderer,
|
use cosmic::iced::{Length, Rectangle, Size};
|
||||||
widget::{Operation, Tree},
|
|
||||||
},
|
|
||||||
event::{self, Event},
|
|
||||||
};
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
pub fn visibility_wrapper<'a, Msg, T: Into<cosmic::Element<'a, Msg>>>(
|
pub fn visibility_wrapper<'a, Msg, T: Into<cosmic::Element<'a, Msg>>>(
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,13 @@
|
||||||
// Custom varian of row/column
|
// Custom varian of row/column
|
||||||
// Gives each child widget a maximum size on main axis of total/n
|
// Gives each child widget a maximum size on main axis of total/n
|
||||||
|
|
||||||
use cosmic::iced::{
|
use cosmic::iced::advanced::layout::flex::Axis;
|
||||||
Length, Point, Rectangle, Size,
|
use cosmic::iced::advanced::layout::{self};
|
||||||
advanced::{
|
use cosmic::iced::advanced::widget::{Operation, Tree};
|
||||||
Clipboard, Layout, Shell, Widget,
|
use cosmic::iced::advanced::{Clipboard, Layout, Shell, Widget, mouse, renderer};
|
||||||
layout::{self, flex::Axis},
|
use cosmic::iced::core::clipboard::DndDestinationRectangles;
|
||||||
mouse, renderer,
|
use cosmic::iced::event::{self, Event};
|
||||||
widget::{Operation, Tree},
|
use cosmic::iced::{Length, Point, Rectangle, Size};
|
||||||
},
|
|
||||||
core::clipboard::DndDestinationRectangles,
|
|
||||||
event::{self, Event},
|
|
||||||
};
|
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
|
|
||||||
// Duplicate of private methods
|
// Duplicate of private methods
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue