import QtQuick 1.1 import com.nokia.meego 1.0 import com.nokia.extras 1.0 import 'UIConstants.js' as UI Item { id: listItem signal clicked property bool pressed: false property bool isHeader: model.header property int titleSize: (model.header ? UI.FONT_XLARGE : UI.FONT_DEFAULT) property int titleWeight: Font.Bold property color titleColor: theme.inverted ? (model.header ? UI.COLOR_FOREGROUND : UI.COLOR_INVERTED_FOREGROUND) : (UI.COLOR_FOREGROUND) property int subtitleSize: UI.FONT_XSMALL property int subtitleWeight: Font.Light property color subtitleColor: theme.inverted ? UI.COLOR_SECONDARY_FOREGROUND : UI.COLOR_INVERTED_SECONDARY_FOREGROUND height: UI.LIST_ITEM_HEIGHT_SMALL width: parent.width Rectangle { anchors.fill: parent anchors.leftMargin: -UI.MARGIN_XLARGE anchors.rightMargin: -UI.MARGIN_XLARGE color: UI.COLOR_SELECT visible: listItem.isHeader } Row { anchors.fill: parent spacing: UI.DEFAULT_MARGIN Item { width: UI.DEFAULT_MARGIN; height: 1; visible: !model.header } Item { // anchors.top: parent.top height: UI.LIST_ITEM_HEIGHT_SMALL Column { anchors.verticalCenter: parent.verticalCenter Text { id: mainText text: model.title font.weight: listItem.titleWeight font.pixelSize: listItem.titleSize color: listItem.titleColor } Text { id: subText text: model.subtitle font.weight: listItem.subtitleWeight font.pixelSize: listItem.subtitleSize color: listItem.subtitleColor visible: text != "" } } } } ListButton { id: appendButton anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter anchors.rightMargin: UI.DEFAULT_MARGIN iconSource: "image://theme/icon-m-toolbar-add" onClicked: { openSelectInstallFamilyDialog(model.priority) } visible: listItem.isHeader } Loader { id: selectInstallFamilyDialogLoader anchors.fill: parent } MouseArea { id: selectItem anchors.fill: parent enabled: !listItem.isHeader visible: !listItem.isHeader onClicked: { if (preferFamilyListView.currentIndex === index) preferFamilyListView.currentIndex = -1 else preferFamilyListView.currentIndex = index } } }