layout fixes

don't count things that aren't buttons in thewidth calculations
This commit is contained in:
Marco Martin 2012-02-17 12:28:57 +01:00
parent 2f6b8d2687
commit 0bd0641e3e
2 changed files with 4 additions and 4 deletions

View File

@ -143,8 +143,8 @@ Item {
Private.IconLoader {
id: imageLoader
implicitWidth: theme.smallIconSize
implicitHeight: theme.smallIconSize
implicitWidth: internal.portrait ? Math.max(theme.smallIconSize, root.height - (label.text ? label.height : 0)) : Math.max(theme.smallIconSize, root.height)
implicitHeight: implicitWidth
anchors {
left: internal.portrait ? undefined : parent.left

View File

@ -112,11 +112,11 @@ Item {
if (childCount != 0) {
//not too much efficient but the loop over children needs to be done two times to get the proper child width
for (var i = 0; i < childCount; ++i) {
if (!root.children[i].visible) {
if (!root.children[i].visible || root.children[i].text == undefined) {
--visibleChildCount
}
}
var itemWidth = (root.width - (childCount-1)*10) / visibleChildCount
var itemWidth = (root.width - (visibleChildCount-1)*10) / visibleChildCount
var itemIndex = mirrored ? childCount - 1 : 0
var increment = mirrored ? - 1 : 1
var visibleIndex = 0