Browse Source

LogsPanel

cl-refactor
yann300 10 years ago
parent
commit
600b12ab78
  1. 43
      mix/qml/LogsPane.qml
  2. 2
      mix/qml/LogsPaneStyle.qml
  3. 10
      mix/qml/StatusPane.qml

43
mix/qml/LogsPane.qml

@ -13,6 +13,11 @@ Rectangle
logsModel.insert(0, { "type": _type, "date": Qt.formatDateTime(new Date(), "hh:mm:ss"), "content": _content, "level": _level });
}
Keys.onEscapePressed:
{
parent.toggle();
}
anchors.fill: parent
radius: 5
color: "transparent"
@ -33,7 +38,7 @@ Rectangle
height: parent.height
width: parent.width
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
ColumnLayout
Column
{
id: logsRect
spacing: 0
@ -93,6 +98,26 @@ Rectangle
return index % 2 === 0 ? "transparent" : LogsPaneStyle.generic.layout.logAlternateColor;
}
MouseArea
{
anchors.fill: parent
onClicked:
{
if (logContent.elide === Text.ElideNone)
{
logContent.elide = Text.ElideRight;
logContent.wrapMode = Text.NoWrap
parent.height = 30;
}
else
{
logContent.elide = Text.ElideNone;
logContent.wrapMode = Text.WordWrap;
parent.height = logContent.lineCount * 30;
}
}
}
DefaultLabel {
text: date;
@ -120,12 +145,16 @@ Rectangle
}
}
DefaultLabel {
Text {
id: logContent
text: content;
font.family: LogsPaneStyle.generic.layout.logLabelFont
width: LogsPaneStyle.generic.layout.contentWidth
font.pointSize: Style.absoluteSize(-1)
anchors.verticalCenter: parent.verticalCenter
elide: Text.ElideRight
maximumLineCount: 10
anchors.left: parent.left
anchors.leftMargin: 190
color: {
@ -145,11 +174,8 @@ Rectangle
}
}
}
}
Component {
id: itemDelegate
DefaultLabel {
@ -166,7 +192,6 @@ Rectangle
}
}
}
}
Rectangle
@ -377,7 +402,7 @@ Rectangle
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
width: 20
height: 20
height: 25
}
Action {
@ -420,7 +445,7 @@ Rectangle
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
width: 20
height: 20
height: 25
}
Action {
@ -503,7 +528,7 @@ Rectangle
anchors.centerIn: parent
fillMode: Image.PreserveAspectFit
width: 20
height: 20
height: 25
}
Action {

2
mix/qml/LogsPaneStyle.qml

@ -20,7 +20,7 @@ QtObject {
property int headerInputWidth: 200
property int dateWidth: 70
property int typeWidth: 90
property int contentWidth: 250
property int contentWidth: 560
property string logAlternateColor: "#f6f5f6"
}
}

10
mix/qml/StatusPane.qml

@ -112,7 +112,7 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
radius: 3
width: 650
width: 600
height: 30
color: "#fcfbfc"
Text {
@ -201,8 +201,8 @@ Rectangle {
{
logsContainer.state = "opened";
logsContainer.focus = true;
calCoord();
forceActiveFocus();
calCoord();
}
}
@ -213,10 +213,6 @@ Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
visible: false
radius: 5
Component.onCompleted:
{
calCoord();
}
function calCoord()
{
@ -225,7 +221,7 @@ Rectangle {
top = top.parent
var coordinates = logsContainer.mapToItem(top, 0, 0);
logsContainer.parent = top;
logsContainer.x = coordinates.x + 150;
logsContainer.x = coordinates.x;
logsContainer.y = coordinates.y;
}

Loading…
Cancel
Save