15.10 restyling of the sidebar

Contributes to: issue CURA-60
This commit is contained in:
Tamara Hogenhout 2015-08-31 17:26:40 +02:00
parent 5cbeed753c
commit 33aa5f596f

View File

@ -41,69 +41,61 @@ Rectangle
} }
} }
ColumnLayout SidebarHeader {
{ id: header;
anchors.fill: parent;
anchors.topMargin: UM.Theme.sizes.default_margin.height;
spacing: UM.Theme.sizes.default_margin.height; width: parent.width
height: totalHeightHeader
SidebarHeader addMachineAction: base.addMachineAction;
configureMachinesAction: base.configureMachinesAction;
modesModel: modesListModel;
currentModeIndex:
{ {
id: header; var index = parseInt(UM.Preferences.getValue("cura/active_mode"))
if(index)
Layout.fillWidth: true;
addMachineAction: base.addMachineAction;
configureMachinesAction: base.configureMachinesAction;
modesModel: modesListModel;
currentModeIndex:
{ {
var index = parseInt(UM.Preferences.getValue("cura/active_mode")) return index;
if(index)
{
return index;
}
return 0;
} }
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex); return 0;
} }
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex);
}
Loader Loader{
id: sidebarContents;
anchors.bottom: saveButton.top
anchors.top: header.bottom
anchors.left: base.left
anchors.right: base.right
source: modesListModel.get(header.currentModeIndex).file;
property Item sidebar: base;
onLoaded:
{ {
id: sidebarContents; if(item)
Layout.fillWidth: true;
Layout.fillHeight: true;
source: modesListModel.get(header.currentModeIndex).file;
property Item sidebar: base;
onLoaded:
{ {
if(item) item.configureSettings = base.configureMachinesAction;
if(item.onShowTooltip != undefined)
{ {
item.configureSettings = base.configureMachinesAction; item.showTooltip.connect(base.showTooltip)
if(item.onShowTooltip != undefined) }
{ if(item.onHideTooltip != undefined)
item.showTooltip.connect(base.showTooltip) {
} item.hideTooltip.connect(base.hideTooltip)
if(item.onHideTooltip != undefined)
{
item.hideTooltip.connect(base.hideTooltip)
}
} }
} }
} }
}
SaveButton SaveButton {
{ id: saveButton;
id: saveButton; implicitWidth: base.width
implicitWidth: base.width implicitHeight: totalHeight
implicitHeight: totalHeight anchors.bottom: parent.bottom
}
} }
SidebarTooltip SidebarTooltip