Browse Source

Merge pull request #1495 from yann300/ui

Logs window redesign
cl-refactor
Arkadiy Paronyan 10 years ago
parent
commit
5d86147bbc
  1. 71
      mix/qml/LogsPane.qml
  2. 4
      mix/qml/LogsPaneStyle.qml
  3. 4
      mix/qml/StatusPane.qml
  4. BIN
      mix/qml/img/searchicon.png
  5. 1
      mix/res.qrc

71
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

4
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"

4
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 }
}
}
}

BIN
mix/qml/img/searchicon.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

1
mix/res.qrc

@ -61,5 +61,6 @@
<file>qml/img/cleariconactive.png</file>
<file>qml/img/copyicon.png</file>
<file>qml/img/copyiconactive.png</file>
<file>qml/img/searchicon.png</file>
</qresource>
</RCC>

Loading…
Cancel
Save