Browse Source

ui changes

cl-refactor
yann300 10 years ago
parent
commit
323a1aea0e
  1. 244
      mix/qml/LogsPane.qml
  2. 2
      mix/qml/LogsPaneStyle.qml

244
mix/qml/LogsPane.qml

@ -189,12 +189,13 @@ Rectangle
Rectangle Rectangle
{ {
color: "transparent" color: "transparent"
height: 20 height: parent.height
width: 50 width: 40
anchors.verticalCenter: parent.verticalCenter
DefaultLabel DefaultLabel
{ {
anchors.verticalCenter: parent.verticalCenter
color: "#808080" color: "#808080"
font.pointSize: Style.absoluteSize(-3)
font.family: LogsPaneStyle.generic.layout.logLabelFont font.family: LogsPaneStyle.generic.layout.logLabelFont
text: qsTr("Show:") text: qsTr("Show:")
} }
@ -204,7 +205,7 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 1; width: 1;
height: parent.height height: parent.height
color : "#808080" color : "transparent"
} }
ToolButton { ToolButton {
@ -232,7 +233,7 @@ Rectangle
} }
background: background:
Rectangle { Rectangle {
color: javascriptButton.checked ? "#cfcfcf" : "transparent" color: javascriptButton.checked ? "#dcdcdc" : "transparent"
} }
} }
} }
@ -241,7 +242,14 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 1; width: 1;
height: parent.height height: parent.height
color : "#808080" color : "#d3d0d0"
}
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: 1;
height: parent.height
color : "#f2f1f2"
} }
ToolButton { ToolButton {
@ -269,7 +277,7 @@ Rectangle
} }
background: background:
Rectangle { Rectangle {
color: runButton.checked ? "#cfcfcf" : "transparent" color: runButton.checked ? "#dcdcdc" : "transparent"
} }
} }
} }
@ -278,7 +286,14 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 1; width: 1;
height: parent.height height: parent.height
color : "#808080" color : "#d3d0d0"
}
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: 1;
height: parent.height
color : "#f2f1f2"
} }
ToolButton { ToolButton {
@ -306,7 +321,7 @@ Rectangle
} }
background: background:
Rectangle { Rectangle {
color: stateButton.checked ? "#cfcfcf" : "transparent" color: stateButton.checked ? "#dcdcdc" : "transparent"
} }
} }
} }
@ -315,7 +330,14 @@ Rectangle
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
width: 1; width: 1;
height: parent.height height: parent.height
color : "#808080" color : "#d3d0d0"
}
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: 1;
height: parent.height
color : "#f2f1f2"
} }
} }
@ -323,98 +345,97 @@ Rectangle
{ {
height: parent.height height: parent.height
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 4 anchors.rightMargin: 10
spacing: 4 spacing: 10
Button Rectangle
{ {
id: clearButton
height: LogsPaneStyle.generic.layout.headerButtonHeight height: LogsPaneStyle.generic.layout.headerButtonHeight
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
action: hideAction color: "transparent"
iconSource: "qrc:/qml/img/cleariconactive.png" width: 20
style: Button
ButtonStyle { {
background: id: clearButton
Rectangle { action: clearAction
height: LogsPaneStyle.generic.layout.headerButtonHeight anchors.fill: parent
implicitHeight: LogsPaneStyle.generic.layout.headerButtonHeight anchors.verticalCenter: parent.verticalCenter
color: "transparent" height: 25
style:
ButtonStyle {
background:
Rectangle {
height: LogsPaneStyle.generic.layout.headerButtonHeight
implicitHeight: LogsPaneStyle.generic.layout.headerButtonHeight
color: "transparent"
}
} }
} }
}
Image { Image {
id: clearImage id: clearImage
source: "qrc:/qml/img/cleariconactive.png" source: "qrc:/qml/img/cleariconactive.png"
anchors.centerIn: parent anchors.centerIn: parent
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
width: 30 width: 20
height: 30 height: 20
} }
Button Action {
{ id: clearAction
id: exitButton enabled: logsModel.count > 0
height: LogsPaneStyle.generic.layout.headerButtonHeight tooltip: qsTr("Clear")
anchors.verticalCenter: parent.verticalCenter onTriggered: {
action: exitAction logsModel.clear();
iconSource: "qrc:/qml/img/exit.png"
style:
ButtonStyle {
background:
Rectangle {
height: LogsPaneStyle.generic.layout.headerButtonHeight
color: "transparent"
} }
} }
} }
Button Rectangle
{ {
id: copyButton
height: LogsPaneStyle.generic.layout.headerButtonHeight height: LogsPaneStyle.generic.layout.headerButtonHeight
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
action: copytoClipBoardAction color: "transparent"
iconSource: "qrc:/qml/img/copyiconactive.png" width: 20
style: Button
ButtonStyle { {
background: id: copyButton
Rectangle { action: copyAction
height: LogsPaneStyle.generic.layout.headerButtonHeight anchors.fill: parent
color: "transparent" anchors.verticalCenter: parent.verticalCenter
height: 25
style:
ButtonStyle {
background:
Rectangle {
height: LogsPaneStyle.generic.layout.headerButtonHeight
implicitHeight: LogsPaneStyle.generic.layout.headerButtonHeight
color: "transparent"
}
} }
} }
}
Action {
id: clearAction
tooltip: qsTr("Hide")
onTriggered: {
logsPane.parent.toggle();
}
}
Action { Image {
id: hideAction id: copyImage
enabled: logsModel.count > 0 source: "qrc:/qml/img/copyiconactive.png"
tooltip: qsTr("Clear") anchors.centerIn: parent
onTriggered: { fillMode: Image.PreserveAspectFit
logsModel.clear() width: 20
height: 20
} }
}
Action { Action {
id: copytoClipBoardAction id: copyAction
enabled: logsModel.count > 0 enabled: logsModel.count > 0
tooltip: qsTr("Copy to Clipboard") tooltip: qsTr("Copy to Clipboard")
onTriggered: { onTriggered: {
var content = ""; var content = "";
for (var k = 0; k < logsModel.count; k++) for (var k = 0; k < logsModel.count; k++)
{ {
var log = logsModel.get(k); var log = logsModel.get(k);
content += log.type + "\t" + log.level + "\t" + log.date + "\t" + log.content + "\n"; content += log.type + "\t" + log.level + "\t" + log.date + "\t" + log.content + "\n";
}
clipboard.text = content;
} }
clipboard.text = content;
} }
} }
@ -427,10 +448,22 @@ Rectangle
font.family: LogsPaneStyle.generic.layout.logLabelFont font.family: LogsPaneStyle.generic.layout.logLabelFont
font.pointSize: Style.absoluteSize(-3) font.pointSize: Style.absoluteSize(-3)
font.italic: true font.italic: true
text: qsTr("Search") text: qsTr(" - Search - ")
onFocusChanged:
{
if (!focus && text === "")
text = qsTr(" - Search - ");
else if (focus && text === qsTr(" - Search - "))
text = "";
}
onTextChanged: { onTextChanged: {
proxyModel.search(text); if (text === qsTr(" - Search - "))
proxyModel.search("");
else
proxyModel.search(text);
} }
style: style:
TextFieldStyle { TextFieldStyle {
background: Rectangle { background: Rectangle {
@ -438,6 +471,49 @@ Rectangle
} }
} }
} }
Rectangle
{
height: LogsPaneStyle.generic.layout.headerButtonHeight
anchors.verticalCenter: parent.verticalCenter
color: "transparent"
width: 20
Button
{
id: hideButton
action: hideAction
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter
height: 25
style:
ButtonStyle {
background:
Rectangle {
height: LogsPaneStyle.generic.layout.headerButtonHeight
implicitHeight: LogsPaneStyle.generic.layout.headerButtonHeight
color: "transparent"
}
}
}
Image {
id: hideImage
source: "qrc:/qml/img/exit.png"
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
width: 20
height: 20
}
Action {
id: hideAction
tooltip: qsTr("Exit")
onTriggered: {
logsPane.parent.toggle();
}
}
}
} }
} }
} }

2
mix/qml/LogsPaneStyle.qml

@ -12,7 +12,7 @@ QtObject {
property QtObject layout: QtObject { property QtObject layout: QtObject {
property string backgroundColor: "#f7f7f7" property string backgroundColor: "#f7f7f7"
property int headerHeight: 30 property int headerHeight: 30
property int headerButtonSpacing: 1 property int headerButtonSpacing: 0
property int leftMargin: 10 property int leftMargin: 10
property int headerButtonHeight: 30 property int headerButtonHeight: 30
property string logLabelColor: "#808080" property string logLabelColor: "#808080"

Loading…
Cancel
Save