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:
Christopher Michael 2007-02-07 16:50:16 +00:00
parent 57d3828f26
commit 0c1917ed45
2 changed files with 21 additions and 16 deletions

29
cpu.edc
View File

@ -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;
}
}
}
}

View File

@ -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++;
}