mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 20:39:01 +08:00
Merge pull request #3977 from fieldOfView/fix_preference_pages
Fixes for preference pages
This commit is contained in:
commit
ee2dfffb84
@ -404,6 +404,8 @@ Item
|
|||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
|
property bool isCurrentItem: parent.ListView.isCurrentItem
|
||||||
|
|
||||||
property bool isItemActivated:
|
property bool isItemActivated:
|
||||||
{
|
{
|
||||||
const extruder_position = Cura.ExtruderManager.activeExtruderIndex;
|
const extruder_position = Cura.ExtruderManager.activeExtruderIndex;
|
||||||
@ -416,7 +418,7 @@ Item
|
|||||||
width: Math.floor(parent.height * 0.8)
|
width: Math.floor(parent.height * 0.8)
|
||||||
height: Math.floor(parent.height * 0.8)
|
height: Math.floor(parent.height * 0.8)
|
||||||
color: model.color_code
|
color: model.color_code
|
||||||
border.color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text;
|
border.color: materialRow.isCurrentItem ? palette.highlightedText : palette.text;
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
@ -425,14 +427,14 @@ Item
|
|||||||
text: model.material
|
text: model.material
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.italic: materialRow.isItemActivated
|
font.italic: materialRow.isItemActivated
|
||||||
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text;
|
color: materialRow.isCurrentItem ? palette.highlightedText : palette.text;
|
||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: (model.name != model.material) ? model.name : ""
|
text: (model.name != model.material) ? model.name : ""
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
font.italic: materialRow.isItemActivated
|
font.italic: materialRow.isItemActivated
|
||||||
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text;
|
color: materialRow.isCurrentItem ? palette.highlightedText : palette.text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -377,6 +377,20 @@ Item
|
|||||||
|
|
||||||
model: qualitiesModel
|
model: qualitiesModel
|
||||||
|
|
||||||
|
Component.onCompleted:
|
||||||
|
{
|
||||||
|
var selectedItemName = Cura.MachineManager.activeQualityOrQualityChangesName;
|
||||||
|
|
||||||
|
// Select the required quality name if given
|
||||||
|
for (var idx = 0; idx < qualitiesModel.rowCount(); idx++) {
|
||||||
|
var item = qualitiesModel.getItem(idx);
|
||||||
|
if (item.name == selectedItemName) {
|
||||||
|
currentIndex = idx;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
section.property: "is_read_only"
|
section.property: "is_read_only"
|
||||||
section.delegate: Rectangle
|
section.delegate: Rectangle
|
||||||
{
|
{
|
||||||
@ -395,22 +409,20 @@ Item
|
|||||||
{
|
{
|
||||||
width: profileScrollView.width
|
width: profileScrollView.width
|
||||||
height: childrenRect.height
|
height: childrenRect.height
|
||||||
color: ListView.isCurrentItem ? palette.highlight : (model.index % 2) ? palette.base : palette.alternateBase
|
|
||||||
|
|
||||||
Row
|
property bool isCurrentItem: ListView.isCurrentItem
|
||||||
|
color: isCurrentItem ? palette.highlight : (model.index % 2) ? palette.base : palette.alternateBase
|
||||||
|
|
||||||
|
Label
|
||||||
{
|
{
|
||||||
spacing: (UM.Theme.getSize("default_margin").width / 2) | 0
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
Label
|
width: Math.floor((parent.width * 0.8))
|
||||||
{
|
text: model.name
|
||||||
width: Math.floor((parent.width * 0.8))
|
elide: Text.ElideRight
|
||||||
text: model.name
|
font.italic: model.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
||||||
elide: Text.ElideRight
|
color: parent.isCurrentItem ? palette.highlightedText : palette.text
|
||||||
font.italic: model.name == Cura.MachineManager.activeQualityOrQualityChangesName
|
|
||||||
color: parent.ListView.isCurrentItem ? palette.highlightedText : palette.text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea
|
MouseArea
|
||||||
|
Loading…
x
Reference in New Issue
Block a user