From: Sudheer K Date: Sun, 22 Jan 2012 20:07:26 +0000 (-0800) Subject: Harmattan Config UI modifications X-Git-Url: http://git.maemo.org/git/?p=vicar;a=commitdiff_plain;h=c5f97bd47e3e15b905c5fe93924b160f9f2c9ad1 Harmattan Config UI modifications --- diff --git a/src/vicar-config-qml/qml/vicarconfigqml/MainPage.qml b/src/vicar-config-qml/qml/vicarconfigqml/MainPage.qml index 2237915..0f347ee 100644 --- a/src/vicar-config-qml/qml/vicarconfigqml/MainPage.qml +++ b/src/vicar-config-qml/qml/vicarconfigqml/MainPage.qml @@ -1,5 +1,7 @@ import QtQuick 1.1 import com.nokia.meego 1.0 +import "file:///usr/lib/qt4/imports/com/meego/UIConstants.js" as UIConstants +//import "file:///usr/lib/qt4/imports/com/nokia/extras/constants.js" as ExtrasConstants import "Library/js/DBUtility.js" as DBUtility import "Library/js/CoreLogic.js" as Core @@ -19,15 +21,16 @@ Page { Rectangle{ id: headerRect anchors.top:parent.top - width: parent.width ; height: parent.height/10 - color: "grey" - opacity: 0.6 + width: parent.width ; height: appWindow.inPortrait ? UIConstants.HEADER_DEFAULT_HEIGHT_PORTRAIT: UIConstants.HEADER_DEFAULT_HEIGHT_LANDSCAPE + color: "darkgray" Text { id: titleText - anchors.centerIn: parent //#cccccc - font.pointSize: 16; horizontalAlignment: Text.AlignLeft; elide: Text.ElideLeft; color: "black"; style: Text.Raised; styleColor: "black" - font.bold: true + font.family: UIConstants.FONT_FAMILY + font.pixelSize: UIConstants.FONT_SLARGE + color: UIConstants.COLOR_FOREGROUND + anchors.centerIn: parent + horizontalAlignment: Text.AlignHCenter; text: qsTr("VICaR - Rules") } } @@ -49,8 +52,9 @@ Page { Item { ListView { id: rulesView - model: rulesModel anchors.fill: parent + clip: true + model: rulesModel delegate:ruleDelegate } } @@ -59,14 +63,30 @@ Page { Component { id: ruleDelegate Item{ - width: uiLoader.width - height: 40 + width: uiLoader.width + height: UIConstants.LIST_ITEM_HEIGHT_DEFAULT + + BorderImage { + anchors.fill: parent + visible: mouseArea.pressed + source: theme.inverted ? + 'image://theme/meegotouch-list-fullwidth-inverted-background-pressed-vertical-center': + 'image://theme/meegotouch-list-fullwidth-background-pressed-vertical-center' + } + Text { - width: parent.width - font.pointSize: 16; horizontalAlignment: Text.AlignLeft; elide: Text.ElideLeft; color: "black"; style: Text.Raised; styleColor: "black" - text: "For #s starting with "+numberpattern+ ", use "+gatewaynumber; + height: parent.height; + anchors {left: parent.left;leftMargin: UIConstants.DEFAULT_MARGIN; right: parent.right; rightMargin: UIConstants.DEFAULT_MARGIN} + font.family: UIConstants.FONT_FAMILY + font.pixelSize: UIConstants.FONT_SLARGE + color: UIConstants.COLOR_FOREGROUND + horizontalAlignment: Text.AlignLeft; verticalAlignment: Text.AlignVCenter + wrapMode: Text.WordWrap + //lineHeightMode: Text.ProportionalHeight; lineHeight: 1.5 + text: "For numbers starting with "+numberpattern+ ", use "+gatewaynumber; } MouseArea{ + id: mouseArea anchors.fill: parent onPressAndHold: { ruleContextMenu.ruleID = id; diff --git a/src/vicar-config-qml/qml/vicarconfigqml/addrulesheet.qml b/src/vicar-config-qml/qml/vicarconfigqml/addrulesheet.qml index 321950e..fbedb7b 100644 --- a/src/vicar-config-qml/qml/vicarconfigqml/addrulesheet.qml +++ b/src/vicar-config-qml/qml/vicarconfigqml/addrulesheet.qml @@ -1,6 +1,8 @@ import QtQuick 1.1 import com.nokia.meego 1.0 import "Library/js/DBUtility.js" as DBUtility +import "file:///usr/lib/qt4/imports/com/meego/UIConstants.js" as UIConstants +import "file:///usr/lib/qt4/imports/com/nokia/extras/constants.js" as ExtrasConstants Sheet{ id: screen @@ -26,7 +28,7 @@ Sheet{ dtmfformat = ruleObj.dtmfformat; var i; for (i = 0; i < numberFormatModel.count; i++){ - if (numberFormatModel.get(i).name == dtmfformat) { + if (numberFormatModel.get(i).name === dtmfformat) { numberFormatIndex = i; break; } @@ -61,20 +63,25 @@ Sheet{ content: Flickable { id: container anchors.fill: parent - anchors.leftMargin: 10 - anchors.topMargin: 10 + anchors.leftMargin: UIConstants.DEFAULT_MARGIN + anchors.rightMargin: UIConstants.DEFAULT_MARGIN + anchors.topMargin: UIConstants.DEFAULT_MARGIN flickableDirection: Flickable.VerticalFlick + contentHeight: col.height + UIConstants.DEFAULT_MARGIN Column { id: col width: parent.width spacing: 10 - Label { text: (ruleID != 0)? qsTr("Edit Rule"):qsTr("Add Rule"); font.bold: true; } + Label { + text: (ruleID != 0)? qsTr("Edit Rule"):qsTr("Add Rule"); + font.family: UIConstants.FONT_FAMILY_LIGHT + font.pixelSize: UIConstants.FONT_XLARGE + } Label { text: qsTr("For numbers starting with:") } TextField { id: numberStartingWith anchors { left: parent.left; right: parent.right; } - //height: implicitHeight inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText text: screen.numberpattern } @@ -82,47 +89,53 @@ Sheet{ TextField { id: gatewayNumber anchors { left: parent.left; right: parent.right; } - //height: implicitHeight inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText text: screen.gatewaynumber } - Label { text: qsTr("Dial number in this format:") } - - Button { - anchors { horizontalCenter: parent.horizontalCenter } - //height: implicitHeight - text: "Change Format" - onClicked: { - numberFormatDialog.open(); - } - } + Label { text: qsTr("Dial number in this format (tap to change): ") } Rectangle { width: parent.width - height: 30 - color: "lightgray" + height: UIConstants.LIST_ITEM_HEIGHT_SMALL + color: "transparent" + + BorderImage { + anchors.fill: parent + visible: mouseArea.pressed + source: theme.inverted ? + 'image://theme/meegotouch-list-fullwidth-inverted-background-pressed-vertical-center': + 'image://theme/meegotouch-list-fullwidth-background-pressed-vertical-center' + } + Text { - anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + verticalAlignment: Text.AlignVCenter text: numberFormatDialog.selectedIndex >= 0 ? numberFormatDialog.model.get(numberFormatDialog.selectedIndex).name : "None" - font.pixelSize: 16 - //font.bold: true + font.family: UIConstants.FONT_FAMILY_LIGHT + font.pixelSize: UIConstants.FONT_SMALL + } + + MouseArea{ + id: mouseArea + anchors.fill: parent + onClicked: { + numberFormatDialog.open(); + } } } - Label { text: qsTr("Include this tone before dialing:") } + Label { text: qsTr("Send this tone before dialing:") } TextField { id: dtmfPrefix anchors { left: parent.left; right: parent.right; } - height: implicitHeight inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText } - Label { text: qsTr("Include this tone after dialing:") } + Label { text: qsTr("Send this tone after dialing:") } TextField { id: dtmfSuffix anchors { left: parent.left; right: parent.right; } - height: implicitHeight inputMethodHints: Qt.ImhDialableCharactersOnly | Qt.ImhNoPredictiveText } } diff --git a/src/vicar-config-qml/qml/vicarconfigqml/main.qml b/src/vicar-config-qml/qml/vicarconfigqml/main.qml index 8dbf557..bfc0a02 100644 --- a/src/vicar-config-qml/qml/vicarconfigqml/main.qml +++ b/src/vicar-config-qml/qml/vicarconfigqml/main.qml @@ -26,7 +26,7 @@ PageStackWindow { ToolIcon { platformIconId: "toolbar-view-menu" anchors.right: (parent === undefined) ? undefined : parent.right - onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close() + onClicked: (myMenu.status === DialogStatus.Closed) ? myMenu.open() : myMenu.close() } }