Adding iconName to Button screw its automatic sizing

Bug #1478839 reported by Didier Roche-Tolomelli
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
High
Unassigned

Bug Description

If you add an iconName to a button without a set width anchored to one side only, the sizing isn't correct.

Please find attached 2 screenshots demonstrating this issue: there are 2 buttons, one anchored to the left, the other anchored to the right.
If you set the iconName to anything, the right button will expand way beyond its needed width.

Minimal reproducer:

import QtQuick 2.4
import Ubuntu.Components 1.2

MainView {
    id: mainview
    objectName: "mainView"
    applicationName: "splitthebill.didrocks"

    width: units.gu(40)
    height: units.gu(75)

    Page {

        Button {
            text: "Reset"
            color: UbuntuColors.red
            anchors.left: parent.left
        }

        Button {
            iconName: "add"
            text: "Archive"
            color: UbuntuColors.green
            anchors.right: parent.right
        }
    }
}

Tags: devexp
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :
Zsombor Egri (zsombi)
Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.