mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Filter bar is now always visible
CURA-3574
This commit is contained in:
parent
f04d1efb8d
commit
88704051d1
2 changed files with 5 additions and 58 deletions
|
|
@ -18,23 +18,10 @@ Item
|
|||
signal showTooltip(Item item, point location, string text);
|
||||
signal hideTooltip();
|
||||
|
||||
function toggleFilterField()
|
||||
{
|
||||
filterContainer.visible = !filterContainer.visible
|
||||
if(filterContainer.visible)
|
||||
{
|
||||
filter.forceActiveFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
filter.text = "";
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: filterContainer
|
||||
visible: false
|
||||
visible: true
|
||||
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color:
|
||||
|
|
@ -70,7 +57,7 @@ Item
|
|||
anchors.right: clearFilterButton.left
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
|
||||
placeholderText: catalog.i18nc("@label:textbox", "Filter...")
|
||||
placeholderText: catalog.i18nc("@label:textbox", "Search...")
|
||||
|
||||
style: TextFieldStyle
|
||||
{
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ Rectangle
|
|||
anchors.left: parent.left
|
||||
anchors.leftMargin: model.index * (settingsModeSelection.width / 2)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
width: 0.5 * parent.width - (model.showFilterButton ? toggleFilterButton.width : 0)
|
||||
width: 0.5 * parent.width
|
||||
text: model.text
|
||||
exclusiveGroup: modeMenuGroup;
|
||||
checkable: true;
|
||||
|
|
@ -418,44 +418,6 @@ Rectangle
|
|||
}
|
||||
}
|
||||
|
||||
Button
|
||||
{
|
||||
id: toggleFilterButton
|
||||
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||
anchors.top: headerSeparator.bottom
|
||||
anchors.topMargin: UM.Theme.getSize("default_margin").height
|
||||
|
||||
height: settingsModeSelection.height
|
||||
width: visible ? height : 0
|
||||
|
||||
visible: !monitoringPrint && !hideSettings && modesListModel.get(base.currentModeIndex) != undefined && modesListModel.get(base.currentModeIndex).showFilterButton
|
||||
opacity: visible ? 1 : 0
|
||||
|
||||
onClicked: sidebarContents.currentItem.toggleFilterField()
|
||||
|
||||
style: ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
border.color: UM.Theme.getColor("toggle_checked_border")
|
||||
color: visible ? UM.Theme.getColor("toggle_checked") : UM.Theme.getColor("toggle_hovered")
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
}
|
||||
label: UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width / 2
|
||||
|
||||
source: UM.Theme.getIcon("search")
|
||||
color: UM.Theme.getColor("toggle_checked_text")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
StackView
|
||||
{
|
||||
id: sidebarContents
|
||||
|
|
@ -570,14 +532,12 @@ Rectangle
|
|||
modesListModel.append({
|
||||
text: catalog.i18nc("@title:tab", "Recommended"),
|
||||
tooltipText: catalog.i18nc("@tooltip", "<b>Recommended Print Setup</b><br/><br/>Print with the recommended settings for the selected printer, material and quality."),
|
||||
item: sidebarSimple,
|
||||
showFilterButton: false
|
||||
item: sidebarSimple
|
||||
})
|
||||
modesListModel.append({
|
||||
text: catalog.i18nc("@title:tab", "Custom"),
|
||||
tooltipText: catalog.i18nc("@tooltip", "<b>Custom Print Setup</b><br/><br/>Print with finegrained control over every last bit of the slicing process."),
|
||||
item: sidebarAdvanced,
|
||||
showFilterButton: true
|
||||
item: sidebarAdvanced
|
||||
})
|
||||
sidebarContents.push({ "item": modesListModel.get(base.currentModeIndex).item, "immediate": true });
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue