From a7446d681f443a8430e100b51eb693ff533b63ea Mon Sep 17 00:00:00 2001 From: Konstantinos Karmas Date: Thu, 1 Jul 2021 14:20:57 +0200 Subject: [PATCH] Set header border and color by default in ExpandablePopup and Component CURA-8202 --- plugins/MonitorStage/MonitorMenu.qml | 2 -- plugins/PrepareStage/PrepareMenu.qml | 4 ---- plugins/PreviewStage/PreviewMenu.qml | 2 -- plugins/SimulationView/SimulationViewMenuComponent.qml | 2 -- resources/qml/ExpandableComponent.qml | 6 ++++++ resources/qml/ExpandablePopup.qml | 6 ++++++ resources/qml/PrintSetupSelector/PrintSetupSelector.qml | 2 -- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/MonitorStage/MonitorMenu.qml b/plugins/MonitorStage/MonitorMenu.qml index dc339ed8ef..bc95c276e8 100644 --- a/plugins/MonitorStage/MonitorMenu.qml +++ b/plugins/MonitorStage/MonitorMenu.qml @@ -15,8 +15,6 @@ Item Cura.MachineSelector { id: machineSelection - headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width - headerBackgroundBorder.color: UM.Theme.getColor("lining") headerCornerSide: Cura.RoundedRectangle.Direction.All width: UM.Theme.getSize("machine_selector_widget").width height: parent.height diff --git a/plugins/PrepareStage/PrepareMenu.qml b/plugins/PrepareStage/PrepareMenu.qml index 012d2b9d36..82f61da069 100644 --- a/plugins/PrepareStage/PrepareMenu.qml +++ b/plugins/PrepareStage/PrepareMenu.qml @@ -52,8 +52,6 @@ Item { id: machineSelection headerCornerSide: Cura.RoundedRectangle.Direction.Left - headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width - headerBackgroundBorder.color: UM.Theme.getColor("lining") Layout.preferredWidth: parent.machineSelectorWidth Layout.fillWidth: true Layout.fillHeight: true @@ -62,8 +60,6 @@ Item Cura.ConfigurationMenu { id: printerSetup - headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width - headerBackgroundBorder.color: UM.Theme.getColor("lining") Layout.fillHeight: true Layout.fillWidth: true Layout.preferredWidth: parent.machineSelectorWidth * 2 diff --git a/plugins/PreviewStage/PreviewMenu.qml b/plugins/PreviewStage/PreviewMenu.qml index 290a085772..e6c4a25c4c 100644 --- a/plugins/PreviewStage/PreviewMenu.qml +++ b/plugins/PreviewStage/PreviewMenu.qml @@ -44,8 +44,6 @@ Item id: viewsSelector height: parent.height width: UM.Theme.getSize("views_selector").width - headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width - headerBackgroundBorder.color: UM.Theme.getColor("lining") headerCornerSide: Cura.RoundedRectangle.Direction.Left } diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index a4126db7ab..86e686e0fc 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -16,8 +16,6 @@ Cura.ExpandableComponent id: base dragPreferencesNamePrefix: "view/colorscheme" - headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width - headerBackgroundBorder.color: UM.Theme.getColor("lining") contentHeaderTitle: catalog.i18nc("@label", "Color scheme") diff --git a/resources/qml/ExpandableComponent.qml b/resources/qml/ExpandableComponent.qml index e1c4a03807..415d994ceb 100644 --- a/resources/qml/ExpandableComponent.qml +++ b/resources/qml/ExpandableComponent.qml @@ -56,6 +56,9 @@ Item property alias headerBackgroundBorder: background.border + // Whether or not to show the background border + property bool enableHeaderBackgroundBorder: true + // What icon should be displayed on the right. property alias iconSource: collapseButton.source @@ -116,6 +119,9 @@ Item id: background property real padding: UM.Theme.getSize("default_margin").width + border.width: base.enableHeaderBackgroundBorder ? UM.Theme.getSize("default_lining").width : 0 + border.color: UM.Theme.getColor("lining") + color: base.enabled ? (base.expanded ? headerActiveColor : headerBackgroundColor) : UM.Theme.getColor("disabled") anchors.fill: parent diff --git a/resources/qml/ExpandablePopup.qml b/resources/qml/ExpandablePopup.qml index f47d6239dc..da56470bfb 100644 --- a/resources/qml/ExpandablePopup.qml +++ b/resources/qml/ExpandablePopup.qml @@ -50,6 +50,9 @@ Item property alias headerBackgroundBorder: background.border + // Whether or not to show the background border + property bool enableHeaderBackgroundBorder: true + // What icon should be displayed on the right. property alias iconSource: collapseButton.source @@ -110,6 +113,9 @@ Item id: background property real padding: UM.Theme.getSize("default_margin").width + border.width: base.enableHeaderBackgroundBorder ? UM.Theme.getSize("default_lining").width : 0 + border.color: UM.Theme.getColor("lining") + color: base.enabled ? headerBackgroundColor : UM.Theme.getColor("disabled") anchors.fill: parent diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml index 3bb31fecc1..414c349bb6 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelector.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelector.qml @@ -17,8 +17,6 @@ Cura.ExpandableComponent contentPadding: UM.Theme.getSize("default_lining").width contentHeaderTitle: catalog.i18nc("@label", "Print settings") - headerBackgroundBorder.width: UM.Theme.getSize("default_lining").width - headerBackgroundBorder.color: UM.Theme.getColor("lining") enabled: !preSlicedData disabledText: catalog.i18nc("@label shown when we load a Gcode file", "Print setup disabled. G-code file can not be modified.")