From 4f0c24fecb19628faec2c58597d8a823bfc98ae5 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Sun, 12 Apr 2020 09:23:54 +0200 Subject: [PATCH] Reorder code for readability --- cura/UI/ObjectsModel.py | 2 +- resources/qml/ObjectItemButton.qml | 23 ++++++++++++----------- resources/qml/ObjectSelector.qml | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/cura/UI/ObjectsModel.py b/cura/UI/ObjectsModel.py index b4b1501ab7..c87f1010a9 100644 --- a/cura/UI/ObjectsModel.py +++ b/cura/UI/ObjectsModel.py @@ -1,4 +1,4 @@ -# Copyright (c) 2019 Ultimaker B.V. +# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from UM.Logger import Logger import re diff --git a/resources/qml/ObjectItemButton.qml b/resources/qml/ObjectItemButton.qml index 0cb63359d0..52f97ffe65 100644 --- a/resources/qml/ObjectItemButton.qml +++ b/resources/qml/ObjectItemButton.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2020 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -18,6 +18,17 @@ Button checkable: true hoverEnabled: true + onClicked: Cura.SceneController.changeSelection(index) + + background: Rectangle + { + id: backgroundRect + color: objectItemButton.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: objectItemButton.checked ? UM.Theme.getColor("primary") : "transparent" + } + contentItem: Item { width: objectItemButton.width - objectItemButton.leftPadding @@ -126,15 +137,6 @@ Button } } - background: Rectangle - { - id: backgroundRect - color: objectItemButton.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: objectItemButton.checked ? UM.Theme.getColor("primary") : "transparent" - } - TextMetrics { id: buttonTextMetrics @@ -151,5 +153,4 @@ Button visible: objectItemButton.hovered && buttonTextMetrics.elidedText != buttonText.text } - onClicked: Cura.SceneController.changeSelection(index) } diff --git a/resources/qml/ObjectSelector.qml b/resources/qml/ObjectSelector.qml index b004095f74..15cb476e08 100644 --- a/resources/qml/ObjectSelector.qml +++ b/resources/qml/ObjectSelector.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2020 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10