Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
adamlu
Posts: 14
Registered: ‎11-19-2012
My Device: 9900, BB10 Simulator

Fix font size for Sheet, Button and DropDown components

Anyone knows how to have a fixed font size for DropDown, Sheet and Button components in QML?

 

I have an edit page that is a page made by QML Sheet component. It has many QML components including TextFields, Buttons and DropDowns.

 

 

Everything looked nice until I increased the font size for the device in Settings/Display page. Suddenly the Cancel, and Save (top of the Sheet page) and other buttons in the page are not readable because of the big font size.

Even the Title of the Sheet page (between Cancel and Save buttons) is not readable (only part of it is shown in huge font).

 

 

The below code can fix the font size of the TextField, TextArea and Label.

                         textStyle.fontSize: FontSize.PointValue
                         textStyle.fontSizeValue: 8.0

 

I am looking for the the similar code that works for Buttons, DropDowns, and Sheet component.

 

Developer
BGmot
Posts: 1,068
Registered: ‎11-24-2011
My Device: PlayBook

Re: Fix font size for Sheet, Button and DropDown components

I am also interested in this.

Is there any way to define 'default' font size on Application level (and all controls it has) maybe?

Thanks.

Developer
lewellyn
Posts: 110
Registered: ‎10-22-2011
My Device: PlayBook, Bold 9650, Dev Alpha A

Re: Fix font size for Sheet, Button and DropDown components

[ Edited ]

For many Controls, to change that behavior, you will need a custom control. 

 

Think about that hard for a moment. The very fact that you will need a custom control should clue you in that RIM has done testing in this regard and has discovered that the user experience is worse with any alternative than the one possible choice available to us. 

 

Users who have a need to greatly increase the font size are used to display issues. Display issues are better than not being able to use the app at all because the text is illegible. 

 

Try this exercise: Place two TextFields on screen. Give them both the same hint text. Set the TextStyle to change font size of one to the size you have in mind. Leave the other at defaults. Launch the app. Looks good, right? Now change the system font size to maximum and launch the app. Looks fine, right? Now move to where you can barely read the super huge text. Note that you cannot read the other text no matter how hard you try. This is what you are asking your users to read.

 

TL;DR: you will get negative reviews and bad word of mouth if you do it.



Is there a helpful or useful post in this thread? Click the thumbs up on it so that other people can find it more easily!
Like this post too! :smileyvery-happy: