Update cosmic-panel-config

This commit is contained in:
Ian Douglas Scott 2022-06-29 13:32:50 -07:00
parent 04c7e73dec
commit e049343317
10 changed files with 245 additions and 116 deletions

317
Cargo.lock generated
View file

@ -17,6 +17,27 @@ version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc"
[[package]]
name = "appendlist"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e149dc73cd30538307e7ffa2acd3d2221148eaeed4871f246657b1c3eaa1cbd2"
[[package]]
name = "approx"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278"
dependencies = [
"num-traits",
]
[[package]]
name = "arc-swap"
version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c5d78ce20460b82d3fa150275ed9d55e21064fc7951177baacf86a145c4a4b1f"
[[package]]
name = "async-broadcast"
version = "0.3.4"
@ -262,6 +283,16 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "cgmath"
version = "0.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317"
dependencies = [
"approx",
"num-traits",
]
[[package]]
name = "chrono"
version = "0.4.19"
@ -470,16 +501,16 @@ dependencies = [
[[package]]
name = "cosmic-panel-config"
version = "0.1.0"
source = "git+https://github.com/pop-os/cosmic-panel#8787823d807ea9a9d7b96ecacf017d695ba7b58a"
source = "git+https://github.com/pop-os/cosmic-panel#231dc1ec0656840458d9f0d3468d9c7ea5c2a98c"
dependencies = [
"anyhow",
"gtk4",
"notify",
"ron",
"serde",
"slog",
"smithay-client-toolkit",
"xdg",
"xdg-shell-wrapper",
]
[[package]]
@ -491,26 +522,6 @@ dependencies = [
"libc",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53"
dependencies = [
"cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-utils"
version = "0.8.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38"
dependencies = [
"cfg-if",
"lazy_static",
]
[[package]]
name = "darling"
version = "0.14.1"
@ -653,6 +664,43 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650"
[[package]]
name = "drm"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "408e87132bd0d8a13a3b418b9d51fb92973b764d1d40785947d233ab2945fd27"
dependencies = [
"bitflags",
"drm-ffi",
"drm-fourcc",
"nix 0.22.3",
]
[[package]]
name = "drm-ffi"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "198d1b7fdb33b75e9bd08ba6842ddb730760f7eeea25552acc88c5403c4f0652"
dependencies = [
"drm-sys",
"nix 0.22.3",
]
[[package]]
name = "drm-fourcc"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0aafbcdb8afc29c1a7ee5fbe53b5d62f4565b35a042a662ca9fecd0b54dae6f4"
[[package]]
name = "drm-sys"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f5f45fcdd3b2f3c13fadea11b2a4eda2023e7de55021da039eac4a3beecfe91c"
dependencies = [
"libc",
]
[[package]]
name = "easy-parallel"
version = "3.2.0"
@ -724,18 +772,6 @@ dependencies = [
"rustc_version",
]
[[package]]
name = "filetime"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
"winapi",
]
[[package]]
name = "find-crate"
version = "0.6.3"
@ -827,15 +863,6 @@ dependencies = [
"xdg",
]
[[package]]
name = "fsevent-sys"
version = "4.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76ee7a02da4d231650c7cea31349b889be2f45ddb3ef3032d2ec8185f6313fd2"
dependencies = [
"libc",
]
[[package]]
name = "futures"
version = "0.3.21"
@ -1107,6 +1134,17 @@ dependencies = [
"winapi",
]
[[package]]
name = "gl_generator"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d"
dependencies = [
"khronos_api",
"log",
"xml-rs",
]
[[package]]
name = "glib"
version = "0.15.11"
@ -1387,23 +1425,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "inotify"
version = "0.9.6"
name = "indexmap"
version = "1.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"
checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
dependencies = [
"bitflags",
"inotify-sys",
"libc",
]
[[package]]
name = "inotify-sys"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e05c02b5e89bff3b946cedeca278abc628fe811e604f027c45a8aa3cf793d0eb"
dependencies = [
"libc",
"autocfg",
"hashbrown",
]
[[package]]
@ -1460,24 +1488,10 @@ dependencies = [
]
[[package]]
name = "kqueue"
version = "1.0.6"
name = "khronos_api"
version = "3.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4d6112e8f37b59803ac47a42d14f1f3a59bbf72fc6857ffc5be455e28a691f8e"
dependencies = [
"kqueue-sys",
"libc",
]
[[package]]
name = "kqueue-sys"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587"
dependencies = [
"bitflags",
"libc",
]
checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc"
[[package]]
name = "lazy_static"
@ -1717,24 +1731,6 @@ dependencies = [
"minimal-lexical",
]
[[package]]
name = "notify"
version = "5.0.0-pre.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "553f9844ad0b0824605c20fb55a661679782680410abfb1a8144c2e7e437e7a7"
dependencies = [
"bitflags",
"crossbeam-channel",
"filetime",
"fsevent-sys",
"inotify",
"kqueue",
"libc",
"mio",
"walkdir",
"winapi",
]
[[package]]
name = "num-derive"
version = "0.3.3"
@ -2277,6 +2273,18 @@ dependencies = [
"winapi-util",
]
[[package]]
name = "scan_fmt"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b53b0a5db882a8e2fdaae0a43f7b39e7e9082389e978398bdf223a55b581248"
[[package]]
name = "scoped-tls"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
[[package]]
name = "scopeguard"
version = "1.1.0"
@ -2377,6 +2385,12 @@ dependencies = [
"opaque-debug",
]
[[package]]
name = "shlex"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
[[package]]
name = "signal-hook-registry"
version = "1.4.0"
@ -2398,6 +2412,28 @@ version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06"
[[package]]
name = "slog-scope"
version = "4.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786"
dependencies = [
"arc-swap",
"lazy_static",
"slog",
]
[[package]]
name = "slog-stdlog"
version = "4.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6706b2ace5bbae7291d3f8d2473e2bfab073ccd7d03670946197aec98471fa3e"
dependencies = [
"log",
"slog",
"slog-scope",
]
[[package]]
name = "slotmap"
version = "1.0.6"
@ -2413,6 +2449,39 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83"
[[package]]
name = "smithay"
version = "0.3.0"
source = "git+https://github.com/smithay/smithay?rev=fd39b90#fd39b90394ba14c2705a185f3819d988bf7ee8ea"
dependencies = [
"appendlist",
"bitflags",
"calloop",
"cgmath",
"downcast-rs",
"drm",
"drm-ffi",
"drm-fourcc",
"gl_generator",
"indexmap",
"lazy_static",
"libc",
"libloading",
"nix 0.22.3",
"once_cell",
"rand",
"scan_fmt",
"slog",
"slog-stdlog",
"tempfile",
"thiserror",
"wayland-commons",
"wayland-protocols",
"wayland-server",
"wayland-sys",
"xkbcommon",
]
[[package]]
name = "smithay-client-toolkit"
version = "0.15.4"
@ -2788,6 +2857,7 @@ dependencies = [
"downcast-rs",
"libc",
"nix 0.22.3",
"scoped-tls",
"wayland-commons",
"wayland-scanner",
"wayland-sys",
@ -2816,6 +2886,16 @@ dependencies = [
"xcursor",
]
[[package]]
name = "wayland-egl"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83281d69ee162b59031c666385e93bde4039ec553b90c4191cdb128ceea29a3a"
dependencies = [
"wayland-client",
"wayland-sys",
]
[[package]]
name = "wayland-protocols"
version = "0.29.4"
@ -2826,6 +2906,7 @@ dependencies = [
"wayland-client",
"wayland-commons",
"wayland-scanner",
"wayland-server",
]
[[package]]
@ -2839,12 +2920,33 @@ dependencies = [
"xml-rs",
]
[[package]]
name = "wayland-server"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6cc7a08542e2cdbca4a55daa9b5b9dce492f9703c8948045a5cae86847b48f2"
dependencies = [
"bitflags",
"downcast-rs",
"lazy_static",
"libc",
"nix 0.22.3",
"parking_lot 0.11.2",
"scoped-tls",
"wayland-commons",
"wayland-scanner",
"wayland-sys",
]
[[package]]
name = "wayland-sys"
version = "0.29.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4"
dependencies = [
"dlib",
"libc",
"memoffset",
"pkg-config",
]
@ -2959,6 +3061,35 @@ dependencies = [
"dirs 4.0.0",
]
[[package]]
name = "xdg-shell-wrapper"
version = "0.1.0"
source = "git+https://github.com/pop-os/xdg-shell-wrapper?branch=master_jammy#8bdb5df2a414fb3940d02c3890458cb520e4f074"
dependencies = [
"anyhow",
"calloop",
"itertools",
"libc",
"once_cell",
"ron",
"serde",
"shlex",
"slog",
"smithay",
"smithay-client-toolkit",
"tempfile",
"wayland-egl",
]
[[package]]
name = "xkbcommon"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fda0ea5f7ddabd51deeeda7799bee06274112f577da7dd3d954b8eda731b2fce"
dependencies = [
"libc",
]
[[package]]
name = "xml-rs"
version = "0.8.4"

View file

@ -5,7 +5,7 @@ use crate::dock_list::DockList;
use crate::dock_list::DockListType;
use crate::utils::Event;
use cascade::cascade;
use cosmic_panel_config::config::Anchor;
use cosmic_panel_config::config::PanelAnchor;
use cosmic_panel_config::config::CosmicPanelConfig;
use gtk4::prelude::*;
use gtk4::subclass::prelude::*;
@ -84,7 +84,7 @@ impl AppsContainer {
}
}
pub fn set_position(&self, position: Anchor) {
pub fn set_position(&self, position: PanelAnchor) {
self.set_orientation(position.into());
let imp = imp::AppsContainer::from_instance(self);
imp.saved_list.get().unwrap().set_position(position);

View file

@ -5,7 +5,7 @@ use crate::dock_popover::DockPopover;
use crate::utils::BoxedWindowList;
use crate::utils::Event;
use cascade::cascade;
use cosmic_panel_config::config::{Anchor, XdgWrapperConfig};
use cosmic_panel_config::config::PanelAnchor;
use gtk4::glib;
use gtk4::prelude::*;
use gtk4::subclass::prelude::*;
@ -131,50 +131,48 @@ impl DockItem {
}
}
pub fn set_position(&self, position: Anchor) {
pub fn set_position(&self, position: PanelAnchor) {
let imp = imp::DockItem::from_instance(self);
let item_box = imp.item_box.borrow();
let dots = imp.dots.borrow();
if let Some(image) = imp.image.borrow().as_ref() {
match position {
Anchor::Left => {
PanelAnchor::Left => {
item_box.set_orientation(Orientation::Horizontal);
dots.set_orientation(Orientation::Vertical);
dots.set_margin_bottom(4);
dots.set_margin_top(4);
item_box.reorder_child_after(&image.clone(), Some(&dots.clone()));
}
Anchor::Right => {
PanelAnchor::Right => {
item_box.set_orientation(Orientation::Horizontal);
dots.set_orientation(Orientation::Vertical);
dots.set_margin_bottom(4);
dots.set_margin_top(4);
item_box.reorder_child_after(&dots.clone(), Some(&image.clone()));
}
Anchor::Top => {
PanelAnchor::Top => {
item_box.set_orientation(Orientation::Vertical);
dots.set_orientation(Orientation::Horizontal);
dots.set_margin_start(4);
dots.set_margin_end(4);
item_box.reorder_child_after(&image.clone(), Some(&dots.clone()));
}
Anchor::Bottom => {
PanelAnchor::Bottom => {
item_box.set_orientation(Orientation::Vertical);
dots.set_orientation(Orientation::Horizontal);
dots.set_margin_start(4);
dots.set_margin_end(4);
item_box.reorder_child_after(&dots.clone(), Some(&image.clone()));
}
Anchor::Center => unimplemented!(),
};
}
let popover = imp.popover.borrow();
popover.set_position(match position {
Anchor::Left => PositionType::Right,
Anchor::Right => PositionType::Left,
Anchor::Top => PositionType::Bottom,
Anchor::Bottom => PositionType::Top,
Anchor::Center => unimplemented!(),
PanelAnchor::Left => PositionType::Right,
PanelAnchor::Right => PositionType::Left,
PanelAnchor::Top => PositionType::Bottom,
PanelAnchor::Bottom => PositionType::Top,
});
}

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MPL-2.0-only
use cosmic_panel_config::config::{Anchor, CosmicPanelConfig};
use cosmic_panel_config::config::{PanelAnchor, CosmicPanelConfig};
use glib::SignalHandlerId;
use gtk4::subclass::prelude::*;
use gtk4::{gio, glib};
@ -23,7 +23,7 @@ pub struct DockList {
pub drag_end_signal: Rc<RefCell<Option<SignalHandlerId>>>,
pub drag_cancel_signal: Rc<RefCell<Option<SignalHandlerId>>>,
pub popover_menu_index: Rc<Cell<Option<u32>>>,
pub position: Rc<Cell<Anchor>>,
pub position: Rc<Cell<PanelAnchor>>,
pub tx: OnceCell<mpsc::Sender<Event>>,
pub config: OnceCell<CosmicPanelConfig>
}

View file

@ -5,7 +5,7 @@ use crate::dock_object::DockObject;
use crate::utils::data_path;
use crate::utils::{BoxedWindowList, Event, Item};
use cascade::cascade;
use cosmic_panel_config::config::{CosmicPanelConfig, XdgWrapperConfig, Anchor};
use cosmic_panel_config::config::{CosmicPanelConfig, PanelAnchor};
use gio::DesktopAppInfo;
use gio::Icon;
use glib::Object;
@ -174,7 +174,7 @@ impl DockList {
imp.list_view.set(list_view).unwrap();
}
pub fn set_position(&self, position: Anchor) {
pub fn set_position(&self, position: PanelAnchor) {
let imp = imp::DockList::from_instance(self);
let model = imp.model.get().unwrap();
imp.position.replace(position);

View file

@ -20,7 +20,7 @@ use gtk4::{
};
use once_cell::sync::Lazy;
use tokio::runtime::Runtime;
use cosmic_panel_config::config::{CosmicPanelConfig, XdgWrapperConfig};
use cosmic_panel_config::config::CosmicPanelConfig;
static RT: Lazy<Runtime> = Lazy::new(|| Runtime::new().expect("failed to build tokio runtime"));

View file

@ -7,7 +7,7 @@ pub mod task;
pub mod ui;
pub mod widgets;
use cosmic_panel_config::config::{CosmicPanelConfig, XdgWrapperConfig};
use cosmic_panel_config::config::CosmicPanelConfig;
use gtk4::{gio::ApplicationFlags, glib, prelude::*, Orientation, Separator};
use once_cell::sync::Lazy;
use tokio::runtime::Runtime;

View file

@ -6,7 +6,7 @@ extern crate relm4_macros;
pub mod session_manager;
pub mod ui;
use cosmic_panel_config::config::{CosmicPanelConfig, XdgWrapperConfig};
use cosmic_panel_config::config::CosmicPanelConfig;
use gtk4::{gio::ApplicationFlags, glib, prelude::*, Align, Button, Label, Orientation, Separator};
use once_cell::sync::Lazy;
use std::process::Command;

View file

@ -4,7 +4,7 @@ use crate::utils::Activate;
use crate::workspace_button::WorkspaceButton;
use crate::workspace_object::WorkspaceObject;
use cascade::cascade;
use cosmic_panel_config::config::{CosmicPanelConfig, XdgWrapperConfig};
use cosmic_panel_config::config::CosmicPanelConfig;
use gtk4::ListView;
use gtk4::Orientation;
use gtk4::SignalListItemFactory;

View file

@ -2,7 +2,7 @@
use crate::fl;
use cascade::cascade;
use cosmic_panel_config::config::{CosmicPanelConfig, XdgWrapperConfig};
use cosmic_panel_config::config::CosmicPanelConfig;
use gtk4::{
gio::{self, DesktopAppInfo, Icon},
glib::{self, Object},