From 8deda32c1981614d48231dddc5afbe25694937ce Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 30 Dec 2010 09:27:13 +0100 Subject: [PATCH] add searchbar icons --- data/button/go-clear.png | Bin 0 -> 866 bytes data/button/go-next.png | Bin 0 -> 1317 bytes data/button/go-show.png | Bin 0 -> 1271 bytes data/gui.qrc | 3 ++ src/mdictionary/qml/Button.qml | 75 +-------------------------- src/mdictionary/qml/FlickableWebView.qml | 4 ++ src/mdictionary/qml/SearchBarWidget.qml | 8 +-- src/mdictionary/qml/TranslationView.qml | 2 +- src/mdictionary/qml/WelcomeScreenWidget.qml | 2 - 9 files changed, 13 insertions(+), 81 deletions(-) create mode 100644 data/button/go-clear.png create mode 100644 data/button/go-next.png create mode 100644 data/button/go-show.png diff --git a/data/button/go-clear.png b/data/button/go-clear.png new file mode 100644 index 0000000000000000000000000000000000000000..8b85d6b7b3a626c2aee50b23b7e8270b06a3b98c GIT binary patch literal 866 zcmV-o1D*VdP)f2;A(@u`i;M5;o*pwzdb%6kOhHkn3hKNMr%s)sg1fWd_QQ9d zeSi1%t#h^dLhf#rYPBYBzWv@?AAf#fbHBbSOwsP$`St8E?tJ+|dZW9N-ArCwS>EhC zY+abfS8bY2)mmLVO}_$O0|@DZ%Xn*jbE<+_|v7IznJMYeCFB1 zADuaKw$b12)9G}GF_P!`6Mc{MsvGal{2Yg%3#v-H-QH7pj5v9o6DnGp8DMcinyN~- z+nrc=(Cal>ni=548|$s3&4>80Yp6s-6%|265s9cOBC^X?5kv$}{%p+*@bZyA8q13v zo`2~!Zibm*szbXNb;LHjoNxU8*P)pKoFc$V>t64`1$ zLh_s}*(T}r5D|LazfpkA|gznKgq|$akrs!RYkRofCw4_szzlbI$4E}oLFPgN@%=TSSlTOEQp9&iGn;B|+HdmT?B zc-@_?do5N^hR_5a`O>Mq;MJvq<=vT-{90A^+H6_2^c{r~^~07*qoM6N<$f+L)b&j0`b literal 0 HcmV?d00001 diff --git a/data/button/go-next.png b/data/button/go-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Fm3Z->RG3W4;=JSSPoMAk?av=K9Ng*l9En6hsE!YJzWv=zC~%Uea^SK_EowLL_W<>~ zf;dnBr1NdwGqz3yycfiW&PAXn=)%RacoB32(A|51`dxvgAGQ8!LoPE91OVa%?*#7! z@53Djt{3MW%7YgWT)%I_YXSH?bCCrA-h&S$v>b>NoD0AUI!eBQ0?1XI>zo2E=R5*Y z){qSXvm%vIqiKla zeE>=j6;{K+0toW@K)FPLDE2X(!iy*HS&RaDH$A05W;yS^(bs;Kgg*9$CdD=Px-}O=+$($`6Il%Z>hT_XgYYoI@_F4Z%R2 h-^kGYXk`Cg<1cH<7F#VsPe}j(002ovPDHLkV1lEHVNU=6 literal 0 HcmV?d00001 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 -- 1.7.9.5