panel config fixes
This commit is contained in:
parent
df6c2e5f02
commit
2001c960ad
11 changed files with 265 additions and 125 deletions
326
Cargo.lock
generated
326
Cargo.lock
generated
|
|
@ -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.4.0"
|
||||
|
|
@ -236,6 +257,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"
|
||||
|
|
@ -394,16 +425,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]]
|
||||
|
|
@ -415,26 +446,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 = "dashmap"
|
||||
version = "5.3.4"
|
||||
|
|
@ -502,12 +513,55 @@ 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"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6907e25393cdcc1f4f3f513d9aac1e840eb1cc341a0fccb01171f7d14d10b946"
|
||||
|
||||
[[package]]
|
||||
name = "either"
|
||||
version = "1.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
||||
|
||||
[[package]]
|
||||
name = "enumflags2"
|
||||
version = "0.7.5"
|
||||
|
|
@ -567,18 +621,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"
|
||||
|
|
@ -632,15 +674,6 @@ dependencies = [
|
|||
"thiserror",
|
||||
]
|
||||
|
||||
[[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"
|
||||
|
|
@ -855,6 +888,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"
|
||||
|
|
@ -1129,23 +1173,13 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "inotify"
|
||||
version = "0.9.6"
|
||||
name = "indexmap"
|
||||
version = "1.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"
|
||||
checksum = "6c6392766afd7964e2531940894cffe4bd8d7d17dbc3c1c4857040fd4b33bdb3"
|
||||
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]]
|
||||
|
|
@ -1177,6 +1211,15 @@ dependencies = [
|
|||
"unic-langid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "itoa"
|
||||
version = "1.0.2"
|
||||
|
|
@ -1184,24 +1227,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
|
||||
|
||||
[[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"
|
||||
|
|
@ -1367,24 +1396,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-integer"
|
||||
version = "0.1.45"
|
||||
|
|
@ -1829,6 +1840,12 @@ 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"
|
||||
|
|
@ -1935,6 +1952,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"
|
||||
|
|
@ -1956,6 +1979,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"
|
||||
|
|
@ -1971,6 +2016,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 0.29.4",
|
||||
"xkbcommon",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "smithay-client-toolkit"
|
||||
version = "0.15.4"
|
||||
|
|
@ -2261,6 +2339,7 @@ dependencies = [
|
|||
"downcast-rs",
|
||||
"libc",
|
||||
"nix 0.22.3",
|
||||
"scoped-tls",
|
||||
"wayland-commons",
|
||||
"wayland-scanner 0.29.4",
|
||||
"wayland-sys 0.29.4",
|
||||
|
|
@ -2304,6 +2383,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 0.29.4",
|
||||
"wayland-sys 0.29.4",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "wayland-protocols"
|
||||
version = "0.29.4"
|
||||
|
|
@ -2314,6 +2403,7 @@ dependencies = [
|
|||
"wayland-client 0.29.4",
|
||||
"wayland-commons",
|
||||
"wayland-scanner 0.29.4",
|
||||
"wayland-server",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2338,12 +2428,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 0.29.4",
|
||||
"wayland-sys 0.29.4",
|
||||
]
|
||||
|
||||
[[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",
|
||||
]
|
||||
|
||||
|
|
@ -2458,6 +2569,35 @@ dependencies = [
|
|||
"dirs",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "xdg-shell-wrapper"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/pop-os/xdg-shell-wrapper?branch=master_jammy#ee3da5e2acb2c4dbb6c86c79e7aad5022ba03c58"
|
||||
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"
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ 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::CosmicPanelConfig;
|
||||
use cosmic_panel_config::config::PanelAnchor;
|
||||
use gtk4::prelude::*;
|
||||
use gtk4::subclass::prelude::*;
|
||||
use gtk4::Orientation;
|
||||
|
|
@ -81,7 +81,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);
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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::{Anchor, CosmicPanelConfig, XdgWrapperConfig};
|
||||
use cosmic_panel_config::config::{CosmicPanelConfig, PanelAnchor};
|
||||
use gio::DesktopAppInfo;
|
||||
use gio::Icon;
|
||||
use glib::Object;
|
||||
|
|
@ -174,10 +174,10 @@ 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);
|
||||
|
||||
model.items_changed(0, model.n_items(), model.n_items());
|
||||
|
||||
let imp = imp::DockList::from_instance(self);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ pub mod graphics;
|
|||
pub mod mode_box;
|
||||
|
||||
use self::{dbus::PowerDaemonProxy, graphics::Graphics, mode_box::ModeSelection};
|
||||
use cosmic_panel_config::config::{CosmicPanelConfig, XdgWrapperConfig};
|
||||
use cosmic_panel_config::config::{CosmicPanelConfig};
|
||||
use gtk4::{
|
||||
gdk::Display,
|
||||
gio::ApplicationFlags,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ impl CosmicWorkspacesWindow {
|
|||
..set_title(Some(&fl!("cosmic-applet-workspaces")));
|
||||
..add_css_class("transparent");
|
||||
};
|
||||
let config = CosmicPanelConfig::load_from_env().unwrap_or_default();
|
||||
let config = CosmicPanelConfig::load_from_env().unwrap();
|
||||
|
||||
let app_list = WorkspaceList::new(config);
|
||||
self_.set_child(Some(&app_list));
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use crate::wayland::State;
|
|||
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;
|
||||
|
|
@ -40,9 +40,11 @@ impl WorkspaceList {
|
|||
|
||||
fn layout(&self) {
|
||||
let imp = imp::WorkspaceList::from_instance(self);
|
||||
let anchor = imp.config.get().unwrap().anchor;
|
||||
|
||||
let list_view = cascade! {
|
||||
ListView::default();
|
||||
..set_orientation(Orientation::Horizontal);
|
||||
..set_orientation(anchor.into());
|
||||
..add_css_class("transparent");
|
||||
};
|
||||
self.append(&list_view);
|
||||
|
|
@ -86,7 +88,7 @@ impl WorkspaceList {
|
|||
.item()
|
||||
.expect("The item has to exist.")
|
||||
.downcast::<WorkspaceObject>()
|
||||
.expect("The item has to be a `DockObject`");
|
||||
.expect("The item has to be a `WorkspaceObject`");
|
||||
let workspace_button = list_item
|
||||
.child()
|
||||
.expect("The list item child needs to exist.")
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
|
|
|
|||
12
justfile
12
justfile
|
|
@ -38,9 +38,9 @@ install:
|
|||
install -Dm0755 target/release/cosmic-app-list {{bindir}}/cosmic-app-list
|
||||
|
||||
# audio
|
||||
install -Dm0644 applets/cosmic-applet-audio/data/icons/{{audio_id}}.svg {{iconsdir}}/{{audio_id}}.svg
|
||||
install -Dm0644 applets/cosmic-applet-audio/data/{{audio_id}}.desktop {{sharedir}}/applications/{{audio_id}}.desktop
|
||||
install -Dm0755 target/release/cosmic-applet-audio {{bindir}}/cosmic-applet-audio
|
||||
# install -Dm0644 applets/cosmic-applet-audio/data/icons/{{audio_id}}.svg {{iconsdir}}/{{audio_id}}.svg
|
||||
# install -Dm0644 applets/cosmic-applet-audio/data/{{audio_id}}.desktop {{sharedir}}/applications/{{audio_id}}.desktop
|
||||
# install -Dm0755 target/release/cosmic-applet-audio {{bindir}}/cosmic-applet-audio
|
||||
|
||||
# graphics
|
||||
install -Dm0644 applets/cosmic-applet-graphics/data/icons/{{graphics_id}}.svg {{iconsdir}}/{{graphics_id}}.svg
|
||||
|
|
@ -48,9 +48,9 @@ install:
|
|||
install -Dm0755 target/release/cosmic-applet-graphics {{bindir}}/cosmic-applet-graphics
|
||||
|
||||
# network
|
||||
install -Dm0644 applets/cosmic-applet-network/data/icons/{{network_id}}.svg {{iconsdir}}/{{network_id}}.svg
|
||||
install -Dm0644 applets/cosmic-applet-network/data/{{network_id}}.desktop {{sharedir}}/applications/{{network_id}}.desktop
|
||||
install -Dm0755 target/release/cosmic-applet-network {{bindir}}/cosmic-applet-network
|
||||
# install -Dm0644 applets/cosmic-applet-network/data/icons/{{network_id}}.svg {{iconsdir}}/{{network_id}}.svg
|
||||
# install -Dm0644 applets/cosmic-applet-network/data/{{network_id}}.desktop {{sharedir}}/applications/{{network_id}}.desktop
|
||||
# install -Dm0755 target/release/cosmic-applet-network {{bindir}}/cosmic-applet-network
|
||||
|
||||
# notifications
|
||||
install -Dm0644 applets/cosmic-applet-notifications/data/icons/{{notifications_id}}.svg {{iconsdir}}/{{notifications_id}}.svg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue