Enlightenment CVS committal

Author  : devilhorns
Project : e_modules
Module  : cpu

Dir     : e_modules/cpu


Modified Files:
        cpu.edc e_mod_main.c 


Log Message:
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.

===================================================================
RCS file: /cvs/e/e_modules/cpu/cpu.edc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- cpu.edc     11 Oct 2006 20:52:32 -0000      1.15
+++ cpu.edc     7 Feb 2007 16:50:16 -0000       1.16
@@ -8,6 +8,16 @@
    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 @@
             part
               {
                  name:           "load";
-                 type:           TEXT;
+                 type:           TEXTBLOCK;
                  effect:         SOFT_SHADOW;
                  mouse_events: 0;
                  clip_to: "fade_clip";
@@ -71,19 +81,10 @@
                            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;
+                           }
               }
          }
      }
===================================================================
RCS file: /cvs/e/e_modules/cpu/e_mod_main.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -3 -r1.34 -r1.35
--- e_mod_main.c        4 Feb 2007 02:07:47 -0000       1.34
+++ e_mod_main.c        7 Feb 2007 16:50:16 -0000       1.35
@@ -192,11 +192,15 @@
    
    _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++;
      }



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to