Compare commits

...
Author SHA1 Message Date
1b814f9688
fix: fill screen horizontally
before, the line graph would always be one step behind (left)
2026-11-09 17:10:59 -08:00
6d8cff280e
refactor: format Cargo.toml 2026-11-09 17:06:26 -08:00
0634af10f1
build: optimize profiles 2026-11-09 17:02:43 -08:00
f8d693547c
build(flake): update all 2026-11-09 17:01:34 -08:00
4 changed files with 36 additions and 14 deletions

View file

@ -1,3 +1,5 @@
cargo-features = ["profile-rustflags"]
[package]
name = "itop"
description = "top program, made in iced"
@ -13,6 +15,23 @@ sysinfo = "0.39.6"
version = "0.14.0"
features = ["canvas", "smol"]
[profile.debug]
debug = true
strip = "none"
debug-assertions = true
overflow-checks = true
[profile.dev]
opt-level = 3
rustflags = ["-Clink-arg=-fuse-ld=mold"]
debug = false
strip = "debuginfo"
debug-assertions = false
overflow-checks = false
[profile.release]
lto = true
panic = "abort"
codegen-units = 1
lto = true
strip = "symbols"

20
flake.lock generated
View file

@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
"lastModified": 1790899423,
"narHash": "sha256-THGtz65UGJU+sonZidRboyCMk+9DclpMF7pwL4uDV4M=",
"lastModified": 1793836618,
"narHash": "sha256-TREenflwEjxOSq292FYwbc3kEm7TDRtXCZRNWEdjBmg=",
"owner": "ipetkov",
"repo": "crane",
"rev": "47b6b27ed9a3a9181415e4367d0c30ab2a0e0250",
"rev": "79fd63528501446749c09f08cad486a58c7d173e",
"type": "github"
},
"original": {
@ -20,11 +20,11 @@
"systems": "systems"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"lastModified": 1791914995,
"narHash": "sha256-Zf/xfQEAasnwnmEfHqW/4hjDE/s44yn2hD4RuVIZRjA=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"rev": "b7a79d3fea1e214f6d668d521cecec0c01e26544",
"type": "github"
},
"original": {
@ -35,11 +35,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1791260994,
"narHash": "sha256-MFBjw66d4h06MvpW6lIl7RwarLteD0sk859CncGwb1Q=",
"rev": "151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4",
"lastModified": 1794042290,
"narHash": "sha256-VZ8WvA9m3XN36juXyg/GwbDRU2OezOHJlXpJCXkccv0=",
"rev": "f4a03c008967841f2a0b3cb7c436fc6fc31671f6",
"type": "tarball",
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1086391.151fa4e8ddfd/nixexprs.tar.zst?lastModified=1791260994&rev=151fa4e8ddfdd8dd25d945ad94ed54a13de9f6e4"
"url": "https://releases.nixos.org/nixos/unstable/nixos-26.11pre1113206.f4a03c008967/nixexprs.tar.zst?lastModified=1794042290&rev=f4a03c008967841f2a0b3cb7c436fc6fc31671f6"
},
"original": {
"type": "tarball",

View file

@ -104,7 +104,10 @@
LD_LIBRARY_PATH = lib.makeLibraryPath dlDeps;
inputsFrom = [ crate ];
packages = [ pkgs.rust-analyzer ];
packages = with pkgs; [
rust-analyzer
mold
];
};
}
);

View file

@ -35,7 +35,7 @@ impl canvas::Program<app::Message, Theme, Renderer> for Graph {
frame.stroke(
&canvas::Path::new(|builder| {
for (index, value) in self.timeline.iter().enumerate() {
let x = index as f32 / self.timeline.len() as f32 * bounds.width;
let x = index as f32 / (self.timeline.len() - 1) as f32 * bounds.width;
let y = bounds.height - value / 100. * bounds.height;
builder.line_to(Point::new(x, y))
}