mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-12-11 16:00:47 -07:00
Add extruder button bar that shows icons for each extruder in a horizontal row 💪
Make ExtruderButton more generic by moving functionality out. Remove background color from ToolbarButton and add that background color to the Toolbar.qml. Fix Toolbar border being created by overlapping rectangles instead of using border Add scaling options for ToolBarButtons icon CURA-9793
This commit is contained in:
parent
30d886cfcd
commit
631d6a15b0
6 changed files with 70 additions and 18 deletions
|
|
@ -5,7 +5,7 @@ import QtQuick 2.2
|
|||
import QtQuick.Controls 2.3
|
||||
|
||||
import UM 1.5 as UM
|
||||
import Cura 1.0 as Cura
|
||||
import Cura 1.7 as Cura
|
||||
|
||||
Item
|
||||
{
|
||||
|
|
@ -29,13 +29,13 @@ Item
|
|||
anchors
|
||||
{
|
||||
fill: toolButtons
|
||||
leftMargin: -radius - border.width
|
||||
rightMargin: -border.width
|
||||
topMargin: -border.width
|
||||
bottomMargin: -border.width
|
||||
leftMargin: -radius - border.width // Removes border on left side
|
||||
}
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
color: UM.Theme.getColor("lining")
|
||||
color: UM.Theme.getColor("toolbar_background")
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
|
||||
}
|
||||
|
||||
Column
|
||||
|
|
@ -111,13 +111,12 @@ Item
|
|||
anchors
|
||||
{
|
||||
fill: extruderButtons
|
||||
leftMargin: -radius - border.width
|
||||
rightMargin: -border.width
|
||||
topMargin: -border.width
|
||||
bottomMargin: -border.width
|
||||
leftMargin: -radius - border.width // Removes border on left side
|
||||
}
|
||||
radius: UM.Theme.getSize("default_radius").width
|
||||
color: UM.Theme.getColor("lining")
|
||||
color: UM.Theme.getColor("toolbar_background")
|
||||
border.color: UM.Theme.getColor("lining")
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
visible: extrudersModel.items.length > 1
|
||||
}
|
||||
|
||||
|
|
@ -135,11 +134,20 @@ Item
|
|||
height: childrenRect.height
|
||||
model: extrudersModel.items.length > 1 ? extrudersModel : 0
|
||||
|
||||
delegate: ExtruderButton
|
||||
delegate: Cura.ExtruderButton
|
||||
{
|
||||
extruder: model
|
||||
isTopElement: extrudersModel.getItem(0).id == model.id
|
||||
isBottomElement: extrudersModel.getItem(extrudersModel.rowCount() - 1).id == model.id
|
||||
text: catalog.i18ncp("@label %1 is filled in with the name of an extruder", "Print Selected Model with %1", "Print Selected Models with %1", UM.Selection.selectionCount).arg(extruder.name)
|
||||
checked: Cura.ExtruderManager.selectedObjectExtruders.indexOf(extruder.id) != -1
|
||||
enabled: UM.Selection.hasSelection && extruder.stack.isEnabled
|
||||
|
||||
onClicked:
|
||||
{
|
||||
forceActiveFocus() //First grab focus, so all the text fields are updated
|
||||
CuraActions.setExtruderForSelection(extruder.id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue