voelin-gpui: VOELIN_DEMO_SERVER, the logged Move to my channel, and what a click costs
- VOELIN_DEMO_SERVER=<0..2> puts another sample server on screen: the second is observed and the third is not connected, both with empty trees, which is how the pictures of an empty server are made. - The person's context menu offers Move to my channel; the engine has no command to move another client, so the action is logged. - A test that holds what the caches cannot save: pressing and releasing a clickable element refresh the window, so a click renders every pane, and a hover renders only the pane the pointer is over. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
26302bcdde
commit
aa640cf2b0
5 files changed
+119
-4
No files matched your search
@@ -9,6 +9,9 @@
|
||||
//! skipped.
|
||||
//! - `VOELIN_DEMO_UI=1`: the Slint front end's sample servers, shown through
|
||||
//! the app's own events; nothing is sent to the engine or kept in the store.
|
||||
//! - `VOELIN_DEMO_SERVER=2`: with `VOELIN_DEMO_UI`, the sample server on
|
||||
//! screen, counting from 0 (the first, which is connected and populated, is
|
||||
//! the default; the second is observed, the third not connected).
|
||||
//! - `VOELIN_DEMO_TALK=10`: with `VOELIN_DEMO_UI`, one of the sample people
|
||||
//! starts and stops talking this many times a second, through the app's own
|
||||
//! events (what the meter measures while someone talks).
|
||||
@@ -39,6 +42,9 @@ pub struct Switches {
|
||||
pub open: Page,
|
||||
/// Show the sample servers instead of the stored ones.
|
||||
pub demo_ui: bool,
|
||||
/// The sample server to show, by its place in the list, when the switch
|
||||
/// names one.
|
||||
pub demo_server: Option<usize>,
|
||||
/// How many times a second a sample person starts or stops talking (with
|
||||
/// the sample servers), when the switch names a rate.
|
||||
pub demo_talk: Option<f32>,
|
||||
@@ -57,6 +63,7 @@ impl Default for Switches {
|
||||
Self {
|
||||
open: Page::Shell,
|
||||
demo_ui: false,
|
||||
demo_server: None,
|
||||
demo_talk: None,
|
||||
theme: None,
|
||||
font_scale: None,
|
||||
@@ -104,6 +111,12 @@ impl Switches {
|
||||
None => tracing::warn!("VOELIN_WINDOW_SIZE={text}: WIDTHxHEIGHT, such as 1440x960"),
|
||||
}
|
||||
}
|
||||
if let Some(text) = get("VOELIN_DEMO_SERVER") {
|
||||
match text.trim().parse::<usize>() {
|
||||
Ok(place) if place < 3 => switches.demo_server = Some(place),
|
||||
_ => tracing::warn!("VOELIN_DEMO_SERVER={text}: 0, 1 or 2 (a sample server)"),
|
||||
}
|
||||
}
|
||||
if let Some(text) = get("VOELIN_DEMO_TALK") {
|
||||
match text.trim().parse::<f32>() {
|
||||
Ok(rate) if (0.1..=100.0).contains(&rate) => switches.demo_talk = Some(rate),
|
||||
@@ -146,6 +159,7 @@ mod tests {
|
||||
let s = env(&[
|
||||
("VOELIN_OPEN", "swatch"),
|
||||
("VOELIN_DEMO_UI", "1"),
|
||||
("VOELIN_DEMO_SERVER", "2"),
|
||||
("VOELIN_DEMO_TALK", "10"),
|
||||
("VOELIN_DEV_THEME", "light"),
|
||||
("VOELIN_FONT_SCALE", "1.25"),
|
||||
@@ -154,6 +168,7 @@ mod tests {
|
||||
]);
|
||||
assert_eq!(s.open, Page::Swatch);
|
||||
assert!(s.demo_ui);
|
||||
assert_eq!(s.demo_server, Some(2));
|
||||
assert_eq!(s.demo_talk, Some(10.0));
|
||||
assert_eq!(s.theme, Some(Choice::Light));
|
||||
assert_eq!(s.font_scale, Some(1.25));
|
||||
@@ -169,6 +184,7 @@ mod tests {
|
||||
("VOELIN_FONT_SCALE", "9"),
|
||||
("VOELIN_WINDOW_SIZE", "10x10"),
|
||||
("VOELIN_DEMO_UI", "0"),
|
||||
("VOELIN_DEMO_SERVER", "7"),
|
||||
("VOELIN_DEMO_TALK", "fast"),
|
||||
("VOELIN_METER", "0"),
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user