mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06:00
Changed all the action buttons to either use primary or secondary button
CURA-5959
This commit is contained in:
parent
af1ee53578
commit
b82ea58bc8
8 changed files with 81 additions and 44 deletions
|
@ -11,20 +11,16 @@ Row
|
|||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Cura.ActionButton
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
width: UM.Theme.getSize("account_button").width
|
||||
height: UM.Theme.getSize("account_button").height
|
||||
text: catalog.i18nc("@button", "Create account")
|
||||
color: UM.Theme.getColor("secondary")
|
||||
hoverColor: UM.Theme.getColor("secondary")
|
||||
textColor: UM.Theme.getColor("main_window_header_button_text_active")
|
||||
textHoverColor: UM.Theme.getColor("main_window_header_button_text_active")
|
||||
onClicked: Qt.openUrlExternally("https://account.ultimaker.com/app/create")
|
||||
fixedWidthMode: true
|
||||
}
|
||||
|
||||
Cura.ActionButton
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
width: UM.Theme.getSize("account_button").width
|
||||
height: UM.Theme.getSize("account_button").height
|
||||
|
|
|
@ -11,20 +11,16 @@ Row
|
|||
{
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
|
||||
Cura.ActionButton
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
width: UM.Theme.getSize("account_button").width
|
||||
height: UM.Theme.getSize("account_button").height
|
||||
text: catalog.i18nc("@button", "Manage account")
|
||||
color: UM.Theme.getColor("secondary")
|
||||
hoverColor: UM.Theme.getColor("secondary")
|
||||
textColor: UM.Theme.getColor("main_window_header_button_text_active")
|
||||
textHoverColor: UM.Theme.getColor("main_window_header_button_text_active")
|
||||
onClicked: Qt.openUrlExternally("https://account.ultimaker.com")
|
||||
fixedWidthMode: true
|
||||
}
|
||||
|
||||
Cura.ActionButton
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
width: UM.Theme.getSize("account_button").width
|
||||
height: UM.Theme.getSize("account_button").height
|
||||
|
|
|
@ -12,13 +12,12 @@ Item
|
|||
{
|
||||
id: widget
|
||||
|
||||
Cura.ActionButton
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: saveToButton
|
||||
height: parent.height
|
||||
fixedWidthMode: true
|
||||
shadowEnabled: true
|
||||
shadowColor: UM.Theme.getColor("primary_shadow")
|
||||
|
||||
anchors
|
||||
{
|
||||
top: parent.top
|
||||
|
|
|
@ -101,18 +101,13 @@ Column
|
|||
spacing: UM.Theme.getSize("default_margin").width
|
||||
width: parent.width
|
||||
|
||||
Cura.ActionButton
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
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")
|
||||
hoverColor: UM.Theme.getColor("secondary")
|
||||
textColor: UM.Theme.getColor("primary")
|
||||
textHoverColor: UM.Theme.getColor("text")
|
||||
|
||||
onClicked: UM.Controller.setActiveStage("PreviewStage")
|
||||
visible: UM.Controller.activeStage != null && UM.Controller.activeStage.stageId != "PreviewStage"
|
||||
|
||||
|
|
|
@ -81,36 +81,41 @@ Column
|
|||
}
|
||||
}
|
||||
|
||||
Cura.ActionButton
|
||||
{
|
||||
id: prepareButton
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("action_panel_button").height
|
||||
fixedWidthMode: true
|
||||
|
||||
Item
|
||||
{
|
||||
id: prepareButtons
|
||||
// Get the current value from the preferences
|
||||
property bool autoSlice: UM.Preferences.getValue("general/auto_slice")
|
||||
// Disable the slice process when
|
||||
property bool disabledSlice: [UM.Backend.Done, UM.Backend.Error].indexOf(widget.backendState) != -1
|
||||
|
||||
property bool isSlicing: [UM.Backend.NotStarted, UM.Backend.Error].indexOf(widget.backendState) == -1
|
||||
|
||||
text: isSlicing ? catalog.i18nc("@button", "Cancel") : catalog.i18nc("@button", "Slice")
|
||||
|
||||
enabled: !autoSlice && !disabledSlice
|
||||
width: parent.width
|
||||
height: UM.Theme.getSize("action_panel_button").height
|
||||
visible: !autoSlice
|
||||
|
||||
color: isSlicing ? UM.Theme.getColor("secondary"): UM.Theme.getColor("primary")
|
||||
textColor: isSlicing ? UM.Theme.getColor("primary"): UM.Theme.getColor("button_text")
|
||||
outlineColor: "transparent"
|
||||
disabledColor: UM.Theme.getColor("action_button_disabled")
|
||||
textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
|
||||
shadowEnabled: true
|
||||
shadowColor: isSlicing ? UM.Theme.getColor("secondary_shadow") : enabled ? UM.Theme.getColor("action_button_shadow"): UM.Theme.getColor("action_button_disabled_shadow")
|
||||
|
||||
Cura.PrimaryButton
|
||||
{
|
||||
id: sliceButton
|
||||
fixedWidthMode: true
|
||||
anchors.fill: parent
|
||||
text: catalog.i18nc("@button", "Slice")
|
||||
enabled: !autoSlice && widget.backendState != UM.Backend.Error
|
||||
visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error
|
||||
onClicked: sliceOrStopSlicing()
|
||||
}
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: cancelButton
|
||||
fixedWidthMode: true
|
||||
anchors.fill: parent
|
||||
text: catalog.i18nc("@button", "Cancel")
|
||||
enabled: sliceButton.enabled
|
||||
visible: !sliceButton.visible
|
||||
onClicked: sliceOrStopSlicing()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// React when the user changes the preference of having the auto slice enabled
|
||||
Connections
|
||||
{
|
||||
|
@ -118,7 +123,7 @@ Column
|
|||
onPreferenceChanged:
|
||||
{
|
||||
var autoSlice = UM.Preferences.getValue("general/auto_slice")
|
||||
prepareButton.autoSlice = autoSlice
|
||||
prepareButtons.autoSlice = autoSlice
|
||||
}
|
||||
}
|
||||
|
||||
|
|
18
resources/qml/PrimaryButton.qml
Normal file
18
resources/qml/PrimaryButton.qml
Normal file
|
@ -0,0 +1,18 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.4 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
Cura.ActionButton
|
||||
{
|
||||
shadowEnabled: true
|
||||
shadowColor: enabled ? UM.Theme.getColor("primary_button_shadow"): UM.Theme.getColor("action_button_disabled_shadow")
|
||||
color: UM.Theme.getColor("primary_button")
|
||||
textColor: UM.Theme.getColor("primary_button_text")
|
||||
outlineColor: "transparent"
|
||||
disabledColor: UM.Theme.getColor("action_button_disabled")
|
||||
textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
|
||||
hoverColor: UM.Theme.getColor("primary_button_hover")
|
||||
}
|
18
resources/qml/SecondaryButton.qml
Normal file
18
resources/qml/SecondaryButton.qml
Normal file
|
@ -0,0 +1,18 @@
|
|||
import QtQuick 2.2
|
||||
import QtQuick.Controls 1.1
|
||||
|
||||
import UM 1.4 as UM
|
||||
import Cura 1.1 as Cura
|
||||
|
||||
|
||||
Cura.ActionButton
|
||||
{
|
||||
shadowEnabled: true
|
||||
shadowColor: enabled ? UM.Theme.getColor("secondary_button_shadow"): UM.Theme.getColor("action_button_disabled_shadow")
|
||||
color: UM.Theme.getColor("secondary_button")
|
||||
textColor: UM.Theme.getColor("secondary_button_text")
|
||||
outlineColor: "transparent"
|
||||
disabledColor: UM.Theme.getColor("action_button_disabled")
|
||||
textDisabledColor: UM.Theme.getColor("action_button_disabled_text")
|
||||
hoverColor: UM.Theme.getColor("secondary_button_hover")
|
||||
}
|
|
@ -90,6 +90,16 @@
|
|||
"secondary": [245, 245, 245, 255],
|
||||
"secondary_shadow": [228, 228, 228, 255],
|
||||
|
||||
"primary_button": [38,113,231,255],
|
||||
"primary_button_shadow": [27,95,202, 255],
|
||||
"primary_button_hover": [81,145,247, 255],
|
||||
"primary_button_text": [255, 255, 255, 255],
|
||||
|
||||
"secondary_button": [240,240,240, 255],
|
||||
"secondary_button_shadow": [228, 228, 228, 255],
|
||||
"secondary_button_hover": [228,228,228, 255],
|
||||
"secondary_button_text": [30,102,215, 255],
|
||||
|
||||
"main_window_header_background": [10, 8, 80, 255],
|
||||
"main_window_header_button_text_active": [10, 8, 80, 255],
|
||||
"main_window_header_button_text_inactive": [255, 255, 255, 255],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue