Make cpu use a textblock for the edc. Allows multi-core cpu's to display
much better, regardless if they are in a horizontal or vertical shelf. SVN revision: 28287
This commit is contained in:
parent
57d3828f26
commit
0c1917ed45
29
cpu.edc
29
cpu.edc
|
@ -8,6 +8,16 @@ fonts
|
|||
font: "VeraMono.ttf" "VeraMono";
|
||||
}
|
||||
|
||||
styles
|
||||
{
|
||||
style {
|
||||
name: "cpu_style";
|
||||
base: "font=VeraMono font_size=10 text_class=tb_plain align=center color=#fff style=shadow shadow_color=#00000080 wrap=word";
|
||||
|
||||
tag: "br" "\n";
|
||||
}
|
||||
}
|
||||
|
||||
collections
|
||||
{
|
||||
group
|
||||
|
@ -53,7 +63,7 @@ collections
|
|||
part
|
||||
{
|
||||
name: "load";
|
||||
type: TEXT;
|
||||
type: TEXTBLOCK;
|
||||
effect: SOFT_SHADOW;
|
||||
mouse_events: 0;
|
||||
clip_to: "fade_clip";
|
||||
|
@ -71,19 +81,10 @@ collections
|
|||
relative: 1.0 1.0;
|
||||
to: "cpu";
|
||||
}
|
||||
color: 255 255 255 255;
|
||||
color3: 0 0 0 42;
|
||||
color_class: "module_label";
|
||||
text
|
||||
{
|
||||
text: "0%";
|
||||
font: "VeraMono";
|
||||
size: 10;
|
||||
min: 1 1;
|
||||
align: 0.5 0.5;
|
||||
text_class: "module_large";
|
||||
}
|
||||
}
|
||||
text {
|
||||
style: "cpu_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,11 +192,15 @@ _set_cpu_load(void *data)
|
|||
|
||||
_get_cpu_load();
|
||||
|
||||
snprintf(str, sizeof(str), "%d%%", cpu_stats[0]);
|
||||
if (cpu_count == 1)
|
||||
snprintf(str, sizeof(str), "<br>%d%%", cpu_stats[0]);
|
||||
else
|
||||
snprintf(str, sizeof(str), "%d%%", cpu_stats[0]);
|
||||
|
||||
i = 1;
|
||||
while (i < cpu_count)
|
||||
{
|
||||
snprintf(str_tmp, sizeof(str_tmp), " / %d%%", cpu_stats[i]);
|
||||
snprintf(str_tmp, sizeof(str_tmp), "<br>%d%%", cpu_stats[i]);
|
||||
strncat(str, str_tmp, sizeof(str));
|
||||
i++;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue