tweak ui, clippy, modify desktop finder blacklist

This commit is contained in:
Aleksander
2026-01-04 12:48:18 +01:00
parent 40313cd6bc
commit ccc9f9ebb2
4 changed files with 46 additions and 34 deletions

View File

@@ -1,5 +1,6 @@
use std::{
collections::HashSet, ffi::OsStr, fmt::Debug, fs::exists, io::Write, path::Path, rc::Rc, sync::Arc, thread::JoinHandle, time::Instant
collections::HashSet, ffi::OsStr, fmt::Debug, fs::exists, path::Path, rc::Rc, sync::Arc, thread::JoinHandle,
time::Instant,
};
use ini::Ini;
@@ -39,7 +40,7 @@ const CMD_BLOCKLIST: [&str; 3] = [
"vrurlhandler",
];
const CATEGORY_TYPE_BLOCKLIST: [&str; 5] = ["GTK", "Qt", "X-XFCE", "X-Bluetooth", "ConsoleOnly"];
const CATEGORY_TYPE_BLOCKLIST: [&str; 1] = ["ConsoleOnly"];
struct DesktopFinderParams {
size_preferences: Vec<&'static OsStr>,
@@ -272,15 +273,13 @@ impl DesktopFinder {
return Ok(file_path);
}
let svg = identicons_svg::generate(
identicons_svg::IdenticonOptions {
let svg = identicons_svg::generate(identicons_svg::IdenticonOptions {
background: identicons_svg::Background {
r: 64,
color: "rgba(0.9,0.9,0.9,0.5)".into()
color: "rgba(0.9,0.9,0.9,0.5)".into(),
},
..Default::default()
}
);
});
std::fs::write(&file_path, svg)?;
Ok(file_path)

View File

@@ -1,5 +1,6 @@
<layout>
<macro name="window_button" padding="4" align_items="center" />
<macro name="window_button" min_width="40" min_height="40" padding="4" align_items="center" />
<macro name="window_button_icon" width="32" height="32" />
<elements>
<div flex_grow="1" height="48">
@@ -16,12 +17,12 @@
<div gap="4">
<Button macro="window_button" _release="::EditToggle"
border_color="~color_faded_translucent" color="~color_faded_50" color2="~color_faded_10">
<sprite width="28" height="28" src="watch/edit.svg" />
<sprite macro="window_button_icon" src="watch/edit.svg" />
</Button>
<Button macro="window_button" _release="::DecorCloseWindow"
border_color="~color_danger_translucent" color="~color_danger_50" color2="~color_danger_10">
<sprite width="32" height="32" src="edit/close.svg" />
<sprite macro="window_button_icon" src="edit/close.svg" />
</Button>
</div>

View File

@@ -14,9 +14,13 @@
/>
<macro name="button_style" border="2" border_color="~color_accent_translucent" color="~color_bg" round="8"
align_items="center" justify_content="center" padding="8" width="80" height="80"/>
align_items="center" justify_content="center" padding="8" width="80" height="80" />
<macro name="bg_rect" width="100%" color="~color_bg" round="16" border="2" border_color="~color_accent"/>
<macro name="bg_rect" width="100%" color="~color_bg" round="16" border="2" border_color="~color_accent" />
<template name="VerticalSeparator">
<rectangle width="2" height="100%" color="~color_accent" />
</template>
<!-- The keyboard is build from the xkb keymap. This file is for customizing the keycaps. -->
@@ -126,22 +130,30 @@
<elements>
<div flex_direction="column" interactable="0">
<rectangle macro="bg_rect" padding="16" align_items="center" justify_content="space_between">
<div id="bar_root" gap="4">
<Screen idx="0" display="H1" tooltip="Screen: HDMI-A-1"/>
<Screen idx="1" display="D2" tooltip="Screen: DP-2"/>
<Mirror idx="1" display="1" tooltip="Mirror: M-1"/>
<Panel idx="1" display="Test" tooltip="Panel: Test"/>
<div gap="16">
<div id="panels_root_TODO" gap="8">
<Screen idx="0" display="H1" tooltip="Screen: HDMI-A-1" />
<Screen idx="1" display="D2" tooltip="Screen: DP-2" />
<Mirror idx="1" display="1" tooltip="Mirror: M-1" />
<Panel idx="1" display="Test" tooltip="Panel: Test" />
</div>
<VerticalSeparator />
<div id="apps_root_TODO" gap="8">
<App id="test1" src="/usr/share/icons/hicolor/scalable/apps/blender-5.0.svg" tooltip="App: Blender" />
<App id="test2" src="/usr/share/icons/hicolor/scalable/apps/org.inkscape.Inkscape.svg" tooltip="App: Inkscape" />
<App id="test3" src="/usr/share/icons/hicolor/scalable/apps/gimp.svg" tooltip="App: GIMP" />
</div>
<div id="tray_root" flex_direction="row" gap="8" padding_left="8" padding_right="8">
</div>
<div id="tray_root" flex_direction="row" gap="16">
<div id="sets_root" flex_direction="row" gap="8">
<Set idx="0" display="1" />
<Set idx="1" display="2" />
</div>
<div align_items="center" flex_direction="column" gap="4" padding_left="8" padding_right="8">
<label text="23:59" _source="clock" _display="time" size="28" />
<VerticalSeparator />
<div flex_direction="column" gap="4" align_items="center">
<label text="23:59" _source="clock" _display="time" size="32" weight="bold" />
<label text="Tuesday" _source="clock" _display="dow" size="22" />
<label text="22/2/2022" _source="clock" _display="date" size="22" />
</div>

View File

@@ -148,7 +148,7 @@ impl WvrWindowBackend {
let mut panel = GuiPanel::new_from_template(
app,
"gui/decor.xml",
window.clone(),
window,
NewGuiPanelParams {
resize_to_parent: true,
on_custom_attrib: Some(on_custom_attrib),
@@ -429,7 +429,7 @@ impl OverlayBackend for WvrWindowBackend {
return HoverResult::default();
};
let mut hit2 = hit.clone();
let mut hit2 = *hit;
hit2.uv.y *= meta.extent[1] as f32 / (meta.extent[1] - self.inner_extent[1]) as f32;
self.panel_hovered = true;
return self.panel.on_hover(app, &hit2);