chore(app-list): merge imports

This commit is contained in:
Vukašin Vojinović 2024-07-01 00:35:23 +02:00 committed by Michael Murphy
parent fb9874223a
commit f9607b3686
3 changed files with 65 additions and 50 deletions

View file

@ -1,57 +1,68 @@
// 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 crate::config; use crate::{
use crate::config::{AppListConfig, APP_ID}; config,
use crate::fl; config::{AppListConfig, APP_ID},
use crate::wayland_subscription::{ fl,
wayland_subscription, OutputUpdate, ToplevelRequest, ToplevelUpdate, WaylandImage, wayland_subscription::{
WaylandRequest, WaylandUpdate, wayland_subscription, OutputUpdate, ToplevelRequest, ToplevelUpdate, WaylandImage,
WaylandRequest, WaylandUpdate,
},
}; };
use cctk::sctk::output::OutputInfo; use cctk::{
use cctk::sctk::reexports::calloop::channel::Sender; sctk::{output::OutputInfo, reexports::calloop::channel::Sender},
use cctk::toplevel_info::ToplevelInfo; toplevel_info::ToplevelInfo,
use cctk::wayland_client::protocol::wl_data_device_manager::DndAction; wayland_client::protocol::{
use cctk::wayland_client::protocol::wl_output::WlOutput; wl_data_device_manager::DndAction, wl_output::WlOutput, wl_seat::WlSeat,
use cctk::wayland_client::protocol::wl_seat::WlSeat; },
use cosmic::applet::cosmic_panel_config::{PanelAnchor, PanelSize};
use cosmic::applet::{Context, Size};
use cosmic::cosmic_config::{Config, CosmicConfigEntry};
use cosmic::desktop::IconSource;
use cosmic::iced::event::listen_with;
use cosmic::iced::wayland::actions::data_device::{DataFromMimeType, DndIcon};
use cosmic::iced::wayland::popup::{destroy_popup, get_popup};
use cosmic::iced::widget::{
column, dnd_listener, dnd_source, horizontal_space, mouse_area, row, vertical_rule,
vertical_space, Column, Row,
}; };
use cosmic::iced::{window, Color, Limits, Subscription, Vector}; use cosmic::{
use cosmic::iced_core::{Border, Padding, Shadow}; applet::{
use cosmic::iced_runtime::core::{alignment::Horizontal, event}; cosmic_panel_config::{PanelAnchor, PanelSize},
use cosmic::iced_sctk::commands::data_device::{ Context, Size,
accept_mime_type, finish_dnd, request_dnd_data, set_actions, start_drag, },
cosmic_config::{Config, CosmicConfigEntry},
desktop::IconSource,
iced,
iced::{
event::listen_with,
wayland::{
actions::data_device::{DataFromMimeType, DndIcon},
popup::{destroy_popup, get_popup},
},
widget::{
column, dnd_listener, dnd_source, mouse_area, row, vertical_rule, vertical_space,
Column, Row,
},
window, Color, Limits, Subscription, Vector,
},
iced_core::{Border, Padding, Shadow},
iced_runtime::core::{alignment::Horizontal, event},
iced_sctk::commands::data_device::{
accept_mime_type, finish_dnd, request_dnd_data, set_actions, start_drag,
},
iced_style::application,
theme::{Button, Container},
widget::{
button, divider, horizontal_space,
image::Handle,
rectangle_tracker::{rectangle_tracker_subscription, RectangleTracker, RectangleUpdate},
text, Image,
},
Apply, Command, Element, Theme,
}; };
use cosmic::iced_style::application; use cosmic_protocols::{
use cosmic::theme::{Button, Container}; toplevel_info::v1::client::zcosmic_toplevel_handle_v1::{State, ZcosmicToplevelHandleV1},
use cosmic::widget::rectangle_tracker::{ workspace::v1::client::zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1,
rectangle_tracker_subscription, RectangleTracker, RectangleUpdate,
}; };
use cosmic::widget::{button, divider, image::Handle, text, Image};
use cosmic::{iced, Apply, Command, Element, Theme};
use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::State;
use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1;
use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1;
use freedesktop_desktop_entry as fde; use freedesktop_desktop_entry as fde;
use freedesktop_desktop_entry::{get_languages_from_env, DesktopEntry}; use freedesktop_desktop_entry::{get_languages_from_env, DesktopEntry};
use futures::future::pending; use futures::future::pending;
use iced::{widget::container, Alignment, Background, Length}; use iced::{widget::container, Alignment, Background, Length};
use itertools::Itertools; use itertools::Itertools;
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use std::collections::HashMap; use std::{collections::HashMap, fs, path::PathBuf, str::FromStr, time::Duration};
use std::fs;
use std::path::PathBuf;
use std::str::FromStr;
use std::time::Duration;
use switcheroo_control::Gpu; use switcheroo_control::Gpu;
use tokio::time::sleep; use tokio::time::sleep;
use url::Url; use url::Url;

View file

@ -1,8 +1,9 @@
// 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 cosmic::cosmic_config::cosmic_config_derive::CosmicConfigEntry; use cosmic::cosmic_config::{
use cosmic::cosmic_config::{self, Config, CosmicConfigEntry}; self, cosmic_config_derive::CosmicConfigEntry, Config, CosmicConfigEntry,
};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::Debug; use std::fmt::Debug;
pub const APP_ID: &str = "com.system76.CosmicAppList"; pub const APP_ID: &str = "com.system76.CosmicAppList";

View file

@ -2,13 +2,16 @@
//! //!
//! This code was generated by `zbus-xmlgen` `2.0.1` from DBus introspection data. //! This code was generated by `zbus-xmlgen` `2.0.1` from DBus introspection data.
//! Source: `Interface '/org/freedesktop/UPower/KbdBacklight' from service 'org.freedesktop.UPower' on system bus`. //! Source: `Interface '/org/freedesktop/UPower/KbdBacklight' from service 'org.freedesktop.UPower' on system bus`.
use cctk::sctk::{output::OutputInfo, reexports::calloop}; use cctk::{
use cctk::toplevel_info::ToplevelInfo; sctk::{output::OutputInfo, reexports::calloop},
use cctk::wayland_client::protocol::wl_output::WlOutput; toplevel_info::ToplevelInfo,
use cosmic::iced; wayland_client::protocol::wl_output::WlOutput,
use cosmic::iced::subscription; };
use cosmic_protocols::toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1; use cosmic::{iced, iced::subscription};
use cosmic_protocols::workspace::v1::client::zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1; use cosmic_protocols::{
toplevel_info::v1::client::zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1,
workspace::v1::client::zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1,
};
use image::EncodableLayout; use image::EncodableLayout;
use futures::{ use futures::{