From 04d0584bc537bf94334c1766d14b93b80141ffaf Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 2 Apr 2015 10:20:33 +0200 Subject: [PATCH] - add Search icon. - fix animation bad behavior --- mix/qml/LogsPane.qml | 71 +++++++++++++++++++++++-------------- mix/qml/LogsPaneStyle.qml | 4 +-- mix/qml/StatusPane.qml | 4 +-- mix/qml/img/searchicon.png | Bin 0 -> 1439 bytes mix/res.qrc | 1 + 5 files changed, 49 insertions(+), 31 deletions(-) create mode 100644 mix/qml/img/searchicon.png diff --git a/mix/qml/LogsPane.qml b/mix/qml/LogsPane.qml index c619080bf..ca123f6a0 100644 --- a/mix/qml/LogsPane.qml +++ b/mix/qml/LogsPane.qml @@ -37,7 +37,6 @@ Rectangle height: parent.height - rowAction.height width: parent.width spacing: 0 - ListModel { id: logsModel } @@ -100,7 +99,7 @@ Rectangle Rectangle { - width: 750 + width: LogsPaneStyle.generic.layout.dateWidth + LogsPaneStyle.generic.layout.contentWidth + LogsPaneStyle.generic.layout.typeWidth height: 30 color: { @@ -171,7 +170,7 @@ Rectangle anchors.verticalCenter: parent.verticalCenter elide: Text.ElideRight anchors.left: parent.left - anchors.leftMargin: 190 + anchors.leftMargin: 230 color: { parent.getColor(level); } @@ -486,39 +485,59 @@ Rectangle } } - DefaultTextField + Rectangle { - id: searchBox + width: 120 + radius: 10 + height: 25 + color: "white" anchors.verticalCenter: parent.verticalCenter - width: LogsPaneStyle.generic.layout.headerInputWidth - 50 - font.family: LogsPaneStyle.generic.layout.logLabelFont - font.pointSize: Style.absoluteSize(-3) - font.italic: true - text: qsTr(" - Search - ") - onFocusChanged: + + Image { - if (!focus && text === "") - text = qsTr(" - Search - "); - else if (focus && text === qsTr(" - Search - ")) - text = ""; + id: searchImg + source: "qrc:/qml/img/searchicon.png" + fillMode: Image.PreserveAspectFit + width: 20 + height: 25 + z: 3 } - onTextChanged: { - if (text === qsTr(" - Search - ")) - proxyModel.search(""); - else - proxyModel.search(text); - } + DefaultTextField + { + id: searchBox + z: 2 + width: 100 + anchors.left: searchImg.right + anchors.leftMargin: -7 + font.family: LogsPaneStyle.generic.layout.logLabelFont + font.pointSize: Style.absoluteSize(-3) + font.italic: true + text: qsTr(" - Search - ") + onFocusChanged: + { + if (!focus && text === "") + text = qsTr(" - Search - "); + else if (focus && text === qsTr(" - Search - ")) + text = ""; + } - style: - TextFieldStyle { - background: Rectangle { - radius: 10 + onTextChanged: { + if (text === qsTr(" - Search - ")) + proxyModel.search(""); + else + proxyModel.search(text); + } + + style: + TextFieldStyle { + background: Rectangle { + radius: 10 + } } } } - Rectangle { height: LogsPaneStyle.generic.layout.headerButtonHeight diff --git a/mix/qml/LogsPaneStyle.qml b/mix/qml/LogsPaneStyle.qml index 19f6a653e..0bbdfcee4 100644 --- a/mix/qml/LogsPaneStyle.qml +++ b/mix/qml/LogsPaneStyle.qml @@ -18,8 +18,8 @@ QtObject { property string logLabelColor: "#4a4a4a" property string logLabelFont: "sans serif" property int headerInputWidth: 200 - property int dateWidth: 70 - property int typeWidth: 90 + property int dateWidth: 150 + property int typeWidth: 150 property int contentWidth: 560 property string logAlternateColor: "#f6f5f6" property string errorColor: "#fffcd5" diff --git a/mix/qml/StatusPane.qml b/mix/qml/StatusPane.qml index 4a9287bec..6d8042add 100644 --- a/mix/qml/StatusPane.qml +++ b/mix/qml/StatusPane.qml @@ -227,7 +227,7 @@ Rectangle { top = top.parent var coordinates = logsContainer.mapToItem(top, 0, 0); logsContainer.parent = top; - logsContainer.x = status.x + statusContainer.x - LogsPaneStyle.generic.layout.dateWidth - LogsPaneStyle.generic.layout.typeWidth - 30 + logsContainer.x = status.x + statusContainer.x - LogsPaneStyle.generic.layout.dateWidth - LogsPaneStyle.generic.layout.typeWidth + 70 } LogsPane @@ -239,7 +239,6 @@ Rectangle { State { name: "opened"; PropertyChanges { target: logsContainer; height: 500; visible: true } - PropertyChanges { target: statusContainer; width: 100; height: 25 } }, State { name: "closed"; @@ -250,7 +249,6 @@ Rectangle { transitions: Transition { NumberAnimation { properties: "height"; easing.type: Easing.InOutQuad; duration: 200 } NumberAnimation { target: logsContainer; properties: "visible"; easing.type: Easing.InOutQuad; duration: 200 } - NumberAnimation { target: statusContainer; properties: "width"; easing.type: Easing.InOutQuad; duration: 500 } } } } diff --git a/mix/qml/img/searchicon.png b/mix/qml/img/searchicon.png new file mode 100644 index 0000000000000000000000000000000000000000..c10dc9228e7f7ccf39670ea9c7f6c4acbd19caa4 GIT binary patch literal 1439 zcmV;Q1z`G#P)Px)SxH1eRA>e5nq6pIMHI)oNwd4H4@#r9jbBJg5%M7RK}scr65pFdi@-Fdi@-Fdi@-Fdit62V&)bO{dez zcs#x*7K`lye=Fr?OV4bvSe#v6UY=ZBTs+CRTsidnVMa>0udi==MMcG1ka`Z18~qeB zW`QxI5Knh^cVF}y8)aW4gqf+0$z(DEiNlasZy8viJWJb;l$U6yTHH+eAmvVb9Q7sg zdvkMhuMZ9m{u3oRFRajnA$xBkkvI;4M=S+D6SBS3M>{$?e)m#}%pHXMK4iMc+hq)- z&lL)V=exSPe)W=xsx1`Z{{H@L82lB+Y#|pgx-*~84?^f#5Ca*vp2&C=xePdQWU|!j zQ>oN+5P6+3+JpxN25!f=Z!q*B%0E$l07J)gjNsjWjCcQIWbYA)@m{p zs|{GGACkv}Ed6=v&*+jBd_sSc;tBHK#c6NU22d>k{CgcKgXDnG;mkyMt zj51+XQ(0UjefD2bmcJ!zBFWYjnG$8fXue;x6V9^8lqC_;Hg-u@luDEc^KF#zcUcBp ziqa4#7Bg#O+lLNkcc{7&;raRb4QQ(rjm*N;P?~*&9oSVZEiDP3p~_uKgfp3pYz#^p zd}hI(X=SAW1WMQtUlJv=tFn9AmgL->Ti;QgoMv~we5=oUFRm%hK0C!C}Aqrpy45JTAHV_?I_c)#B$O$`)h!N_wklRX|{Nf-xsLO^ugA`Yd_iMc%}W zjx)3S0G4xj9oyM)-sd}Y6|MOhwuw1snzi6OxsjRn{ISlK@hWc`!eYFO^mjBh@;Q^= zwF0L#AJR@H&hTc@m!D_ld#yBSHx*$aZ<8jZz`vN;5AGfAv@!qy002ovPDHLkV1lXRpyU7m literal 0 HcmV?d00001 diff --git a/mix/res.qrc b/mix/res.qrc index 3a4254791..e981f22ae 100644 --- a/mix/res.qrc +++ b/mix/res.qrc @@ -56,5 +56,6 @@ qml/img/cleariconactive.png qml/img/copyicon.png qml/img/copyiconactive.png + qml/img/searchicon.png