From 42d73836f400357e73d288d0a3be56848f7743f6 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 20 Nov 2018 14:19:55 +0100 Subject: [PATCH] Move default margin by default to Cura's action buttons So we don't have to repeat that every time you create a new button. Contributes to issue CURA-5876. --- resources/qml/ActionButton.qml | 3 +++ resources/qml/ActionPanel/OutputDevicesActionButton.qml | 2 ++ resources/qml/ActionPanel/OutputProcessWidget.qml | 2 -- resources/qml/MainWindow/MainWindowHeader.qml | 2 -- resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml | 4 ---- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 2a8b894867..08c44fb473 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -29,6 +29,9 @@ Button // we elide the text to the right so the text will be cut off with the three dots at the end. property var fixedWidthMode: false + leftPadding: UM.Theme.getSize("default_margin").width + rightPadding: UM.Theme.getSize("default_margin").width + contentItem: Row { UM.RecolorImage diff --git a/resources/qml/ActionPanel/OutputDevicesActionButton.qml b/resources/qml/ActionPanel/OutputDevicesActionButton.qml index be79a1893e..a2a69ed526 100644 --- a/resources/qml/ActionPanel/OutputDevicesActionButton.qml +++ b/resources/qml/ActionPanel/OutputDevicesActionButton.qml @@ -48,6 +48,8 @@ Item right: parent.right } + leftPadding: UM.Theme.getSize("narrow_margin").width //Need more space than usual here for wide text. + rightPadding: UM.Theme.getSize("narrow_margin").width tooltip: catalog.i18nc("@info:tooltip", "Select the active output device") iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom") color: UM.Theme.getColor("action_panel_secondary") diff --git a/resources/qml/ActionPanel/OutputProcessWidget.qml b/resources/qml/ActionPanel/OutputProcessWidget.qml index f4e014b1ec..772c05741f 100644 --- a/resources/qml/ActionPanel/OutputProcessWidget.qml +++ b/resources/qml/ActionPanel/OutputProcessWidget.qml @@ -104,8 +104,6 @@ Column { id: previewStageShortcut - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width height: UM.Theme.getSize("action_panel_button").height text: catalog.i18nc("@button", "Preview") color: UM.Theme.getColor("secondary") diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 59ec542e6b..6f3358648b 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -81,8 +81,6 @@ Rectangle rightMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter } - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width text: catalog.i18nc("@action:button", "Marketplace") height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) color: UM.Theme.getColor("main_window_header_secondary_button_background_active") diff --git a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml index fe292799a5..cb90735250 100644 --- a/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml +++ b/resources/qml/Menus/ConfigurationMenu/ConfigurationMenu.qml @@ -172,8 +172,6 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") height: UM.Theme.getSize("action_panel_button").height - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width onClicked: popupItem.configuration_method = "custom" } @@ -195,8 +193,6 @@ Cura.ExpandableComponent textColor: UM.Theme.getColor("primary") textHoverColor: UM.Theme.getColor("text") height: UM.Theme.getSize("action_panel_button").height - leftPadding: UM.Theme.getSize("default_margin").width - rightPadding: UM.Theme.getSize("default_margin").width onClicked: popupItem.configuration_method = "auto" }