From be63f2df3539bacf2ee5bf0a4f21eee5c0a18314 Mon Sep 17 00:00:00 2001 From: jakub Date: Tue, 14 Dec 2010 09:36:08 +0100 Subject: [PATCH 1/1] add qml-elements --- data/button/buttonCenter.png | Bin 0 -> 1476 bytes data/button/buttonLeft.png | Bin 0 -> 4770 bytes data/button/buttonR.png | Bin 0 -> 4703 bytes data/gui.qrc | 6 +++ src/mdictionary/gui/AboutWidget.cpp | 49 ++++++++--------- src/mdictionary/gui/AboutWidget.h | 9 ++++ src/mdictionary/gui/SearchBarWidget.cpp | 3 +- src/mdictionary/mdictionary.pro | 10 +++- src/mdictionary/qml/AboutWidget.qml | 73 +++++++++++++++++++++++++ src/mdictionary/qml/Button.qml | 74 ++++++++++++++++++++++++++ src/mdictionary/qml/IconButton.qml | 88 +++++++++++++++++++++++++++++++ src/mdictionary/qml/MyTextLineEdit.qml | 20 +++++++ src/mdictionary/qml/SearchBarWidget.qml | 32 +++++++++++ 13 files changed, 335 insertions(+), 29 deletions(-) create mode 100644 data/button/buttonCenter.png create mode 100644 data/button/buttonLeft.png create mode 100644 data/button/buttonR.png create mode 100644 src/mdictionary/qml/AboutWidget.qml create mode 100644 src/mdictionary/qml/Button.qml create mode 100644 src/mdictionary/qml/IconButton.qml create mode 100644 src/mdictionary/qml/MyTextLineEdit.qml create mode 100644 src/mdictionary/qml/SearchBarWidget.qml diff --git a/data/button/buttonCenter.png b/data/button/buttonCenter.png new file mode 100644 index 0000000000000000000000000000000000000000..ce016802e347b03c0eb8a6702ee442fec5c08fd4 GIT binary patch literal 1476 zcmV;#1v~nQP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ign? z2qrSZleB&S00l%zL_t(&-rZWeuH-}zJ*T=>3nXMD{J+GPkPxsWKtc#&iI8Bm_c2|E zpxck}*zK`>Jpqk>}y<+xaHr&Bz72*pw-gxYH} z%_EllPz}N(l4b&7xA*V{-v(XIJASD6mrLKgATF^p`M8bdA&NJ0S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CtVcqCO%J#GqTja!$-k?(Xk! zXEtRv8Zd73TW6%#^^CwTUi-PIQVv~6KW*_M;b#q49d%|ivIyCWca(&!5-d-!#S2Da zeC6(4-nzZR?r8AIxQXA}a9}B7k-dC!ack`j$`x~Zj47!tWC>*L4-xj)z0@Cfyj!5{ z3h96yXTtrx(T{dV^4iDIVqPsSY3GY? z#BKeMl>=TMl<2yS)V4IKWpMJGQC=~M%AMJSx9`q)bZ5r>y)k=3=a)bD>aSjD__cce zS!qGeG~t`Mt>9R@BC4TgShpmvmRP$&a;C8bx0&-`Z^WYq54d+{pZ&clyE{YnCd0q~ z@V!Uhyz-3l(;xr))}aYGcRosS#4?Q-1BFq5aTAzLC+yG0><`DhHJ))W4$Nj#c6S>l hlgM-+Z)6C-{{rn-W`v%i)Sv(W002ovPDHLkV1l+JAyxnY literal 0 HcmV?d00001 diff --git a/data/gui.qrc b/data/gui.qrc index 6133b0d..376f9d7 100644 --- a/data/gui.qrc +++ b/data/gui.qrc @@ -11,5 +11,11 @@ xsl/xsl.xsl translations/en_US.qm translations/pl_PL.qm + button/buttonCenter.png + button/buttonLeft.png + button/buttonR.png + lineEdit/ramkaL.png + lineEdit/ramkaR.png + lineEdit/ramkaC.png diff --git a/src/mdictionary/gui/AboutWidget.cpp b/src/mdictionary/gui/AboutWidget.cpp index 72eb839..daae50d 100644 --- a/src/mdictionary/gui/AboutWidget.cpp +++ b/src/mdictionary/gui/AboutWidget.cpp @@ -29,6 +29,22 @@ AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent) { + setWindowTitle(tr("About")); + +#ifndef Q_WS_MAEMO_5 + resize(380,450); + mainLayout = new QVBoxLayout; + view= new QDeclarativeView(); + mainLayout->addWidget(view); + view->setSource(QUrl("src/mdictionary/qml/AboutWidget.qml")); + view->setResizeMode(QDeclarativeView::SizeRootObjectToView); + view->setAlignment(Qt::AlignCenter); + view->show(); + + QGraphicsObject *rootObject = view->rootObject(); + connect(rootObject, SIGNAL(linkClicked(QString)), this, SLOT(openUrl(QString))); + this->setLayout(mainLayout); +#else setModal(true); QString infoNote, licenseNote, comarchNote; infoNote = "

mDictionary

"; @@ -58,20 +74,8 @@ AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent) "<" "http://www.gnu.org/licenses/>." "

"); - - setWindowTitle(tr("About")); mainLayout = new QVBoxLayout; - /*on desktop we place all content in scroll area, on maemo by default all - widgets that are in menu are placed in scroll area created by menu, so we - don't have to do it here*/ - #ifndef Q_WS_MAEMO_5 - scrollLayout = new QVBoxLayout; - scroll = new QScrollArea; - w = new QWidget(this); - #endif - - imageLabel = new QLabel; mainLabel = new QLabel; licenseLabel = new QLabel; @@ -96,18 +100,11 @@ AboutWidget::AboutWidget(GUIInterface *parent): QDialog(parent) mainLayout->addWidget(mainLabel, 0, Qt::AlignHCenter); mainLayout->addWidget(licenseLabel, 0, Qt::AlignHCenter); - //add content to scroll area, and remove fram from it - #ifndef Q_WS_MAEMO_5 - w->setLayout(mainLayout); - scroll->setWidget(w); - scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - scrollLayout->addWidget(scroll, 0, Qt::AlignHCenter); - this->setLayout(scrollLayout); - w->setMinimumSize(img.width()*1.6, img.height()*2.45); - scroll->setLineWidth(0); - scroll->setMidLineWidth(0); - scroll->setFrameStyle(QFrame::NoFrame);; - #else - setLayout(mainLayout); - #endif + setLayout(mainLayout); +#endif +} + + +void AboutWidget::openUrl(QString url){ + QDesktopServices::openUrl(url); } diff --git a/src/mdictionary/gui/AboutWidget.h b/src/mdictionary/gui/AboutWidget.h index 02eb383..8fee222 100644 --- a/src/mdictionary/gui/AboutWidget.h +++ b/src/mdictionary/gui/AboutWidget.h @@ -32,6 +32,9 @@ #include #include #include +#include +#include + #include "../../include/GUIInterface.h" class AboutWidget : public QDialog @@ -39,7 +42,13 @@ class AboutWidget : public QDialog Q_OBJECT public: AboutWidget(GUIInterface *parent = 0); + +private slots: + void openUrl(QString url); + private: + QDeclarativeView *view; + QVBoxLayout* mainLayout; QVBoxLayout *scrollLayout; QLabel* mainLabel, * licenseLabel, *imageLabel; diff --git a/src/mdictionary/gui/SearchBarWidget.cpp b/src/mdictionary/gui/SearchBarWidget.cpp index 78b1f35..b53d664 100644 --- a/src/mdictionary/gui/SearchBarWidget.cpp +++ b/src/mdictionary/gui/SearchBarWidget.cpp @@ -32,8 +32,7 @@ #include "HistoryListDialog.h" -SearchBarWidget::SearchBarWidget(QWidget *parent) : - QWidget(parent) { +SearchBarWidget::SearchBarWidget(QWidget *parent) : QWidget(parent) { initializeUI(); diff --git a/src/mdictionary/mdictionary.pro b/src/mdictionary/mdictionary.pro index 3cc8467..d049501 100644 --- a/src/mdictionary/mdictionary.pro +++ b/src/mdictionary/mdictionary.pro @@ -9,7 +9,8 @@ QT = core \ xmlpatterns \ sql \ dbus \ - webkit + webkit \ + declarative maemo5:QT += maemo5 @@ -153,3 +154,10 @@ unix { check.commands = echo 'No check here' QMAKE_EXTRA_TARGETS += check + +OTHER_FILES += \ + qml/Button.qml \ + qml/AboutWidget.qml \ + qml/SearchBarWidget.qml \ + qml/IconButton.qml \ + qml/MyTextLineEdit.qml diff --git a/src/mdictionary/qml/AboutWidget.qml b/src/mdictionary/qml/AboutWidget.qml new file mode 100644 index 0000000..8dbcbd8 --- /dev/null +++ b/src/mdictionary/qml/AboutWidget.qml @@ -0,0 +1,73 @@ +import Qt 4.7 +import QtWebKit 1.0 + +Rectangle { + id: item + width: 400; + height: 400; + opacity: 1 + anchors.fill: parent + + SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } + color : myPalette.window; + + signal linkClicked(string link); + + Image { + id: image1 + anchors.horizontalCenter: parent.horizontalCenter + source: "qrc:/icons/logo/mdictionary.png" + } + + Text { + id: text1 + y: 200 + text: "

mDictionary

" + anchors.horizontalCenterOffset: 0 + anchors.horizontalCenter: parent.horizontalCenter + } + + Text { + id: text2 + y: 220 + 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 + onLinkActivated: linkClicked(link); + } + + Text { + id: text3 + y: 270 + anchors.horizontalCenter: parent.horizontalCenter + text: "Report bug" + anchors.horizontalCenterOffset: 0 + onLinkActivated: linkClicked(link); + } + + Text { + id: text4 + y: 290 + anchors.horizontalCenter: parent.horizontalCenter + text: "

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License,or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see < http://www.gnu.org/licenses/>.

" + anchors.horizontalCenterOffset: 0 + onLinkActivated: linkClicked(link); + } + + MyTextLineEdit{ + id: myTextLineEdit + x: 50 + y: 32 + width: 120 + height: 30 + } + + /*SearchBarWidget { + id: searchbarwidget1 + x: 0 + y: 32 + } + */ + +} diff --git a/src/mdictionary/qml/Button.qml b/src/mdictionary/qml/Button.qml new file mode 100644 index 0000000..4151017 --- /dev/null +++ b/src/mdictionary/qml/Button.qml @@ -0,0 +1,74 @@ +import Qt 4.7 + +BorderImage { + id: button + property alias textInButton: buttonText.text + signal clicked + opacity: 1 + + border { left: 10; top: 10; right: 10; bottom: 10 } + + 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 + } + + Rectangle { + id: shade + anchors.centerIn: parent; + 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)) + height: parent.height + } + + Image { + id: image1 + width: (35*parent.height)/107 + 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 + 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 + anchors.horizontalCenter: parent.horizontalCenter + source: "qrc:/button/buttonCenter.png" + } + + Image { + id: image2 + width: (35*parent.height)/107 + 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/IconButton.qml b/src/mdictionary/qml/IconButton.qml new file mode 100644 index 0000000..948d1b0 --- /dev/null +++ b/src/mdictionary/qml/IconButton.qml @@ -0,0 +1,88 @@ +import Qt 4.7 + +Rectangle { + id: rectangle + + property alias pathToIcon: image.source; + + signal clicked; + + Image { + id: image + z:1; + anchors.centerIn: parent + width: rectangle.width; + height: rectangle.height; + } + + + MouseArea { + id: mouseArea + anchors.centerIn: parent; + width: rectangle.width + (70*parent.height)/107; + height: rectangle.height; + onClicked: { + rectangle.clicked(); + } + } + + Image { + id: image1 + width: (35*parent.height)/107 + height: parent.height + anchors.left: parent.left + anchors.leftMargin: - (35*parent.height)/107 + source: "qrc:/button/buttonLeft.png" + } + + Image { + id: image3 + width: parent.width + height: parent.height + anchors.horizontalCenter: parent.horizontalCenter + source: "qrc:/button/buttonCenter.png" + } + + + Image { + id: image2 + width: (35*parent.height)/107 + height: parent.height + anchors.right: parent.right + anchors.rightMargin: - (35*parent.height)/107 + source: "qrc:/button/buttonR.png" + } + + Rectangle { + id: shade + anchors.centerIn: parent; + color: "black"; + radius: 20; + opacity: 1; + width: rectangle.width+(70*parent.height)/107; + height: rectangle.height; + } + + states: [ + State { + name: "enable"; + when: (mouseArea.pressed == false && rectangle.enabled == true); + PropertyChanges { target: shade; + opacity: 0; } + }, + State { + name: "disable"; + when: (rectangle.enabled == false); + PropertyChanges { target: shade; + color: "black"; + opacity: .5; } + }, + State { + name: "clicked"; + when: (mouseArea.pressed == true && rectangle.enabled == true); + PropertyChanges { target: shade; + color: "#fffead" + opacity: 0.5; } + } + ] +} diff --git a/src/mdictionary/qml/MyTextLineEdit.qml b/src/mdictionary/qml/MyTextLineEdit.qml new file mode 100644 index 0000000..36ea2e5 --- /dev/null +++ b/src/mdictionary/qml/MyTextLineEdit.qml @@ -0,0 +1,20 @@ +import Qt 4.7 + +Rectangle { + id: rectangle1 + radius: 10 + border.color: "#000666" + + + TextInput { + id: text_input1 + width: rectangle1.width -20 + height: rectangle1.height*0.6; + text: "textInput" + transformOrigin: Item.Left + anchors.centerIn: parent + selectByMouse: true; + font.pixelSize: rectangle1.height * .5; + onCursorPositionChanged: moveCursorSelection(cursorPosition); + } +} diff --git a/src/mdictionary/qml/SearchBarWidget.qml b/src/mdictionary/qml/SearchBarWidget.qml new file mode 100644 index 0000000..72b2cdb --- /dev/null +++ b/src/mdictionary/qml/SearchBarWidget.qml @@ -0,0 +1,32 @@ +import Qt 4.7 + +Rectangle { + id: rectangle1 + width: 500 + height: 40 + + SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } + color : myPalette.window; + + TextInput { + id: text_input + y: 10 + width: 350 + height: 20 + + color: "#000000" + text: "textInput" + anchors.left: parent.left + anchors.leftMargin: 15 + font.pixelSize: 12 + + IconButton { + id: iconbutton; + width:20; + height:20; + anchors.right: parent.right + enabled: true; + pathToIcon: "/home/jakub/go-previous.png"; + } + } +} -- 1.7.9.5