From: jakub Date: Thu, 30 Dec 2010 08:27:13 +0000 (+0100) Subject: add searchbar icons X-Git-Url: http://vcs.maemo.org/git/?p=mdictionary;a=commitdiff_plain;h=8deda32c1981614d48231dddc5afbe25694937ce add searchbar icons --- diff --git a/data/button/go-clear.png b/data/button/go-clear.png new file mode 100644 index 0000000..8b85d6b Binary files /dev/null and b/data/button/go-clear.png differ diff --git a/data/button/go-next.png b/data/button/go-next.png new file mode 100644 index 0000000..52255d2 Binary files /dev/null and b/data/button/go-next.png differ diff --git a/data/button/go-show.png b/data/button/go-show.png new file mode 100644 index 0000000..408ef1e Binary files /dev/null and b/data/button/go-show.png differ diff --git a/data/gui.qrc b/data/gui.qrc index 28c0c87..94cfba9 100644 --- a/data/gui.qrc +++ b/data/gui.qrc @@ -24,5 +24,8 @@ button/buttonLeftPushed.png button/checkbox.png button/checkboxChecked.png + button/go-next.png + button/go-show.png + button/go-clear.png diff --git a/src/mdictionary/qml/Button.qml b/src/mdictionary/qml/Button.qml index fd49c8e..0491e99 100644 --- a/src/mdictionary/qml/Button.qml +++ b/src/mdictionary/qml/Button.qml @@ -6,7 +6,7 @@ BorderImage { signal clicked opacity: 1 - function setText(string) { textInButton = string; } + function setText(string) { textInButton = qsTr(string); } border { left: 10; top: 10; right: 10; bottom: 10 } MouseArea { @@ -74,77 +74,4 @@ BorderImage { PropertyChanges { target: image2; source: "qrc:/button/buttonRightDisabled.png" } } ] - - - -/* MouseArea { - id: mouseArea - anchors.centerIn: parent; - width: ((parent.width > buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.60)) - ((70*parent.height)/107) - height: parent.height - onClicked: { - button.clicked(); - } - } - - Text { - z:1 - id: buttonText - anchors.centerIn: parent; - font.pixelSize: parent.height * .5 - style: Text.Sunken; color: "white"; styleColor: "black"; smooth: true - PropertyChanges { - target: button; - width: (button.width> buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.8) - } - } - - Rectangle { - id: shade - anchors.centerIn: parent; - radius: parent.height*.4; - color: "black"; - opacity: 0 - width: ((parent.width > buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.60)) - height: parent.height - } - - Image { - id: image1 - width: (35*parent.height)/107 +1 - height: parent.height - anchors.left: parent.left - anchors.leftMargin: (parent.width - ((parent.width > buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.60)))/2 - source: "qrc:/button/buttonLeft.png" - } - - Image { - id: image3 - smooth: true - width: (((parent.width > buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.60)) - ((70*parent.height)/107))+1 - height: parent.height - anchors.horizontalCenter: parent.horizontalCenter - source: "qrc:/button/buttonCenter.png" - } - - Image { - id: image2 - smooth: true - width: (35*parent.height)/107 +1 - height: parent.height - anchors.right: parent.right - anchors.rightMargin: (parent.width - ((parent.width > buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.60)))/2 - source: "qrc:/button/buttonR.png" - } - - states: [ - State { - name: "pressed"; when: mouseArea.pressed == true - PropertyChanges { target: shade; opacity: 0.4 } - PropertyChanges { target: image1; opacity: 0.5 } - PropertyChanges { target: image3; opacity: 0.5 } - PropertyChanges { target: image2; opacity: 0.5 } - } - ] - */ } diff --git a/src/mdictionary/qml/FlickableWebView.qml b/src/mdictionary/qml/FlickableWebView.qml index 42818ef..edd448d 100644 --- a/src/mdictionary/qml/FlickableWebView.qml +++ b/src/mdictionary/qml/FlickableWebView.qml @@ -72,6 +72,10 @@ Flickable { contentsScale: 1 pressGrabTime: 0 + Keys.onRightPressed: { + console.log("test"); + } + function doZoom(zoom,centerX,centerY) { var tempX = flickable.width/2 - parent.x*zoom; diff --git a/src/mdictionary/qml/SearchBarWidget.qml b/src/mdictionary/qml/SearchBarWidget.qml index d72e71c..689480d 100644 --- a/src/mdictionary/qml/SearchBarWidget.qml +++ b/src/mdictionary/qml/SearchBarWidget.qml @@ -36,7 +36,7 @@ Rectangle { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter enabled: true; - pathToIcon: "qrc:/button/go-previous.png"; + pathToIcon: "qrc:/button/go-clear.png"; onClicked: clear(); } } @@ -55,7 +55,7 @@ Rectangle { anchors.rightMargin: 3 anchors.right: historyPrevToolButton.left anchors.verticalCenter: parent.verticalCenter - textInButton: "Search" + textInButton: qsTr("Search") onClicked: searchBarWidget.searchButtonClicked(inputSearchText.textInLineEdit); } @@ -66,7 +66,7 @@ Rectangle { anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter enabled: true; - pathToIcon: "qrc:/button/go-previous.png"; + pathToIcon: "qrc:/button/go-next.png"; onClicked: searchBarWidget.historyNextToolButtonClicked(); } @@ -78,7 +78,7 @@ Rectangle { anchors.right: historyNextToolButton.left anchors.verticalCenter: parent.verticalCenter enabled: true; - pathToIcon: "qrc:/button/go-previous.png"; + pathToIcon: "qrc:/button/go-show.png"; onClicked: searchBarWidget.historyShowToolButtonClicked(); } diff --git a/src/mdictionary/qml/TranslationView.qml b/src/mdictionary/qml/TranslationView.qml index d0181a6..b366c1d 100644 --- a/src/mdictionary/qml/TranslationView.qml +++ b/src/mdictionary/qml/TranslationView.qml @@ -10,7 +10,7 @@ Rectangle { color: myPalette.window function setUrl(string){ - webView.url = "file:///home/jakub/Pulpit/test.html"; + webView.url = "file:///home/test.html"; webView.url = "file:///home/jakub/.mdictionary/html.html"; } diff --git a/src/mdictionary/qml/WelcomeScreenWidget.qml b/src/mdictionary/qml/WelcomeScreenWidget.qml index b24542e..4d58015 100644 --- a/src/mdictionary/qml/WelcomeScreenWidget.qml +++ b/src/mdictionary/qml/WelcomeScreenWidget.qml @@ -36,8 +36,6 @@ Rectangle { Image { id: logo source: "qrc:/icons/logo/mdictionary.png" -// width: 240 -// height: 200 anchors.horizontalCenter: parent.horizontalCenter fillMode: Image.PreserveAspectFit anchors.top: parent.top