View Single Post
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#218
Originally Posted by porselinaheart View Post
can anybody be so kind as to point me to where i should be looking to change the alarm 'on' icon for the decimal clock?? is it an actual png?, or is it in the code ( enlarged fullstop character ) if its the latter, can i have some help locating where in the code i need to edit to change its color?
theonelaw gave a pretty nice answer, but basically, everything you see in the clock styles is drawn with "Cairo". Cairo is a vector image editing program, pretty basis, but pretty flexible.

It basically has the ability to draw defined shapes - either rectangular, or arc-based ones. So, boxes or ovals, of any size, color, and shape.

The alarm indicator is a circle - the Python code basically says "load the python-cairo interface", twiddles it's thumbs and does other stuff for a while, then says, okay, for this data, use cairo to draw X, for that data draw Y, etc. (Cairo can do text too, which is what draws the time/date/whatever.) For the alarm indicator, the code basically says "at the following location [starting from where the clock applet's space starts], using rgb values of 1.0, 0.0, 0.0, and of the following shape and size, draw me an arc-defined shape."

You can look up a cairo tutorial - combined with some basic geometry/trigonometry understanding, almost anything you can do with Cairo for a clock style is a piece of cake. It MAY be able to display an actual image though; I've been contemplating doing that for a while now, if possible.
 

The Following 2 Users Say Thank You to Mentalist Traceur For This Useful Post: