This commit is contained in:
2026-08-31 17:42:04 +01:00
parent 3573b7bc1f
commit f77cd4d815
3 changed files with 58 additions and 13 deletions
Generated
+22 -1
View File
@@ -53,7 +53,28 @@
"inputs": { "inputs": {
"crane": "crane", "crane": "crane",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1788165049,
"narHash": "sha256-en4IoUeCqvq9F66YhwOrUFw1nc70OBhrJwrzfalezvY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "d03cd474bd97389dcc2e8cd3b3bb6b8c6e346b1a",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
} }
}, },
"systems": { "systems": {
+22 -4
View File
@@ -7,6 +7,11 @@
crane.url = "github:ipetkov/crane"; crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
@@ -16,13 +21,25 @@
crane, crane,
flake-utils, flake-utils,
... ...
}: }@inputs:
flake-utils.lib.eachDefaultSystem ( flake-utils.lib.eachDefaultSystem (
system: system:
let let
pkgs = nixpkgs.legacyPackages.${system}; pkgs = import inputs.nixpkgs {
inherit system;
overlays = [ (import inputs.rust-overlay) ];
};
craneLib = crane.mkLib pkgs; craneLib = (inputs.crane.mkLib pkgs).overrideToolchain (
p:
p.rust-bin.nightly.latest.default.override {
extensions = [
"rustc-codegen-cranelift-preview"
"rust-analyzer"
"rust-src"
];
}
);
# Runtime/shared libraries required by iced/iced_layershell/winit. # Runtime/shared libraries required by iced/iced_layershell/winit.
# winit dlopens libwayland at runtime, so these must be on # winit dlopens libwayland at runtime, so these must be on
@@ -46,7 +63,8 @@
# git-initialized, so cleanCargoSource would otherwise copy target/). # git-initialized, so cleanCargoSource would otherwise copy target/).
src = pkgs.lib.cleanSourceWith { src = pkgs.lib.cleanSourceWith {
src = ./.; src = ./.;
filter = path: type: filter =
path: type:
let let
base = baseNameOf (toString path); base = baseNameOf (toString path);
in in
+14 -8
View File
@@ -12,7 +12,7 @@ use iced::widget::{column, container, mouse_area, text};
use iced::{window, Alignment, Element, Length, Rectangle, Task, Theme}; use iced::{window, Alignment, Element, Length, Rectangle, Task, Theme};
use iced_layershell::daemon; use iced_layershell::daemon;
use iced_layershell::reexport::{Anchor, PopupAnchor, PopupGravity}; use iced_layershell::reexport::{Anchor, PopupAnchor, PopupGravity};
use iced_layershell::settings::{LayerShellSettings, StartMode, Settings}; use iced_layershell::settings::{LayerShellSettings, Settings, StartMode};
use iced_layershell::to_layer_message; use iced_layershell::to_layer_message;
/// Height of the bar in logical pixels. /// Height of the bar in logical pixels.
@@ -208,7 +208,10 @@ fn capture_bounds(module: Module) -> Task<Message> {
} }
impl advanced_widget::Operation<Rectangle> for FindBounds { impl advanced_widget::Operation<Rectangle> for FindBounds {
fn traverse(&mut self, operate: &mut dyn FnMut(&mut dyn advanced_widget::Operation<Rectangle>)) { fn traverse(
&mut self,
operate: &mut dyn FnMut(&mut dyn advanced_widget::Operation<Rectangle>),
) {
// Delegate traversal so widgets can visit their children; the // Delegate traversal so widgets can visit their children; the
// container id is matched in `container` above. // container id is matched in `container` above.
operate(self); operate(self);
@@ -264,10 +267,14 @@ fn bar_view(_bar: &Bar) -> Element<'static, Message> {
} }
} }
container(column(children).width(Length::Fill).align_x(Alignment::Center)) container(
.padding(8) column(children)
.align_x(Alignment::Center) .width(Length::Fill)
.into() .align_x(Alignment::Center),
)
.padding(8)
.align_x(Alignment::Center)
.into()
} }
/// Standalone button wrapped in MouseArea for click capture. The container /// Standalone button wrapped in MouseArea for click capture. The container
@@ -309,8 +316,7 @@ fn popup_view<'a>(bar: &'a Bar) -> Element<'a, Message> {
.width(Length::Fill) .width(Length::Fill)
.align_x(Alignment::Center), .align_x(Alignment::Center),
column(items).spacing(1), column(items).spacing(1),
mouse_area(text("close").size(12)) mouse_area(text("close").size(12)).on_press(Message::ClosePopup(popup_id)),
.on_press(Message::ClosePopup(popup_id)),
] ]
.spacing(1) .spacing(1)
.into() .into()