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
Highlighted
Developer
Posts: 26
Registered: ‎07-21-2013
My Device: BB Z10 LE, BB DAC, BB PlayBook
My Carrier: Vodafone NL
Accepted Solution

retreive default left-padding

is there anyway to retreive the default left-padding in QML?

 

The default is different for Z10 and Q10/Q5.

Z10: 20

Q10/Q5: 10

 

Is there any way to easily get these values, so I can make my layout nice for all phones?

---
http://www.heris.nl OR Check out my apps in appworld:
http://appworld.blackberry.com/webstore/vendor/22561/
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: retreive default left-padding

Padding is only defined for a few of the controls, for the rest it is undefined.

 

http://developer.blackberry.com/native/reference/cascades/bb__cascades__control.html#property-rightp...


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 26
Registered: ‎07-21-2013
My Device: BB Z10 LE, BB DAC, BB PlayBook
My Carrier: Vodafone NL

Re: retreive default left-padding

What I want to achieve is that I want my Labels and everything properly alligned with the text in the titleBar and in the Headers

So I need to know which padding is used there.

---
http://www.heris.nl OR Check out my apps in appworld:
http://appworld.blackberry.com/webstore/vendor/22561/
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: retreive default left-padding

Me too.

 

I currently have a bug report in along similer lines.

 

The best you can do is add a container and then add all your UI componants setting the margins and padding to 0.

 

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 26
Registered: ‎07-21-2013
My Device: BB Z10 LE, BB DAC, BB PlayBook
My Carrier: Vodafone NL

Re: retreive default left-padding

my intention is to make the text in the labels being properly aligned with the text in the titleBar:

Code of situation:

import bb.cascades 1.0

Page {
titleBar: TitleBar {
title: "Settings"
}
Container {
leftPadding: defaultLeftPadding
Label {
text: "text to be aligned"
}
}
}

how do I get the defaultLeftPadding ? it should be 10 for Q10/Q5 and 20 for Z10

---
http://www.heris.nl OR Check out my apps in appworld:
http://appworld.blackberry.com/webstore/vendor/22561/
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: retreive default left-padding

I'm not sure where you are getting your values from as the default value according to the documentation is 0 and for label it's undefined.


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 26
Registered: ‎07-21-2013
My Device: BB Z10 LE, BB DAC, BB PlayBook
My Carrier: Vodafone NL

Re: retreive default left-padding

[ Edited ]

those values are the defaultPadding in the titleBar, headers, StandardListItem etc. but the whole point is that I don't know how to get retreive them in code

---
http://www.heris.nl OR Check out my apps in appworld:
http://appworld.blackberry.com/webstore/vendor/22561/
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: retreive default left-padding

Can you post the link to where these are defined in the documentation?

 

The only call I'm aware of is a call to leftPadding() but this is only defined for a handful of controls which is why I'm interested in where you got the others from.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 26
Registered: ‎07-21-2013
My Device: BB Z10 LE, BB DAC, BB PlayBook
My Carrier: Vodafone NL

Re: retreive default left-padding

I've found those values be manually trying to align that text properly

---
http://www.heris.nl OR Check out my apps in appworld:
http://appworld.blackberry.com/webstore/vendor/22561/
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: retreive default left-padding

Ok, I think many factors are going to affect the postioning then and as I said I don't think it's possible to get the padding for many of the controls.

 

Have you thought about doing your own TitleBar?

That way you could control the padding yourself, whatever the device, orientation, font size, scale factor, etc.

 


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.