Add a clock widget

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

Bug Description

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

RJ Skerry-Ryan (rryan)
Changed in mixxx:
importance: Undecided → Wishlist
status: New → Confirmed
RJ Skerry-Ryan (rryan)
tags: added: easy weekend
Revision history for this message
Sean M. Pappalardo (pegasus-renegadetech) wrote :

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

tags: added: radio
Till Hofmann (morxa)
Changed in mixxx:
assignee: nobody → Till Hofmann (hofmanntill)
status: Confirmed → In Progress
Revision history for this message
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)

Revision history for this message
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.

Revision history for this message
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

Revision history for this message
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.

Revision history for this message
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.

Revision history for this message
Till Hofmann (morxa) wrote :

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

Revision history for this message
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
Revision history for this message
jus (jus) wrote :

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

Revision history for this message
jus (jus) wrote :
Revision history for this message
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
Revision history for this message
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)
Changed in mixxx:
status: Fix Committed → Fix Released
Revision history for this message
Swiftb0y (swiftb0y) wrote :

Mixxx now uses GitHub for bug tracking. This bug has been migrated to:
https://github.com/mixxxdj/mixxx/issues/5566

lock status: Metadata changes locked and limited to project staff
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.