Add a clock widget

Bug #661439 reported by RJ Skerry-Ryan on 2010-10-15
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Mixxx
Wishlist
Till Hofmann

Bug Description

It'd be nice if skins could add a clock widget.

RJ Skerry-Ryan (rryan) on 2010-10-15
Changed in mixxx:
importance: Undecided → Wishlist
status: New → Confirmed
RJ Skerry-Ryan (rryan) on 2010-10-15
tags: added: easy weekend

This would be a near-essential feature for radio use.

tags: added: radio
Till Hofmann (morxa) on 2011-04-28
Changed in mixxx:
assignee: nobody → Till Hofmann (hofmanntill)
status: Confirmed → In Progress
Till Hofmann (morxa) wrote :

I added a class WTime, which shows the current time. It is inherited from WLabel.
Also, I added center alignment for WLabel.

The time can be shown in different formats, which can be set by the skin.

The node <ClockFormat> determines whether the time is shown in 24 hour format or 12 hour format.
"24" and "24hrs" set the the format to 24 hour format.
"12", "12hrs" and "12ap" set the format to to 12 hour format (e.g. 1:45 am).
"12AP" sets it to 12 hour format with capitalized AM/PM (e.g. 1:45 AM).
Default is "12AP".

<ShowSeconds> determines, whether seconds are shown or not. Default is false.

Also, you can set a custom format with "CustomFormat", which accepts the same expressions as QTime::toString (http://doc.trolltech.com/latest/qtime.html#toString)

Till Hofmann (morxa) wrote :

I modified the skin Outline1024x600-Netbook to have an example skin which shows the time.

Once the patch is committed to trunk, I'll add an entry to the wiki to explain how the time widget works.

jus (jus) wrote :

Please think again about the hardcoded alignment properties.
The <Alignment> key is kinda deprecated , current skins use stylesheets for text properties.

Have a look at https://bugs.launchpad.net/mixxx/+bug/605530

Till Hofmann (morxa) wrote :

OK, thanks jus, I didn't know that. But the stylesheets don't work? That was the first thing I tried, I just changed the alignment in the stylesheet, but it didn't change anything. The fix for #605530 is not in trunk yet, is it?

I attached a new patch which doesn't add center alignment.

jus (jus) wrote :

Tested your patch and i like it a lot. These various options are pretty nice.

However you are correct that there is something odd with the alignment. Alignment via stylesheets wont work, so doesn't the manual <Alignment> key which should work as fallback (even without your code changes).

So the alignment fix in trunk from lp:605530 might be incomplete.

Till Hofmann (morxa) wrote :

I think this is ready to commit since the alignment fix has nothing to do with this widget.

jus (jus) wrote :

This nice feature should not be forgotten. I have updated the patch for latest lp:mixxx .
If there is nothing against it, the patch should go into trunk so we can update the skins to have a clock in v1.10 too.

Changed in mixxx:
milestone: none → 1.10.0
jus (jus) wrote :

Adding example for testing the patch with the current LateNight1280x800 skin.

jus (jus) wrote :
RJ Skerry-Ryan (rryan) wrote :

Sorry this took so long to add, Till. Your patch was perfect except for the use of tabs instead of 4-spaces for indentation as per our style guide (see here: http://mixxx.org/wiki/doku.php/coding_guidelines)

I went ahead and converted the tabs to spaces and committed it to lp:mixxx so it will be part of 1.10.

Thanks so much Till!

Changed in mixxx:
status: In Progress → Fix Committed
Till Hofmann (morxa) wrote :

sorry about the tab indentation... I thought I set my editor to 4-space indentations but apparently I didn't. I'm glad the patch made it to trunk!

RJ Skerry-Ryan (rryan) on 2011-12-25
Changed in mixxx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers