-
Notifications
You must be signed in to change notification settings - Fork 695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pixels, dimensions inside and of the widget #19
Comments
For the second question; the Text Field component inherits from
|
Ok, so to implement the error message, error line or char counter I should just add some more spacing at the bottom... |
Sounds reasonable, but you'll have to give it some trial-and-error most likely. These (counter and error message) could be given their own classes also, to avoid complicating the code in the main Text Field component. Kind of how the label is implemented now if you look in |
My question about inside measures regards this data present on material.io:
How do I translate these measures to Qt? Is 16sp font equivalent to setPointSize(16)? It seems to me that setPointSize(16) is too big of a font... And 56dp in pixels? |
Yeah, I haven't followed this very rigorously. Here is the definition of Android's Density-independent pixel unit, to start with:
My understanding of sp is that it is similar, except that it is subject to a scale factor which depends on the user settings. So in your example, I think (I could be wrong here) that, assuming;
then 16sp would be equivalent to setPixelSize(16) (not point size). We could introduce some helper methods for doing this conversion, using the QScreen class for example:
The bigger question here, however, is how much of this should be determined by the widgets? For example, if the Material design guidelines say that a Flat Button should be exactly x dp high, this is not really how Qt's layout system works. I mean, layouts are designed to be fluid and if we start to set fixed sizes for everything, that would be weird, I think. The way it works now is that a default size is given for fonts and icons, and reasonable size hints are specified in the various QWidget subclasses. One way to think of it is that it would then be up to the user of the library to make sure that the widgets are used in a way that is consistent with the Material guidelines. I don't know if this is the best approach. Do you have any ideas? |
I'm not sure I have a clear idea on how to handle Material widgets in Qt layouts... they are completely different beast with their own peculiarities... For example List/ListItem are good for a mobile phone screen but would be really strange on a 46" monitor if used full screen as in the mobile... and both screen have the same resolution !!!!! Material is really nice looking thanks to proper graphical design, and this includes proportions between objects, displacements, font sizes color and opacity. I'd like to adhere as much as possible to the standard and of course leave to the programmer the possibility to modify everything. |
Can you please spend a little time to document in the wiki:
f.e. in this widget https://material.io/guidelines/components/expansion-panels.html#expansion-panels-behavior and if you scroll above, all the other settings.
Thanks
The text was updated successfully, but these errors were encountered: