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": {
"crane": "crane",
"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": {
+22 -4
View File
@@ -7,6 +7,11 @@
crane.url = "github:ipetkov/crane";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@@ -16,13 +21,25 @@
crane,
flake-utils,
...
}:
}@inputs:
flake-utils.lib.eachDefaultSystem (
system:
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.
# winit dlopens libwayland at runtime, so these must be on
@@ -46,7 +63,8 @@
# git-initialized, so cleanCargoSource would otherwise copy target/).
src = pkgs.lib.cleanSourceWith {
src = ./.;
filter = path: type:
filter =
path: type:
let
base = baseNameOf (toString path);
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_layershell::daemon;
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;
/// 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 {
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
// container id is matched in `container` above.
operate(self);
@@ -264,10 +267,14 @@ fn bar_view(_bar: &Bar) -> Element<'static, Message> {
}
}
container(column(children).width(Length::Fill).align_x(Alignment::Center))
.padding(8)
.align_x(Alignment::Center)
.into()
container(
column(children)
.width(Length::Fill)
.align_x(Alignment::Center),
)
.padding(8)
.align_x(Alignment::Center)
.into()
}
/// 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)
.align_x(Alignment::Center),
column(items).spacing(1),
mouse_area(text("close").size(12))
.on_press(Message::ClosePopup(popup_id)),
mouse_area(text("close").size(12)).on_press(Message::ClosePopup(popup_id)),
]
.spacing(1)
.into()