Hi guys,
Here is a small patch that makes the clock a bit easier to be read, by
adding a small label displaying the current time when the mouse is
over it (same way as labels in the ibox).
I know that Raster wants to keep the clock module as minimal as
possible, so I understand if it's not committed but I just thought that
maybe it could interest other people.
Here is how the clock looks like when the mouse is over it:
http://mtreny.free.fr/e17_clock.png
Regards,
Simon TRENY <MoOm>
Index: default_clock.edc
===================================================================
RCS file: /cvs/e/e17/apps/e/data/themes/default_clock.edc,v
retrieving revision 1.13
diff -u -r1.13 default_clock.edc
--- default_clock.edc 23 Aug 2006 03:39:01 -0000 1.13
+++ default_clock.edc 14 Feb 2007 05:55:01 -0000
@@ -187,6 +187,7 @@
script {
public clock_cb(val) {
new buf[11];
+ new bufh[11], bufm[11], bufs[11];
new year, month, day, yearday, weekday, hour, minute;
new Float:second;
new v;
@@ -209,12 +210,21 @@
if (v < 10) {snprintf(buf, 10, "0%i", v);}
else {snprintf(buf, 10, "%i", v);}
set_state(PART:"minutes", buf, 0.0);
-
- v = ((hour % 12) * 5) + ((minute * 5) / 60);
+
+ v = ((hour % 12) * 5) + ((minute * 5) / 60);
buf[0] = 0;
if (v < 10) {snprintf(buf, 10, "0%i", v);}
else {snprintf(buf, 10, "%i", v);}
set_state(PART:"hour", buf, 0.0);
+
+ if (hour < 10) {snprintf(bufh, 10, "0%i", hour);}
+ else {snprintf(bufh, 10, "%i", hour);}
+ if (minute < 10) {snprintf(bufm, 10, "0%i", minute);}
+ else {snprintf(bufm, 10, "%i", minute);}
+ if (second < 10) {snprintf(bufs, 10, "0%i", round(second));}
+ else {snprintf(bufs, 10, "%i", round(second));}
+ snprintf(buf, 10, "%s:%s:%s", bufh, bufm, bufs);
+ set_text(PART:"time_label", buf);
}
}
parts {
@@ -526,6 +536,49 @@
}
}
}
+ part {
+ name: "time_label";
+ type: TEXT;
+ effect: SOFT_SHADOW;
+ mouse_events: 0;
+ description {
+ state: "default" 0.0;
+ align: 0.5 0.5;
+ rel1 {
+ relative: 0.0 1.0;
+ offset: 0 -1;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 255 255 255 0;
+ color3: 0 0 0 0;
+ color_class: "module_label";
+ text {
+ text: "Tesyou";
+ font: "Edje-Vera-Bold";
+ size: 9;
+ min: 1 1;
+ align: 0.5 0.5;
+ text_class: "module_normal";
+ }
+ }
+ description {
+ state: "visible" 0.0;
+ inherit: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ offset: 0 0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ offset: -1 -1;
+ }
+ color: 255 255 255 255;
+ color3: 0 0 0 42;
+ }
+ }
}
programs {
program {
@@ -535,6 +588,22 @@
script {
clock_cb(0);
}
+ }
+ program {
+ name: "show_time_label";
+ signal: "mouse,in";
+ source: "bg";
+ action: STATE_SET "visible" 0.0;
+ transition: SINUSOIDAL 0.5;
+ target: "time_label";
+ }
+ program {
+ name: "hide_time_label";
+ signal: "mouse,out";
+ source: "bg";
+ action: STATE_SET "default" 0.0;
+ transition: SINUSOIDAL 1.0;
+ target: "time_label";
}
}
}
-------------------------------------------------------------------------
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-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel