Enforcing coding convention

This commit is contained in:
Jaime van Kessel 2015-09-02 13:38:06 +02:00
parent 482d773971
commit c094344ae7

View File

@ -63,7 +63,8 @@ Rectangle
onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex); onCurrentModeIndexChanged: UM.Preferences.setValue("cura/active_mode", currentModeIndex);
} }
Item { Item
{
id: variantItem; id: variantItem;
anchors.top: header.bottom; anchors.top: header.bottom;
@ -71,9 +72,11 @@ Rectangle
visible: UM.MachineManager.hasVariants; visible: UM.MachineManager.hasVariants;
Row { Row
{
spacing: UM.Theme.sizes.default_margin.width; spacing: UM.Theme.sizes.default_margin.width;
Label { Label
{
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
text: catalog.i18nc("@label","Variant"); text: catalog.i18nc("@label","Variant");
} }
@ -84,9 +87,12 @@ Rectangle
textRole: "name" textRole: "name"
onActivated: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name); onActivated: UM.MachineManager.setActiveMachineVariant(model.getItem(index).name);
currentIndex: { currentIndex:
for(var i = 0; i < model.rowCount(); ++i) { {
if(model.getItem(i).name == UM.MachineManager.activeMachineVariant) { for(var i = 0; i < model.rowCount(); ++i)
{
if(model.getItem(i).name == UM.MachineManager.activeMachineVariant)
{
return i; return i;
} }
} }
@ -97,27 +103,33 @@ Rectangle
} }
} }
Item { Item
{
id: profileItem; id: profileItem;
anchors.top: variantItem.bottom; anchors.top: variantItem.bottom;
height: UM.Theme.sizes.setting.height; height: UM.Theme.sizes.setting.height;
Row { Row
{
spacing: UM.Theme.sizes.default_margin.width; spacing: UM.Theme.sizes.default_margin.width;
Label { Label
{
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
text: "Global Profile"; text: "Global Profile";
} }
ComboBox { ComboBox
{
anchors.verticalCenter: parent.verticalCenter; anchors.verticalCenter: parent.verticalCenter;
model: UM.ProfilesModel { } model: UM.ProfilesModel { }
textRole: "name" textRole: "name"
onActivated: UM.MachineManager.setActiveProfile(model.getItem(index).name) onActivated: UM.MachineManager.setActiveProfile(model.getItem(index).name)
currentIndex: { currentIndex:
for(var i = 0; i < model.rowCount(); ++i) { {
for(var i = 0; i < model.rowCount(); ++i)
{
if(model.getItem(i).name == UM.MachineManager.activeProfile) if(model.getItem(i).name == UM.MachineManager.activeProfile)
return i; return i;
} }
@ -126,13 +138,15 @@ Rectangle
} }
} }
Button{ Button
{
text: catalog.i18nc("@action:button", "Save"); text: catalog.i18nc("@action:button", "Save");
} }
} }
} }
Loader { Loader
{
id: sidebarContents; id: sidebarContents;
anchors.bottom: saveButton.top anchors.bottom: saveButton.top
anchors.top: profileItem.bottom anchors.top: profileItem.bottom
@ -160,7 +174,8 @@ Rectangle
} }
} }
SaveButton { SaveButton
{
id: saveButton; id: saveButton;
implicitWidth: base.width implicitWidth: base.width
implicitHeight: totalHeight implicitHeight: totalHeight