Browse Source

LogsPane ui changes

cl-refactor
yann300 10 years ago
parent
commit
77dd1ce169
  1. 8
      mix/qml/LogsPane.qml
  2. 27
      mix/qml/StatusPane.qml

8
mix/qml/LogsPane.qml

@ -6,7 +6,9 @@ import org.ethereum.qml.SortFilterProxyModel 1.0
Rectangle Rectangle
{ {
property variant currentStatus; property variant currentStatus
property int contentXPos: logStyle.generic.layout.dateWidth + logStyle.generic.layout.typeWidth - 70
function clear() function clear()
{ {
logsModel.clear(); logsModel.clear();
@ -117,6 +119,10 @@ Rectangle
return cl; return cl;
} }
Component.onCompleted:
{
logsPane.contentXPos = logContent.x
}
MouseArea MouseArea
{ {

27
mix/qml/StatusPane.qml

@ -284,14 +284,17 @@ Rectangle {
{ {
if (logsContainer.state === "opened") if (logsContainer.state === "opened")
{ {
statusContainer.visible = true
logsContainer.state = "closed" logsContainer.state = "closed"
} }
else else
{ {
statusContainer.visible = false
logsContainer.state = "opened"; logsContainer.state = "opened";
logsContainer.focus = true; logsContainer.focus = true;
forceActiveFocus(); forceActiveFocus();
calCoord(); calCoord()
move()
} }
} }
@ -304,20 +307,30 @@ Rectangle {
function calCoord() function calCoord()
{ {
if (!logsContainer.parent.parent)
return
var top = logsContainer; var top = logsContainer;
while (top.parent) while (top.parent)
top = top.parent top = top.parent
var coordinates = logsContainer.mapToItem(top, 0, 0); var coordinates = logsContainer.mapToItem(top, 0, 0);
logsContainer.parent = top; logsContainer.parent = top;
logsShadow.parent = top; logsShadow.parent = top;
logsContainer.x = status.x + statusContainer.x - logStyle.generic.layout.dateWidth - logStyle.generic.layout.typeWidth + 70 top.onWidthChanged.connect(move)
logsShadow.x = status.x + statusContainer.x - logStyle.generic.layout.dateWidth - logStyle.generic.layout.typeWidth + 70; top.onHeightChanged.connect(move)
}
function move()
{
var statusGlobalCoord = status.mapToItem(null, 0, 0);
console.log("ddd " + statusGlobalCoord.x);
logsContainer.x = statusGlobalCoord.x - logPane.contentXPos
logsShadow.x = statusGlobalCoord.x - logPane.contentXPos
logsShadow.z = 1 logsShadow.z = 1
logsContainer.z = 2 logsContainer.z = 2
if (Qt.platform.os === "osx") if (Qt.platform.os === "osx")
{ {
logsContainer.y = statusContainer.y; logsContainer.y = statusGlobalCoord.y;
logsShadow.y = statusContainer.y; logsShadow.y = statusGlobalCoord.y;
} }
} }
@ -328,6 +341,10 @@ Rectangle {
LogsPane LogsPane
{ {
id: logPane; id: logPane;
onContentXPosChanged:
{
parent.move();
}
} }
states: [ states: [

Loading…
Cancel
Save