Compare commits

...
Author SHA1 Message Date
8ead7e6eb0
iced-template: use more efficient nixpkgs input 2026-08-22 17:36:09 -07:00
9c3419782b
iced-template: remove nonexistent icon 2026-08-22 17:36:00 -07:00
27f6371c2c
iced-template: factor out Element, explicit Error
the type alias Element is quite useful for defining subfunctions for view
and it also helps to not pull unnecessary things into scope
2026-08-22 17:35:56 -07:00
3 changed files with 13 additions and 15 deletions

17
flake.lock generated
View file

@ -20,18 +20,15 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1785747939,
"narHash": "sha256-D740uKsMbgsfK2oaDenJLLPIZfq7W0/g4KN/Fls8eKs=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "104240a772428cc2e20d8fd86c9ddbb886bbaff2",
"type": "github"
"lastModified": 1786862985,
"narHash": "sha256-kSR/jfpR4cE26YRZ8exQkoRbEA30vyWimajwZANYYaE=",
"rev": "e5bdc4a41d4c072fe1e3787eaa0320a384741d44",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1055335.e5bdc4a41d4c/nixexprs.tar.zst?lastModified=1786862985&rev=e5bdc4a41d4c072fe1e3787eaa0320a384741d44"
},
"original": {
"owner": "nixos",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
"type": "tarball",
"url": "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst"
}
},
"root": {

View file

@ -1,6 +1,6 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
nixpkgs.url = "https://channels.nixos.org/nixos-unstable/nixexprs.tar.zst";
flake-utils.url = "github:numtide/flake-utils";
};
@ -49,7 +49,6 @@
desktopItem = pkgs.makeDesktopItem {
inherit name;
desktopName = name;
icon = name;
exec = name;
};
in

View file

@ -1,4 +1,6 @@
use iced::{Color, Element, Renderer, Task, Theme, application, theme, widget};
use iced::{Color, Task, application, theme, widget};
type Element<'a> = iced::Element<'a, Message, iced::Theme, iced::Renderer>;
enum Message {}
@ -11,12 +13,12 @@ impl State {
fn update(&mut self, message: Message) -> Task<Message> {
Task::none()
}
fn view(&self) -> Element<'_, Message, Theme, Renderer> {
fn view(&self) -> Element<'_> {
widget::text("hiiiiiii").into()
}
}
pub fn run() -> Result<(), impl std::error::Error> {
pub fn run() -> Result<(), iced::Error> {
application(State::new, State::update, State::view)
.theme(theme::Theme::custom(
"high-contrast-dark",