[Digital Clock] Bug fixes and ui code optimization
ClosedPublic

Authored by romangg on Dec 9 2016, 2:19 AM.

Details

Summary

This patch is meant to improve the Digital Clock applet in the following ways:

  • Fixed timezone size and alignment in vertical mode
  • Instead of Flow uses Grid for labels as it's simpler and gives better control over alignment
  • Seperator in small horizontal mode centered between date and time and in height now dependent on label size
  • Less empty space around time in small horizontal mode
  • Binding loop and initlializting anchor errors fixed
  • Element now size completely down and have always the same ratio to each other (with the time being the largest)
  • Round functions removed since they disrupted the resizing for small sizes

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
romangg updated this revision to Diff 8884.Dec 9 2016, 2:19 AM
romangg retitled this revision from to [Digital Clock] Bug fixes and ui code optimization.
romangg updated this object.
romangg edited the test plan for this revision. (Show Details)
romangg added a reviewer: Plasma.
romangg set the repository for this revision to R120 Plasma Workspace.
romangg added a project: Plasma.
romangg added a subscriber: plasma-devel.
mart requested changes to this revision.Dec 9 2016, 4:47 PM
mart added a reviewer: mart.
mart added a subscriber: mart.
mart added inline comments.
applets/digital-clock/package/contents/ui/DigitalClock.qml
57

here you are comparing points and pixels

This revision now requires changes to proceed.Dec 9 2016, 4:47 PM
romangg added inline comments.Dec 9 2016, 5:19 PM
applets/digital-clock/package/contents/ui/DigitalClock.qml
211

@mart : Should this also stay in pixelSize? I assume in general always when comparing heights and font sizes, right?

mart added a comment.Dec 12 2016, 11:03 AM

yes, if you are comparing with an item height, it should stay in pixelSize

romangg updated this revision to Diff 9354.Dec 25 2016, 4:29 PM
romangg edited edge metadata.
romangg marked 2 inline comments as done.

Reduced code complexity (in particular only one date label for all states now) and optimized layouting in general.

romangg updated this object.Dec 25 2016, 4:36 PM
romangg edited edge metadata.
mart added a comment.Jan 2 2017, 4:50 PM

I'm afraid we're still not there: if i slowly resize the panel, for most sized is ok, but if i get it just the right size, that's what i get:

mart added a comment.Jan 2 2017, 5:25 PM

the problem for me is sizehelper having a wrong size when the state is horizontalPanelSmall

if i add an huge pixelSize to sizehelper (as it was used to have), the layout problem is fixed

applets/digital-clock/package/contents/ui/DigitalClock.qml
531

add the following line here:
font.pixelSize: 1024
it fixes the smallhorizontalpanel case for me

mart requested changes to this revision.Jan 2 2017, 5:25 PM
mart edited edge metadata.
This revision now requires changes to proceed.Jan 2 2017, 5:25 PM
romangg updated this revision to Diff 9657.Jan 3 2017, 2:04 PM
romangg edited edge metadata.
romangg marked an inline comment as done.
  • Fixed pixelSize of sizehelper.
  • Only changes now to small horizontal mode if date or timezone visible (no sudden size change when resizing with clock only visible).
mart accepted this revision.Jan 3 2017, 2:11 PM
mart edited edge metadata.
This revision is now accepted and ready to land.Jan 3 2017, 2:11 PM
This revision was automatically updated to reflect the committed changes.