Commit graph

4 commits

Author SHA1 Message Date
Sebastian Kügler
53024ca76d try to fix profile scaling
Different approach here:

- profile gets a bit higher, this was requested on the mailinglist, and
  seems to behave much better with the painted profile, we'd otherwise
  get it magically clipped on the right hand side.
- Make the scaling dpi aware, this fixes scaling for me on the Nexus7, I
  haven't been able to test it properly on other devices, so this needs
  some more testing. The result is visually quite close to what we can
  do, although I'm still getting a somewhat larger margin on the right.
  To get at the devicePixelRatio without too much custom code, I've
  added a property to the QMLProfile to retrieve it from the theme engine.

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-01-13 16:27:41 -08:00
Dirk Hohndel
ef653b41f5 QML UI: obtain a reasonable margin from QML
This will be used later in the positioning of the profile.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-29 09:50:47 -08:00
Sebastian Kügler
3da912cda8 Cache diveprofile widget in the diveprofile QtQuick item
- paint() can become a hot path, especially when we think about
  repainting the item on size changes. In general, it's a really good
  idea to keep this function as fast as possible, as we want to be able to
  repaint the item when needed. Also, ProfileWidget is pretty heavy to
  set up, so rather spend a bit of memory there.

- Rename profile to m_profileWidget, it already was member var.

- Sizing ... I have to admit I don't understand the rendering of the
  ProfileWidget. I'd like it to do the following things:
	- render at native resolution, we don't want to resize it
	- react to item changes - we want to reset the size and
	  re-render the widget into the item in those cases
	- perhaps be able to use a couple more of the profilewidget's
	  features

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-11 19:06:00 -08:00
Grace Karanja
59232ca172 QML UI: Add QMLProfile class
Add a C++ class to render the dive profile. The rendered image is then
passed on to QML.

Signed-off-by: Grace Karanja <gracie.karanja89@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-17 12:00:29 -07:00