Slint GUI (Home/Library/Unfiltered), Steam cover art, owned-game names, README screenshots
This commit is contained in:
1 parent
35a340094d
commit
d939b515b7
15 files changed
+5713
-22
No files matched your search
Generated
+5345
-20
File diff suppressed because it is too large.
Load diff
+1
-1
@@ -1,6 +1,6 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["crates/summit-core", "crates/summit-cli"]
|
||||
members = ["crates/summit-core", "crates/summit-cli", "crates/summit-gui"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.0.1"
|
||||
|
||||
@@ -10,6 +10,17 @@
|
||||
<a href="https://git.molberg.cloud/alex"><b>More projects by Alex</b></a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="docs/media/summit-home.png" width="100%" alt="Summit Home view: cover boxes of the most played games with hours played, on a dark navbar with Home, Library and Unfiltered tabs.">
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="docs/media/summit-library.png" width="49%" alt="Summit Library view">
|
||||
<img src="docs/media/summit-unfiltered.png" width="49%" alt="Summit Unfiltered view: compact list grouped by source with the reason each entry was detected">
|
||||
</p>
|
||||
|
||||
<p align="center"><sub>Real renders of the Slint GUI, made on a KDE neon test VM (X11) from its real Steam account: cover art from Steam's own cache, real playtime. Nothing is installed on that VM, so every game shows "Not installed". No game was running; the in-game overlay is not built yet.</sub></p>
|
||||
|
||||
> [!NOTE]
|
||||
> **Pre-alpha.** What works today is the command-line core: library scanning with detection reasons, playtime tracking, Home pins, custom artwork, and per-game display profiles applied at launch. The launcher GUI, Steam shortcut export, in-game overlay and upscaling/frame-gen backends are planned and are **not built yet**. Nothing below is marked as working unless it is.
|
||||
|
||||
@@ -30,7 +41,7 @@
|
||||
| Pin to Home and custom artwork per entry (CLI) | Working. GUI editing planned. |
|
||||
| Display profile applied at launch: monitor, resolution, refresh rate | Working for KDE Wayland (`kscreen-doctor`), wlroots Wayland (`wlr-randr`) and X11 (`xrandr`). **GNOME Wayland has no stable tool, so Summit says so and skips it. Command plans are unit tested; real monitor changes are not yet verified on hardware.** |
|
||||
| Per-game fullscreen, focus, upscaler and frame-gen settings | Stored. Fullscreen, focus and the upscaling are not applied yet. |
|
||||
| Launcher GUI (Slint): Home / Library / Unfiltered, tweakable animations | Planned |
|
||||
| Launcher GUI (Slint): Home / Library / Unfiltered, tweakable animations | Working (first version). Built with Slint; cover art from Steam's cache, tab animations with a speed slider. Run `summit-gui`. Not yet: launching from it, artwork editing, install buttons. |
|
||||
| In-game overlay with a watermark showing the project URL | Planned |
|
||||
| One-click "Add to Steam" with SteamGridDB artwork | Planned |
|
||||
| "My PS5" and "Capture Card" entries (Remote Play, capture cards, Moonlight, Sunshine) | Planned. Reuses the SmoovPlay pipeline. |
|
||||
@@ -42,6 +53,8 @@
|
||||
|
||||
```sh
|
||||
cargo build --release
|
||||
./target/release/summit-gui # the launcher window
|
||||
./target/release/summit names # resolve names of owned, uninstalled Steam games
|
||||
./target/release/summit scan --why -p ~/Games # everything found, with reasons
|
||||
./target/release/summit home # most played
|
||||
./target/release/summit run my-game -- ./game.sh # applies the profile, runs it, tracks the time
|
||||
|
||||
@@ -29,6 +29,8 @@ enum Cmd {
|
||||
Art { id: String, image: std::path::PathBuf },
|
||||
/// Show detected session (Wayland/X11), desktop and the display commands a profile would run
|
||||
Doctor { id: Option<String> },
|
||||
/// Look up names for Steam games you own but have not installed (cached)
|
||||
Names { #[arg(long, default_value_t = 60)] limit: usize },
|
||||
/// Per-game profile
|
||||
Profile { #[command(subcommand)] cmd: ProfileCmd },
|
||||
}
|
||||
@@ -75,6 +77,12 @@ fn main() -> Result<()> {
|
||||
all.sort_by(|a, b| (st.pinned.contains(&b.id)).cmp(&st.pinned.contains(&a.id)).then(b.playtime_minutes.cmp(&a.playtime_minutes)));
|
||||
for e in all.iter().take(n) { println!("{} {:>9} {}", if st.pinned.contains(&e.id) { "*" } else { " " }, hours(e.playtime_minutes), e.title); }
|
||||
}
|
||||
Cmd::Names { limit } => {
|
||||
let mut ids: Vec<u32> = summit_core::steam::steam_roots().iter().flat_map(|r| summit_core::steam::playtime(r).into_keys()).collect();
|
||||
ids.sort(); ids.dedup();
|
||||
let n = summit_core::names::fetch_missing(&ids, limit, 1500, |id, n| println!("{id}: {} ({})", if n.name.is_empty() { "?" } else { &n.name }, n.kind))?;
|
||||
println!("resolved {n}");
|
||||
}
|
||||
Cmd::Pin { id } => { let mut st = state::load(); st.pin(&id); state::save(&st)?; println!("pinned {id}"); }
|
||||
Cmd::Unpin { id } => { let mut st = state::load(); st.unpin(&id); state::save(&st)?; println!("unpinned {id}"); }
|
||||
Cmd::Art { id, image } => {
|
||||
|
||||
@@ -10,3 +10,4 @@ serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
toml.workspace = true
|
||||
dirs.workspace = true
|
||||
ureq = "2"
|
||||
@@ -2,6 +2,7 @@
|
||||
pub mod display;
|
||||
pub mod epic;
|
||||
pub mod model;
|
||||
pub mod names;
|
||||
pub mod profile;
|
||||
pub mod scan;
|
||||
pub mod state;
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
//! Steam app names for titles you own but have not installed. localconfig.vdf only has ids,
|
||||
//! so names come from Steam's public store API and are cached locally. Unresolvable ids are cached too, so they are not re-asked.
|
||||
use anyhow::{Context, Result};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use std::path::PathBuf;
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct Name { pub name: String, /// "game", "dlc", "tool", ... or "unknown"
|
||||
pub kind: String }
|
||||
|
||||
pub type Names = HashMap<u32, Name>;
|
||||
|
||||
pub fn path() -> Result<PathBuf> { Ok(dirs::data_dir().context("no data dir")?.join("summit/steam-names.json")) }
|
||||
|
||||
pub fn load() -> Names {
|
||||
path().ok().and_then(|p| std::fs::read_to_string(p).ok()).and_then(|s| serde_json::from_str(&s).ok()).unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn save(n: &Names) -> Result<()> {
|
||||
let p = path()?; std::fs::create_dir_all(p.parent().unwrap())?;
|
||||
std::fs::write(p, serde_json::to_string(n)?)?; Ok(())
|
||||
}
|
||||
|
||||
/// Parse one appdetails response body for `id`.
|
||||
pub fn parse_details(id: u32, body: &str) -> Name {
|
||||
let v: serde_json::Value = serde_json::from_str(body).unwrap_or_default();
|
||||
let d = &v[id.to_string()];
|
||||
if d["success"].as_bool() == Some(true) {
|
||||
Name { name: d["data"]["name"].as_str().unwrap_or("").into(), kind: d["data"]["type"].as_str().unwrap_or("unknown").into() }
|
||||
} else { Name { name: String::new(), kind: "unknown".into() } }
|
||||
}
|
||||
|
||||
/// Resolve up to `limit` ids not yet cached, pausing between requests (the store API allows ~200 per 5 minutes).
|
||||
pub fn fetch_missing(ids: &[u32], limit: usize, pause_ms: u64, mut progress: impl FnMut(u32, &Name)) -> Result<usize> {
|
||||
let mut names = load();
|
||||
let mut done = 0;
|
||||
let todo: Vec<u32> = ids.iter().copied().filter(|i| !names.contains_key(i)).take(limit).collect();
|
||||
for id in todo {
|
||||
let url = format!("https://store.steampowered.com/api/appdetails?appids={id}&filters=basic");
|
||||
let n = match ureq::get(&url).set("User-Agent", "summit-launcher").call().and_then(|r| r.into_string().map_err(Into::into)) {
|
||||
Ok(body) => parse_details(id, &body),
|
||||
Err(_) => break, // network/rate-limit: keep what we have, try again next run
|
||||
};
|
||||
progress(id, &n);
|
||||
names.insert(id, n); done += 1;
|
||||
if done % 10 == 0 { let _ = save(&names); }
|
||||
std::thread::sleep(std::time::Duration::from_millis(pause_ms));
|
||||
}
|
||||
save(&names)?;
|
||||
Ok(done)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
#[test] fn parses_game() {
|
||||
let n = parse_details(620, r#"{"620":{"success":true,"data":{"type":"game","name":"Portal 2"}}}"#);
|
||||
assert_eq!((n.name.as_str(), n.kind.as_str()), ("Portal 2", "game"));
|
||||
}
|
||||
#[test] fn parses_failure() { assert_eq!(parse_details(1, r#"{"1":{"success":false}}"#).kind, "unknown"); }
|
||||
}
|
||||
@@ -66,6 +66,7 @@ fn is_tool(name: &str) -> bool {
|
||||
|
||||
pub fn scan() -> Vec<Entry> {
|
||||
let mut out = Vec::new();
|
||||
let names = crate::names::load();
|
||||
for root in steam_roots() {
|
||||
let pt = playtime(&root);
|
||||
for lib in library_folders(&root) {
|
||||
@@ -103,6 +104,37 @@ pub fn scan() -> Vec<Entry> {
|
||||
});
|
||||
}
|
||||
}
|
||||
// Owned but not installed: ids in localconfig.vdf whose name we resolved and which are real games.
|
||||
let have: std::collections::HashSet<u32> = out.iter().filter_map(|e| e.steam_app_id).collect();
|
||||
for (id, (minutes, last)) in &pt {
|
||||
let Some(n) = names.get(id) else { continue };
|
||||
if have.contains(id) || n.kind != "game" || n.name.is_empty() { continue; }
|
||||
out.push(Entry {
|
||||
id: format!("steam:{id}"), title: n.name.clone(), source: Source::Steam, kind: Kind::Game,
|
||||
installed: false, path: None, steam_app_id: Some(*id), playtime_minutes: *minutes,
|
||||
last_played: if *last > 0 { Some(*last) } else { None },
|
||||
reasons: vec![format!("app {id} is in your Steam account (localconfig.vdf)"), "not installed".into()],
|
||||
});
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Cover art from Steam's own library cache (portrait 600x900 preferred, then header). Works without network.
|
||||
pub fn cover(app_id: u32) -> Option<PathBuf> {
|
||||
for root in steam_roots() {
|
||||
let d = root.join("appcache/librarycache").join(app_id.to_string());
|
||||
for n in ["library_600x900.jpg", "header.jpg"] {
|
||||
if d.join(n).is_file() { return Some(d.join(n)); }
|
||||
}
|
||||
// newer clients nest the files in a hash folder
|
||||
if let Ok(rd) = std::fs::read_dir(&d) {
|
||||
for sub in rd.flatten().filter(|e| e.path().is_dir()) {
|
||||
for n in ["library_600x900.jpg", "header.jpg"] {
|
||||
if sub.path().join(n).is_file() { return Some(sub.path().join(n)); }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "summit-gui"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
license.workspace = true
|
||||
|
||||
[[bin]]
|
||||
name = "summit-gui"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
summit-core = { path = "../summit-core" }
|
||||
slint = { version = "1.19", default-features = false, features = ["std", "backend-winit", "renderer-software", "software-renderer-systemfonts", "compat-1-2"] }
|
||||
|
||||
[build-dependencies]
|
||||
slint-build = "1.19"
|
||||
@@ -0,0 +1 @@
|
||||
fn main() { slint_build::compile("ui/app.slint").unwrap(); }
|
||||
@@ -0,0 +1,92 @@
|
||||
use slint::{Color, Image, ModelRc, SharedString, VecModel};
|
||||
use std::path::Path;
|
||||
use summit_core::{display, model::{Entry, Kind, Source}, scan, state, steam};
|
||||
|
||||
slint::include_modules!();
|
||||
|
||||
fn accent(title: &str) -> Color {
|
||||
let h = title.bytes().fold(7u32, |a, b| a.wrapping_mul(31).wrapping_add(b as u32));
|
||||
let hues = [(0x5b, 0x3d, 0xd8), (0x1f, 0x7a, 0x8c), (0xc2, 0x41, 0x4b), (0x2e, 0x7d, 0x4f), (0xb5, 0x6a, 0x1e), (0x3a, 0x5b, 0xc7)];
|
||||
let (r, g, b) = hues[(h % hues.len() as u32) as usize];
|
||||
Color::from_rgb_u8(r, g, b)
|
||||
}
|
||||
fn hours(m: u64) -> String { if m == 0 { "Never played".into() } else if m < 60 { format!("{m} min") } else { format!("{:.1} h", m as f64 / 60.0) } }
|
||||
fn src_name(s: Source) -> &'static str { match s { Source::Steam => "STEAM", Source::Heroic => "HEROIC / EPIC / GOG", Source::Lutris => "LUTRIS", Source::Heuristic => "FOUND ON DISK" } }
|
||||
|
||||
fn card(e: &Entry, pinned: bool, art: &std::collections::HashMap<String, String>) -> Card {
|
||||
let cover_path = art.get(&e.id).map(std::path::PathBuf::from).or_else(|| e.steam_app_id.and_then(steam::cover));
|
||||
let img = cover_path.as_deref().and_then(|p: &Path| Image::load_from_path(p).ok());
|
||||
Card {
|
||||
title: SharedString::from(e.title.as_str()), hours: SharedString::from(hours(e.playtime_minutes)),
|
||||
source: SharedString::from(src_name(e.source)), installed: e.installed,
|
||||
has_cover: img.is_some(), cover: img.unwrap_or_default(), pinned, section: false,
|
||||
reasons: SharedString::from(e.reasons.join(" · ")), accent: accent(&e.title),
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let mut all = scan::full(&std::env::args().skip(1).filter(|a| !a.starts_with("--")).map(Into::into).collect::<Vec<_>>(), 4);
|
||||
let st = state::load();
|
||||
state::apply(&mut all, &st);
|
||||
let games: Vec<&Entry> = all.iter().filter(|e| e.kind == Kind::Game).collect();
|
||||
|
||||
let mut home: Vec<&Entry> = games.iter().copied().filter(|e| e.installed || e.playtime_minutes > 0).collect();
|
||||
home.sort_by(|a, b| st.pinned.contains(&b.id).cmp(&st.pinned.contains(&a.id)).then(b.playtime_minutes.cmp(&a.playtime_minutes)));
|
||||
home.truncate(14);
|
||||
let mut lib = games.clone();
|
||||
lib.sort_by(|a, b| b.installed.cmp(&a.installed).then(b.playtime_minutes.cmp(&a.playtime_minutes)));
|
||||
|
||||
let mut unf: Vec<Card> = vec![];
|
||||
for src in [Source::Steam, Source::Heroic, Source::Lutris, Source::Heuristic] {
|
||||
for (kind, label) in [(Kind::Game, "GAMES"), (Kind::Software, "SOFTWARE"), (Kind::Tool, "TOOLS")] {
|
||||
let mut items: Vec<&Entry> = all.iter().filter(|e| e.source == src && e.kind == kind && e.installed).collect();
|
||||
if items.is_empty() { continue; }
|
||||
items.sort_by(|a, b| a.title.to_lowercase().cmp(&b.title.to_lowercase()));
|
||||
let mut h = card(items[0], false, &st.artwork);
|
||||
h.section = true; h.title = SharedString::from(format!("{} · {} ({})", src_name(src), label, items.len()));
|
||||
unf.push(h);
|
||||
for e in items { unf.push(card(e, false, &st.artwork)); }
|
||||
}
|
||||
}
|
||||
|
||||
let total: u64 = all.iter().filter(|e| e.source == Source::Steam).map(|e| e.playtime_minutes).sum();
|
||||
let shot = std::env::var("SUMMIT_SHOT").ok();
|
||||
let build = || {
|
||||
let ui = MainWindow::new().unwrap();
|
||||
ui.set_home(ModelRc::new(VecModel::from(home.iter().map(|e| card(e, st.pinned.contains(&e.id), &st.artwork)).collect::<Vec<_>>())));
|
||||
ui.set_library(ModelRc::new(VecModel::from(lib.iter().map(|e| card(e, st.pinned.contains(&e.id), &st.artwork)).collect::<Vec<_>>())));
|
||||
ui.set_unfiltered(ModelRc::new(VecModel::from(unf)));
|
||||
ui.set_stats(format!("{} games in library · {} installed · {:.0} h on Steam", games.len(), games.iter().filter(|e| e.installed).count(), total as f64 / 60.0).into());
|
||||
ui.set_session(format!("{:?} · {:?}", display::detect_session(), display::detect_desktop()).into());
|
||||
if let Ok(t) = std::env::var("SUMMIT_TAB") { ui.set_tab(t.parse().unwrap_or(0)); }
|
||||
if let Ok(s) = std::env::var("SUMMIT_ANIM") { ui.set_anim_speed(s.parse().unwrap_or(1.0)); }
|
||||
ui
|
||||
};
|
||||
match shot { Some(d) => shoot(&d, build), None => build().run().unwrap() }
|
||||
}
|
||||
|
||||
/// Headless renderer for README screenshots: no display needed. Writes tab0..2.ppm into `dir`.
|
||||
fn shoot(dir: &str, build: impl FnOnce() -> MainWindow) {
|
||||
use slint::platform::software_renderer::{MinimalSoftwareWindow, RepaintBufferType, Rgb565Pixel};
|
||||
let _ = Rgb565Pixel::default();
|
||||
struct P(std::rc::Rc<MinimalSoftwareWindow>);
|
||||
impl slint::platform::Platform for P {
|
||||
fn create_window_adapter(&self) -> Result<std::rc::Rc<dyn slint::platform::WindowAdapter>, slint::PlatformError> { Ok(self.0.clone()) }
|
||||
}
|
||||
let win = MinimalSoftwareWindow::new(RepaintBufferType::NewBuffer);
|
||||
slint::platform::set_platform(Box::new(P(win.clone()))).unwrap();
|
||||
let (w, h) = (1600u32, 900u32);
|
||||
win.set_size(slint::PhysicalSize::new(w, h));
|
||||
let ui = build();
|
||||
ui.set_anim_speed(0.0);
|
||||
ui.show().unwrap();
|
||||
for t in 0..3 {
|
||||
ui.set_tab(t);
|
||||
slint::platform::update_timers_and_animations();
|
||||
let mut buf = vec![slint::Rgb8Pixel::default(); (w * h) as usize];
|
||||
win.draw_if_needed(|r| { r.render(&mut buf, w as usize); });
|
||||
let mut out = format!("P6\n{w} {h}\n255\n").into_bytes();
|
||||
for p in &buf { out.extend_from_slice(&[p.r, p.g, p.b]); }
|
||||
std::fs::write(format!("{dir}/tab{t}.ppm"), out).unwrap();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
import { ScrollView, Slider } from "std-widgets.slint";
|
||||
|
||||
export struct Card {
|
||||
title: string, hours: string, source: string, installed: bool,
|
||||
cover: image, has-cover: bool, pinned: bool, reasons: string, section: bool, accent: color,
|
||||
}
|
||||
|
||||
global Theme {
|
||||
out property <color> bg: #0b0d12;
|
||||
out property <color> panel: #12151c;
|
||||
out property <color> line: #1f2430;
|
||||
out property <color> text: #e8ebf2;
|
||||
out property <color> dim: #8a93a6;
|
||||
out property <color> accent: #ffb02e;
|
||||
// Animation speed multiplier, user tweakable (1.0 = default, 0 = off).
|
||||
in-out property <float> speed: 1.0;
|
||||
pure public function ms(base: int) -> duration { return (base * 1ms) / Math.max(root.speed, 0.01) * (root.speed > 0 ? 1 : 0); }
|
||||
}
|
||||
|
||||
component Tab inherits Rectangle {
|
||||
in property <string> label;
|
||||
in property <bool> active;
|
||||
callback clicked;
|
||||
width: l.preferred-width + 36px; height: 44px;
|
||||
background: transparent;
|
||||
l := Text { text: root.label; color: root.active ? Theme.text : Theme.dim; font-size: 15px; font-weight: root.active ? 700 : 500; horizontal-alignment: center; vertical-alignment: center;
|
||||
animate color { duration: Theme.ms(180); } }
|
||||
Rectangle { y: parent.height - 3px; height: 3px; border-radius: 2px; background: Theme.accent;
|
||||
width: root.active ? parent.width - 28px : 0px; x: (parent.width - self.width) / 2;
|
||||
animate width { duration: Theme.ms(260); easing: ease-out-expo; } }
|
||||
ta := TouchArea { clicked => { root.clicked(); } }
|
||||
}
|
||||
|
||||
component CoverCard inherits Rectangle {
|
||||
in property <Card> c;
|
||||
callback pin;
|
||||
width: 190px; height: 330px; background: transparent;
|
||||
property <bool> hot: ta.has-hover;
|
||||
box := Rectangle {
|
||||
width: parent.width; height: 285px; border-radius: 10px; clip: true; background: Theme.panel;
|
||||
y: root.hot ? -6px : 0px;
|
||||
animate y { duration: Theme.ms(180); easing: ease-out; }
|
||||
drop-shadow-blur: root.hot ? 26px : 8px; drop-shadow-color: root.hot ? Theme.accent.with-alpha(0.35) : #00000088; drop-shadow-offset-y: 6px;
|
||||
animate drop-shadow-blur { duration: Theme.ms(200); }
|
||||
if root.c.has-cover: Image { source: root.c.cover; width: parent.width; height: parent.height; image-fit: cover; opacity: root.c.installed ? 1.0 : 0.5; }
|
||||
if !root.c.has-cover: Rectangle {
|
||||
background: @linear-gradient(160deg, root.c.accent, #12151c);
|
||||
Text { text: root.c.title; color: white; font-size: 20px; font-weight: 800; wrap: word-wrap; width: parent.width - 28px; horizontal-alignment: center; vertical-alignment: center; }
|
||||
}
|
||||
Rectangle { y: parent.height - 52px; height: 52px; background: @linear-gradient(180deg, #00000000, #000000d0);
|
||||
Text { text: root.c.hours; color: Theme.accent; font-size: 13px; font-weight: 700; x: 12px; y: 24px; } }
|
||||
if !root.c.installed: Rectangle { x: 10px; y: 10px; width: 78px; height: 24px; border-radius: 12px; background: #000000b0;
|
||||
Text { text: "Not installed"; color: Theme.text; font-size: 11px; } }
|
||||
if root.c.pinned: Rectangle { x: parent.width - 34px; y: 10px; width: 24px; height: 24px; border-radius: 12px; background: Theme.accent;
|
||||
Text { text: "★"; color: #1a1300; font-size: 13px; font-weight: 800; } }
|
||||
}
|
||||
Text { y: 295px; text: root.c.title; color: Theme.text; font-size: 13px; font-weight: 600; width: parent.width; overflow: elide; }
|
||||
ta := TouchArea { clicked => { root.pin(); } }
|
||||
}
|
||||
|
||||
export component MainWindow inherits Window {
|
||||
title: "Summit";
|
||||
preferred-width: 1600px; preferred-height: 900px; background: Theme.bg;
|
||||
in property <[Card]> home;
|
||||
in property <[Card]> library;
|
||||
in property <[Card]> unfiltered;
|
||||
in property <string> stats;
|
||||
in property <string> session;
|
||||
in-out property <int> tab: 0;
|
||||
in-out property <float> anim-speed <=> Theme.speed;
|
||||
callback pin(int);
|
||||
|
||||
VerticalLayout {
|
||||
Rectangle { height: 64px; background: Theme.panel;
|
||||
Rectangle { y: parent.height - 1px; height: 1px; background: Theme.line; }
|
||||
HorizontalLayout { padding-left: 28px; padding-right: 28px; spacing: 8px; alignment: start;
|
||||
Text { text: "▲ SUMMIT"; color: Theme.accent; font-size: 19px; font-weight: 900; vertical-alignment: center; letter-spacing: 3px; }
|
||||
Rectangle { width: 36px; }
|
||||
Tab { label: "Home"; active: root.tab == 0; clicked => { root.tab = 0; } }
|
||||
Tab { label: "Library"; active: root.tab == 1; clicked => { root.tab = 1; } }
|
||||
Tab { label: "Unfiltered"; active: root.tab == 2; clicked => { root.tab = 2; } }
|
||||
Rectangle { horizontal-stretch: 1; }
|
||||
Text { text: "Animations"; color: Theme.dim; font-size: 12px; vertical-alignment: center; }
|
||||
Slider { width: 110px; minimum: 0; maximum: 2; value <=> Theme.speed; }
|
||||
Rectangle { width: 14px; }
|
||||
Text { text: root.session; color: Theme.dim; font-size: 12px; vertical-alignment: center; }
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
vertical-stretch: 1; clip: true;
|
||||
// Each tab is a layer that fades and slides; user speed scales it.
|
||||
Rectangle { opacity: root.tab == 0 ? 1 : 0; x: root.tab == 0 ? 0px : -30px; visible: self.opacity > 0.01;
|
||||
animate opacity { duration: Theme.ms(260); } animate x { duration: Theme.ms(300); easing: ease-out; }
|
||||
ScrollView { viewport-width: self.width;
|
||||
VerticalLayout { padding: 32px; spacing: 14px; alignment: start;
|
||||
Text { text: "Your most played"; color: Theme.text; font-size: 24px; font-weight: 800; }
|
||||
Text { text: root.stats; color: Theme.dim; font-size: 13px; }
|
||||
Rectangle { height: 6px; }
|
||||
Rectangle { height: 340px * ceil(root.home.length / 7.0);
|
||||
for c[i] in root.home: CoverCard { c: c; x: mod(i, 7) * 208px; y: floor(i / 7) * 345px; pin => { root.pin(i); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle { opacity: root.tab == 1 ? 1 : 0; x: root.tab == 1 ? 0px : (root.tab < 1 ? 30px : -30px); visible: self.opacity > 0.01;
|
||||
animate opacity { duration: Theme.ms(260); } animate x { duration: Theme.ms(300); easing: ease-out; }
|
||||
ScrollView { viewport-width: self.width;
|
||||
VerticalLayout { padding: 32px; spacing: 14px; alignment: start;
|
||||
Text { text: "Library"; color: Theme.text; font-size: 24px; font-weight: 800; }
|
||||
Text { text: "Installed and not installed. Click a cover to pin it to Home."; color: Theme.dim; font-size: 13px; }
|
||||
Rectangle { height: 6px; }
|
||||
Rectangle { height: 345px * ceil(root.library.length / 7.0);
|
||||
for c[i] in root.library: CoverCard { c: c; x: mod(i, 7) * 208px; y: floor(i / 7) * 345px; pin => { root.pin(i); } }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Rectangle { opacity: root.tab == 2 ? 1 : 0; x: root.tab == 2 ? 0px : 30px; visible: self.opacity > 0.01;
|
||||
animate opacity { duration: Theme.ms(260); } animate x { duration: Theme.ms(300); easing: ease-out; }
|
||||
ScrollView { viewport-width: self.width;
|
||||
VerticalLayout { padding: 32px; spacing: 3px; alignment: start;
|
||||
Text { text: "Unfiltered"; color: Theme.text; font-size: 24px; font-weight: 800; }
|
||||
Text { text: "Everything Summit found, and why."; color: Theme.dim; font-size: 13px; }
|
||||
Rectangle { height: 10px; }
|
||||
for c in root.unfiltered: Rectangle {
|
||||
height: c.section ? 40px : 30px;
|
||||
if c.section: Text { x: 0px; text: c.title; color: Theme.accent; font-size: 13px; font-weight: 800; letter-spacing: 1.5px; y: 14px; }
|
||||
if !c.section: Rectangle { background: Theme.panel; border-radius: 5px;
|
||||
Rectangle { x: 0; width: 3px; background: c.accent; }
|
||||
Text { x: 16px; text: c.title; color: Theme.text; font-size: 13px; font-weight: 600; vertical-alignment: center; width: 330px; overflow: elide; }
|
||||
Text { x: 360px; text: c.hours; color: Theme.dim; font-size: 12px; vertical-alignment: center; width: 90px; }
|
||||
Text { x: 460px; text: c.reasons; color: Theme.dim; font-size: 12px; vertical-alignment: center; width: parent.width - 480px; overflow: elide; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 755 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 753 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 82 KiB |
Reference in new issue
Block a user