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.
This commit is contained in:
Ghostkeeper 2018-11-20 14:19:55 +01:00
parent cbd5238738
commit 42d73836f4
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
5 changed files with 5 additions and 8 deletions

View file

@ -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. // 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 property var fixedWidthMode: false
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
contentItem: Row contentItem: Row
{ {
UM.RecolorImage UM.RecolorImage

View file

@ -48,6 +48,8 @@ Item
right: parent.right 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") tooltip: catalog.i18nc("@info:tooltip", "Select the active output device")
iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom") iconSource: popup.opened ? UM.Theme.getIcon("arrow_top") : UM.Theme.getIcon("arrow_bottom")
color: UM.Theme.getColor("action_panel_secondary") color: UM.Theme.getColor("action_panel_secondary")

View file

@ -104,8 +104,6 @@ Column
{ {
id: previewStageShortcut id: previewStageShortcut
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
height: UM.Theme.getSize("action_panel_button").height height: UM.Theme.getSize("action_panel_button").height
text: catalog.i18nc("@button", "Preview") text: catalog.i18nc("@button", "Preview")
color: UM.Theme.getColor("secondary") color: UM.Theme.getColor("secondary")

View file

@ -81,8 +81,6 @@ Rectangle
rightMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
} }
leftPadding: UM.Theme.getSize("default_margin").width
rightPadding: UM.Theme.getSize("default_margin").width
text: catalog.i18nc("@action:button", "Marketplace") text: catalog.i18nc("@action:button", "Marketplace")
height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
color: UM.Theme.getColor("main_window_header_secondary_button_background_active") color: UM.Theme.getColor("main_window_header_secondary_button_background_active")

View file

@ -172,8 +172,6 @@ Cura.ExpandableComponent
textColor: UM.Theme.getColor("primary") textColor: UM.Theme.getColor("primary")
textHoverColor: UM.Theme.getColor("text") textHoverColor: UM.Theme.getColor("text")
height: UM.Theme.getSize("action_panel_button").height 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" onClicked: popupItem.configuration_method = "custom"
} }
@ -195,8 +193,6 @@ Cura.ExpandableComponent
textColor: UM.Theme.getColor("primary") textColor: UM.Theme.getColor("primary")
textHoverColor: UM.Theme.getColor("text") textHoverColor: UM.Theme.getColor("text")
height: UM.Theme.getSize("action_panel_button").height 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" onClicked: popupItem.configuration_method = "auto"
} }