~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/Themes/Ambiance/TabBarStyle.qml

Disable header animations at app startup. Fixes: https://bugs.launchpad.net/bugs/1246792.

Approved by PS Jenkins bot, Zsombor Egri.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
    property color headerTextColor: Theme.palette.normal.backgroundText
24
24
    property color headerTextSelectedColor: Theme.palette.selected.backgroundText
25
25
 
26
 
    property int headerTextFadeDuration: styledItem.animate ? 350 : 0
 
26
    // Don't start transitions because of updates to selectionMode before styledItem is completed.
 
27
    //  This fixes bug #1246792: "Disable tabs scrolling animations at startup"
 
28
    property bool animate: false
 
29
    Binding {
 
30
        target: tabBarStyle
 
31
        property: "animate"
 
32
        when: styledItem.width > 0
 
33
        value: styledItem.animate
 
34
    }
 
35
    property int headerTextFadeDuration: animate ? 350 : 0
27
36
    property url indicatorImageSource: "artwork/chevron.png"
28
37
 
29
38
    property string headerFontSize: "x-large"
34
43
    property real headerTextRightMargin: units.gu(2)
35
44
    property real headerTextBottomMargin: units.gu(2)
36
45
 
37
 
    property real buttonPositioningVelocity: styledItem.animate ? 1.0 : -1
 
46
    property real buttonPositioningVelocity: animate ? 1.0 : -1
38
47
    // The time of inactivity before leaving selection mode automatically
39
48
    property int deactivateTime: 5000
40
49
 
222
231
 
223
232
    PathView {
224
233
        id: buttonView
225
 
        anchors.fill: parent
 
234
        anchors {
 
235
            top: parent.top
 
236
            bottom: parent.bottom
 
237
            left: parent.left
 
238
        }
 
239
        width: needsScrolling ? parent.width : buttonRowWidth
226
240
 
227
241
        // set to the width of one tabButtonRow in Component.onCompleted.
228
242
        property real buttonRowWidth: buttonRow1 ? buttonRow1.width : 0
236
250
 
237
251
        delegate: tabButtonRow
238
252
        model: 2 // The second buttonRow shows the buttons that disappear on the left
239
 
        property bool needsScrolling: buttonRowWidth > tabBar.width
 
253
        property bool needsScrolling: buttonRowWidth > parent.width
240
254
        interactive: needsScrolling
241
 
        width: needsScrolling ? tabBar.width : buttonRowWidth
242
255
        clip: needsScrolling
243
256
 
244
257
        highlightRangeMode: PathView.NoHighlightRange