From 91b18d1f5e041da961dee580db035e7ed253ce5a Mon Sep 17 00:00:00 2001 From: jakub Date: Thu, 16 Dec 2010 10:01:19 +0100 Subject: [PATCH] qrc and serachBarWidget --- data/gui.qrc | 3 -- src/mdictionary/qml/AboutWidget.qml | 25 +++++------ src/mdictionary/qml/Button.qml | 11 +++-- src/mdictionary/qml/IconButton.qml | 38 +++++++++------- src/mdictionary/qml/MyTextLineEdit.qml | 5 +-- src/mdictionary/qml/SearchBarWidget.qml | 75 ++++++++++++++++++++++++------- 6 files changed, 102 insertions(+), 55 deletions(-) diff --git a/data/gui.qrc b/data/gui.qrc index 376f9d7..d01ab42 100644 --- a/data/gui.qrc +++ b/data/gui.qrc @@ -14,8 +14,5 @@ button/buttonCenter.png button/buttonLeft.png button/buttonR.png - lineEdit/ramkaL.png - lineEdit/ramkaR.png - lineEdit/ramkaC.png diff --git a/src/mdictionary/qml/AboutWidget.qml b/src/mdictionary/qml/AboutWidget.qml index 8dbcbd8..24ad67e 100644 --- a/src/mdictionary/qml/AboutWidget.qml +++ b/src/mdictionary/qml/AboutWidget.qml @@ -3,8 +3,8 @@ import QtWebKit 1.0 Rectangle { id: item - width: 400; - height: 400; + //width: 400; + // height: 400; opacity: 1 anchors.fill: parent @@ -33,7 +33,7 @@ Rectangle { anchors.horizontalCenter: parent.horizontalCenter textFormat: Text.RichText text: "Maemo/Meego Multilingual Dictionary
Copyright 2006-2010, Comarch S.A.
http://mdictionary.garage.maemo.org" - anchors.horizontalCenterOffset: 1 + anchors.horizontalCenterOffset: 0 onLinkActivated: linkClicked(link); } @@ -55,19 +55,18 @@ Rectangle { onLinkActivated: linkClicked(link); } - MyTextLineEdit{ - id: myTextLineEdit - x: 50 - y: 32 - width: 120 + Button{ + x:100; + y:100; + width: 500 height: 30 + textInButton: "ala ma kota" } - /*SearchBarWidget { + SearchBarWidget { id: searchbarwidget1 - x: 0 - y: 32 + y:50; + width: item.width; + height: 30; } - */ - } diff --git a/src/mdictionary/qml/Button.qml b/src/mdictionary/qml/Button.qml index 4151017..650786c 100644 --- a/src/mdictionary/qml/Button.qml +++ b/src/mdictionary/qml/Button.qml @@ -32,13 +32,14 @@ BorderImage { radius: parent.height*.4; color: "black"; opacity: 0 - width: parent.width//((parent.width > buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.60)) + 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 + smooth: true + 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 @@ -47,7 +48,8 @@ BorderImage { Image { id: image3 - width: ((parent.width > buttonText.text.length*buttonText.font.pixelSize*.8) ? (parent.width) : (buttonText.text.length*buttonText.font.pixelSize*.60)) - ((70*parent.height)/107) + 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" @@ -55,7 +57,8 @@ BorderImage { Image { id: image2 - width: (35*parent.height)/107 + 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 diff --git a/src/mdictionary/qml/IconButton.qml b/src/mdictionary/qml/IconButton.qml index 948d1b0..9b66836 100644 --- a/src/mdictionary/qml/IconButton.qml +++ b/src/mdictionary/qml/IconButton.qml @@ -6,20 +6,12 @@ Rectangle { property alias pathToIcon: image.source; signal clicked; - - Image { - id: image - z:1; - anchors.centerIn: parent - width: rectangle.width; - height: rectangle.height; - } - + radius: 50 MouseArea { id: mouseArea anchors.centerIn: parent; - width: rectangle.width + (70*parent.height)/107; + width: rectangle.width height: rectangle.height; onClicked: { rectangle.clicked(); @@ -27,39 +19,53 @@ Rectangle { } Image { + id: image + z:4; + anchors.centerIn: parent + width: rectangle.width; + height: rectangle.height; + } + + Image { id: image1 - width: (35*parent.height)/107 + z: 1 + smooth: true + width: (35*parent.height)/107 +1 height: parent.height anchors.left: parent.left - anchors.leftMargin: - (35*parent.height)/107 source: "qrc:/button/buttonLeft.png" } Image { id: image3 - width: parent.width + z: 1 + smooth: true + width: parent.width - (70*parent.height)/107 +1 height: parent.height anchors.horizontalCenter: parent.horizontalCenter source: "qrc:/button/buttonCenter.png" + } Image { id: image2 - width: (35*parent.height)/107 + z: 1 + smooth: true + width: (35*parent.height)/107 +1 height: parent.height anchors.right: parent.right - anchors.rightMargin: - (35*parent.height)/107 source: "qrc:/button/buttonR.png" } Rectangle { id: shade + z: 4 anchors.centerIn: parent; color: "black"; radius: 20; opacity: 1; - width: rectangle.width+(70*parent.height)/107; + width: rectangle.width; height: rectangle.height; } diff --git a/src/mdictionary/qml/MyTextLineEdit.qml b/src/mdictionary/qml/MyTextLineEdit.qml index 36ea2e5..7093c02 100644 --- a/src/mdictionary/qml/MyTextLineEdit.qml +++ b/src/mdictionary/qml/MyTextLineEdit.qml @@ -3,12 +3,11 @@ import Qt 4.7 Rectangle { id: rectangle1 radius: 10 - border.color: "#000666" - + border.color: "#000666"; TextInput { id: text_input1 - width: rectangle1.width -20 + width: rectangle1.width-20 height: rectangle1.height*0.6; text: "textInput" transformOrigin: Item.Left diff --git a/src/mdictionary/qml/SearchBarWidget.qml b/src/mdictionary/qml/SearchBarWidget.qml index 72b2cdb..64c0142 100644 --- a/src/mdictionary/qml/SearchBarWidget.qml +++ b/src/mdictionary/qml/SearchBarWidget.qml @@ -1,30 +1,73 @@ import Qt 4.7 Rectangle { - id: rectangle1 - width: 500 - height: 40 + id: searchBarWidget SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } color : myPalette.window; - TextInput { - id: text_input - y: 10 - width: 350 - height: 20 + MyTextLineEdit{ + id: inputSearchText + width: (searchBarWidget.width - (searchBarWidget.height*3.5 + searchButton.width + 9)); + height: searchBarWidget.height + anchors.left: searchBarWidget.left + IconButton { + id: clearButton; + width: inputSearchText.height-6; + height: inputSearchText.height-6; + anchors.rightMargin: 4 + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + enabled: true; + pathToIcon: "/home/jakub/go-previous.png"; + } + } + + Item { + id: buttonsBox + width: searchBarWidget.height*3.5 + searchButton.width + 9 + height: searchBarWidget.height + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter - color: "#000000" - text: "textInput" - anchors.left: parent.left - anchors.leftMargin: 15 - font.pixelSize: 12 + Button { + id: searchButton + width: 100 + height: searchBarWidget.height; + anchors.rightMargin: 3 + anchors.right: historyButton3.left + anchors.verticalCenter: parent.verticalCenter + textInButton: "Search" + } IconButton { - id: iconbutton; - width:20; - height:20; + id: historyButton1; + width: searchBarWidget.height + height: searchBarWidget.height anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + enabled: true; + pathToIcon: "/home/jakub/go-previous.png"; + } + + IconButton { + id: historyButton2; + width: searchBarWidget.height + height: searchBarWidget.height + anchors.rightMargin: 3 + anchors.right: historyButton1.left + anchors.verticalCenter: parent.verticalCenter + enabled: true; + pathToIcon: "/home/jakub/go-previous.png"; + } + + IconButton { + id: historyButton3; + width: searchBarWidget.height + height: searchBarWidget.height + anchors.rightMargin: 3 + anchors.right: historyButton2.left + anchors.verticalCenter: parent.verticalCenter enabled: true; pathToIcon: "/home/jakub/go-previous.png"; } -- 1.7.9.5