papyros / qml-material

:book: Material Design implemented in QtQuick
GNU Lesser General Public License v2.1
2.57k stars 476 forks source link

dp() problems on Android #489

Open PoisonousJohn opened 8 years ago

PoisonousJohn commented 8 years ago

I tried to launch app on my Xiaomi Mi4c and it looks like this:

screenshot_2016-11-05-13-58-10

but when i launch it for desktop target, it looks like this:

2016-11-05 21 41 19

It seems that dp function works wrong for me. Is it a bug? If so, do you have any suggestions on how to fix this bug?

PoisonousJohn commented 8 years ago

I tracked down bug. I changed this line

https://github.com/papyros/qml-material/blob/develop/src/core/units.cpp#L78

to

    return dp > 0 ? dp : m_multiplier;

If I got it right, dpi() / 160 -- is a calculation of multiplier, thus there is no need to multiply dp by multiplier.

This worked for me. Is this appropriate solution?

yangxingpping commented 7 years ago

I have the similar problem, when I run the demo with qmlscene, it's looks very uncomfortable(too small), the platform is iMac with Win10. But looks well on an other PC. As I Use QtCreator to create an Qt Quick 2 Application Style empty demo. It's also looks well on iMac with Win10. So i edit the Material\Units.qml,replace function dp(number)with function dp(number) {return number;}, But i don't know why

timsueberkrueb commented 7 years ago

Qt >= 5.6 has built-in proper high dpi support. QML Material is also no longer being developed. I'd recommend checking out the new QtQuick Controls 2 with Material Style and Fluid.