~ubuntu-shorts-dev/ubuntu-rssreader-app/trunk

« back to all changes in this revision

Viewing changes to article_items/ArticleTextA.qml

  • Committer: Tarmac
  • Author(s): Joey Chan
  • Date: 2013-09-04 19:04:07 UTC
  • mfrom: (57.1.1 ubuntu-rssreader-app)
  • Revision ID: tarmac-20130904190407-80kvwlqi7dhoyfcm
add "read" and "unread" states. Fixes: https://bugs.launchpad.net/bugs/1217363.

Approved by Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
import Ubuntu.Components 0.1
3
3
import Ubuntu.Components.ListItems 0.1 as ListItem
4
4
import "../dateutils.js" as DateUtils
 
5
import "../databasemodule_v2.js" as DB
5
6
 
6
7
UbuntuShape
7
8
{
8
9
    width: units.gu(11)
9
10
    height: units.gu(20) /*content.height + units.gu(4)*/
10
 
    color: "#32222C"
 
11
    color: rss_item.status == "1" ? Qt.rgba(0, 0, 0, 0.7) : Qt.rgba(0, 0, 0, 0.4)
11
12
    radius: "medium"
12
13
 
13
14
    property variant rss_item
46
47
            textFormat: Text.PlainText
47
48
            font.weight: Font.DemiBold
48
49
            elide: Text.ElideRight
49
 
            opacity: 0.8
 
50
            opacity: rss_item.status == "1" ? 0.4 : 0.8
50
51
        }
51
52
 
52
53
        Label
66
67
 
67
68
        onClicked:
68
69
        {
 
70
            var dbResult = DB.updateArticleStatus(rss_item.id, "1")
 
71
            if (dbResult.rowsAffected == 1) {
 
72
                rss_item.status = "1"
 
73
            }
69
74
            mainView.toRssPage(rss_model, model_index) ;
70
75
        }
71
76
    }