diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index b14734dfb1..b6657f112e 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -15,7 +15,7 @@ Cura.ExpandableComponent property bool isPrinterConnected: Cura.MachineManager.printerConnected property var outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null - popupPadding: 0 + popupPadding: UM.Theme.getSize("default_lining").width popupAlignment: Cura.ExpandableComponent.PopupAlignment.AlignLeft iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") @@ -90,8 +90,7 @@ Cura.ExpandableComponent MachineSelectorList { // Can't use parent.width since the parent is the flickable component and not the ScrollView - width: scroll.width - 2 * UM.Theme.getSize("default_lining").width - x: UM.Theme.getSize("default_lining").width + width: scroll.width property real maximumHeight: UM.Theme.getSize("machine_selector_widget_content").height - buttonRow.height onHeightChanged: diff --git a/resources/qml/ViewsSelector.qml b/resources/qml/ViewsSelector.qml index b9048803a2..e9fdd57177 100644 --- a/resources/qml/ViewsSelector.qml +++ b/resources/qml/ViewsSelector.qml @@ -11,6 +11,8 @@ Cura.ExpandableComponent { id: viewSelector + popupPadding: UM.Theme.getSize("default_lining").width + popupAlignment: Cura.ExpandableComponent.PopupAlignment.AlignLeft iconSource: expanded ? UM.Theme.getIcon("arrow_bottom") : UM.Theme.getIcon("arrow_left") property var viewModel: UM.ViewModel { } @@ -71,25 +73,51 @@ Cura.ExpandableComponent popupItem: Column { id: viewSelectorPopup - width: viewSelector.width - 2 * UM.Theme.getSize("default_margin").width + width: viewSelector.width - 2 * viewSelector.popupPadding // For some reason the height/width of the column gets set to 0 if this is not set... Component.onCompleted: { height = implicitHeight - width = viewSelector.width - 2 * UM.Theme.getSize("default_margin").width + width = viewSelector.width - 2 * viewSelector.popupPadding } Repeater { id: viewsList model: viewSelector.viewModel - RoundButton + + delegate: Button { - text: name - radius: UM.Theme.getSize("default_radius").width + id: viewsSelectorButton + text: model.name + width: parent.width + height: UM.Theme.getSize("action_button").height + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width checkable: true checked: viewSelector.activeView != null ? viewSelector.activeView.id == id : false + + contentItem: Label + { + id: buttonText + text: viewsSelectorButton.text + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("action_button") + renderType: Text.NativeRendering + verticalAlignment: Text.AlignVCenter + elide: Text.ElideRight + } + + background: Rectangle + { + id: backgroundRect + color: viewsSelectorButton.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent" + radius: UM.Theme.getSize("action_button_radius").width + border.width: UM.Theme.getSize("default_lining").width + border.color: viewsSelectorButton.checked ? UM.Theme.getColor("primary") : "transparent" + } + onClicked: { viewSelector.togglePopup() @@ -97,6 +125,5 @@ Cura.ExpandableComponent } } } - } } \ No newline at end of file