~xnox/ubuntu-rssreader-app/correct-branch-name

« back to all changes in this revision

Viewing changes to OrganicGrid.qml

  • Committer: Tarmac
  • Author(s): Joey Chan
  • Date: 2014-02-20 04:48:49 UTC
  • mfrom: (176.1.1 ubuntu-rssreader-app)
  • Revision ID: tarmac-20140220044849-ut9j4o2vdxs4qw93
update gridview to fix bug #1282002. Fixes: https://bugs.launchpad.net/bugs/1282002.

Approved by Roman Shchekin, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 
10
10
    anchors.fill: parent
11
11
 
12
 
    // comment 000 start
 
12
    // comment organicGridRoot_0 start
13
13
    // below property and slot are used for expanding app window in desktop mode
14
14
    property bool canReload: false
15
 
    onHeightChanged: {
16
 
        if (canReload) {
17
 
            canReload = false
18
 
            clear()
19
 
            reload()
20
 
        }
21
 
    }
22
15
 
23
16
    // this value will be changed if the app's width changed
24
17
    property int numberAddMore: 12
25
 
    onWidthChanged: {
26
 
        var num = 12 * (1 + width / height)
27
 
        numberAddMore = num > 12 ? num : 12
28
 
        if (canReload) {
29
 
            canReload = false
30
 
            clear()
31
 
            reload()
 
18
 
 
19
    // connect to MainView's sizeChanged signal
 
20
    Connections{
 
21
        id: connMainview
 
22
        target: mainView
 
23
 
 
24
        onSizeChanged: {
 
25
            var num = 12 * (1 + width / height)
 
26
            numberAddMore = num > 12 ? num : 12
 
27
            if (canReload) {
 
28
                canReload = false
 
29
                clear()
 
30
                reload()
 
31
            }
32
32
        }
33
33
    }
34
34
 
35
 
    // comment 000 end
 
35
    // comment organicGridRoot_0 end
36
36
 
37
37
    property var rectangleList: []
38
38
    property var articleModel: gridViewModel