fix: avoid selectable labels for dynamic info (#270)

Make InfoRow labels not selectable by default. Allow an override of the attribute in the template (for Software tab for example).

Motivation:
GTK will place the blinking cursor on the first selectable label of a view/tab. Placing the cursor on dynamic info like the current GPU Core Clock will show the cursor jumping around as the number of digits change a lot (best seen in the OC tab).

As the selection of a label is discarded on update of a label (which happens multiple times a second for a lot of the OC and Thermals values) the cursor is just a visual distraction rather than a feature.
This commit is contained in:
Mershl 2024-02-22 21:18:02 +01:00 committed by GitHub
parent 749bb1d91c
commit e91bc46a0f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 1 deletions

View File

@ -37,6 +37,8 @@ mod imp {
name: RefCell<String>,
#[property(get, set)]
value: RefCell<String>,
#[property(get, set)]
selectable: RefCell<bool>,
#[template_child]
value_label: TemplateChild<Label>,

View File

@ -14,7 +14,7 @@ template $InfoRow: Box {
Label value_label {
label: bind template.value;
halign: end;
selectable: true;
selectable: bind template.selectable;
use-markup: true;
}
}

View File

@ -11,15 +11,18 @@ template $SoftwarePage: Box {
$InfoRow {
name: "LACT Daemon:";
value: bind template.daemon_version;
selectable: true;
}
$InfoRow {
name: "LACT GUI:";
value: bind template.gui_version;
selectable: true;
}
$InfoRow {
name: "Kernel Version:";
value: bind template.kernel_version;
selectable: true;
}
}