mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-09 14:55:03 -06:00
Merge branch 'ui_rework_4_0' into CURA-5942_printer_selector
This commit is contained in:
commit
6a2bbca7ce
7 changed files with 30 additions and 404 deletions
|
@ -298,7 +298,6 @@ UM.Dialog
|
|||
id: machineName
|
||||
text: getMachineName()
|
||||
width: Math.floor(parent.width * 0.75)
|
||||
implicitWidth: UM.Theme.getSize("standard_list_input").width
|
||||
maximumLength: 40
|
||||
//validator: Cura.MachineNameValidator { } //TODO: Gives a segfault in PyQt5.6. For now, we must use a signal on text changed.
|
||||
validator: RegExpValidator
|
||||
|
|
16
resources/qml/ViewOrientationButton.qml
Normal file
16
resources/qml/ViewOrientationButton.qml
Normal file
|
@ -0,0 +1,16 @@
|
|||
// Copyright (c) 2018 Ultimaker B.V.
|
||||
// Cura is released under the terms of the LGPLv3 or higher.
|
||||
|
||||
import QtQuick 2.2
|
||||
|
||||
import UM 1.4 as UM
|
||||
|
||||
UM.SimpleButton
|
||||
{
|
||||
width: UM.Theme.getSize("small_button").width
|
||||
height: UM.Theme.getSize("small_button").height
|
||||
hoverBackgroundColor: UM.Theme.getColor("small_button_hover")
|
||||
hoverColor: UM.Theme.getColor("small_button_text_hover")
|
||||
color: UM.Theme.getColor("small_button_text")
|
||||
iconMargin: 0.5 * UM.Theme.getSize("wide_lining").width
|
||||
}
|
|
@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.1
|
|||
|
||||
import UM 1.4 as UM
|
||||
|
||||
// View orientation Item
|
||||
// A row of buttons that control the view direction
|
||||
Row
|
||||
{
|
||||
id: viewOrientationControl
|
||||
|
@ -16,43 +16,33 @@ Row
|
|||
height: childrenRect.height
|
||||
width: childrenRect.width
|
||||
|
||||
// #1 3d view
|
||||
Button
|
||||
ViewOrientationButton
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_3d")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
onClicked: UM.Controller.rotateView("3d", 0)
|
||||
}
|
||||
|
||||
// #2 Front view
|
||||
Button
|
||||
ViewOrientationButton
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_front")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
onClicked: UM.Controller.rotateView("home", 0)
|
||||
}
|
||||
|
||||
// #3 Top view
|
||||
Button
|
||||
ViewOrientationButton
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_top")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
onClicked: UM.Controller.rotateView("y", 90)
|
||||
}
|
||||
|
||||
// #4 Left view
|
||||
Button
|
||||
ViewOrientationButton
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_left")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
onClicked: UM.Controller.rotateView("x", 90)
|
||||
}
|
||||
|
||||
// #5 Right view
|
||||
Button
|
||||
ViewOrientationButton
|
||||
{
|
||||
iconSource: UM.Theme.getIcon("view_right")
|
||||
style: UM.Theme.styles.small_tool_button
|
||||
onClicked: UM.Controller.rotateView("x", -90)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,7 +133,6 @@
|
|||
"slider_groove_border": [127, 127, 127, 255],
|
||||
"slider_groove_fill": [245, 245, 245, 255],
|
||||
"slider_handle": [255, 255, 255, 255],
|
||||
"slider_handle_hover": [77, 182, 226, 255],
|
||||
"slider_handle_active": [68, 192, 255, 255],
|
||||
"slider_text_background": [255, 255, 255, 255],
|
||||
|
||||
|
@ -209,9 +208,6 @@
|
|||
|
||||
"quality_slider_unavailable": [179, 179, 179, 255],
|
||||
"quality_slider_available": [255, 255, 255, 255],
|
||||
"quality_slider_handle": [255, 255, 255, 255],
|
||||
"quality_slider_handle_hover": [127, 127, 127, 255],
|
||||
"quality_slider_text": [255, 255, 255, 255],
|
||||
|
||||
"toolbox_header_button_text_active": [255, 255, 255, 255],
|
||||
"toolbox_header_button_text_inactive": [128, 128, 128, 255],
|
||||
|
|
|
@ -436,118 +436,6 @@ QtObject
|
|||
}
|
||||
}
|
||||
|
||||
property Component small_tool_button: Component
|
||||
{
|
||||
ButtonStyle
|
||||
{
|
||||
background: Item
|
||||
{
|
||||
implicitWidth: Theme.getSize("small_button").width;
|
||||
implicitHeight: Theme.getSize("small_button").height;
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: smallButtonFace;
|
||||
|
||||
anchors.fill: parent;
|
||||
property bool down: control.pressed || (control.checkable && control.checked);
|
||||
|
||||
color:
|
||||
{
|
||||
if(control.customColor !== undefined && control.customColor !== null)
|
||||
{
|
||||
return control.customColor
|
||||
}
|
||||
else if(control.checkable && control.checked && control.hovered)
|
||||
{
|
||||
return Theme.getColor("small_button_active_hover");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("small_button_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return Theme.getColor("small_button_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("small_button");
|
||||
}
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
|
||||
border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? 2 * screenScaleFactor : 0
|
||||
border.color: Theme.getColor("tool_button_border")
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: smallToolButtonArrow
|
||||
|
||||
width: 5
|
||||
height: 5
|
||||
sourceSize.width: 5
|
||||
sourceSize.height: 5
|
||||
visible: control.menu != null;
|
||||
color:
|
||||
{
|
||||
if(control.checkable && control.checked && control.hovered)
|
||||
{
|
||||
return Theme.getColor("small_button_text_active_hover");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("small_button_text_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return Theme.getColor("small_button_text_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("small_button_text");
|
||||
}
|
||||
}
|
||||
source: Theme.getIcon("arrow_bottom")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label: Item
|
||||
{
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.centerIn: parent
|
||||
opacity: !control.enabled ? 0.2 : 1.0
|
||||
source: control.iconSource;
|
||||
width: Theme.getSize("small_button_icon").width
|
||||
height: Theme.getSize("small_button_icon").height
|
||||
color:
|
||||
{
|
||||
if(control.checkable && control.checked && control.hovered)
|
||||
{
|
||||
return Theme.getColor("small_button_text_active_hover");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("small_button_text_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return Theme.getColor("small_button_text_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("small_button_text");
|
||||
}
|
||||
}
|
||||
|
||||
sourceSize: Theme.getSize("small_button_icon")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Component progressbar: Component
|
||||
{
|
||||
ProgressBarStyle
|
||||
|
@ -599,198 +487,6 @@ QtObject
|
|||
}
|
||||
}
|
||||
|
||||
property Component sidebar_category: Component
|
||||
{
|
||||
ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Theme.getSize("thick_margin").width
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.getSize("thick_margin").width
|
||||
implicitHeight: Theme.getSize("section").height
|
||||
color:
|
||||
{
|
||||
if(control.color)
|
||||
{
|
||||
return control.color;
|
||||
}
|
||||
else if(!control.enabled)
|
||||
{
|
||||
return Theme.getColor("setting_category_disabled");
|
||||
}
|
||||
else if(control.hovered && control.checkable && control.checked)
|
||||
{
|
||||
return Theme.getColor("setting_category_active_hover");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("setting_category_active");
|
||||
}
|
||||
else if(control.hovered)
|
||||
{
|
||||
return Theme.getColor("setting_category_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("setting_category");
|
||||
}
|
||||
}
|
||||
Behavior on color { ColorAnimation { duration: 50; } }
|
||||
Rectangle
|
||||
{
|
||||
height: Theme.getSize("default_lining").height
|
||||
width: parent.width
|
||||
anchors.bottom: parent.bottom
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return Theme.getColor("setting_category_disabled_border");
|
||||
}
|
||||
else if((control.hovered || control.activeFocus) && control.checkable && control.checked)
|
||||
{
|
||||
return Theme.getColor("setting_category_active_hover_border");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("setting_category_active_border");
|
||||
}
|
||||
else if(control.hovered || control.activeFocus)
|
||||
{
|
||||
return Theme.getColor("setting_category_hover_border");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("setting_category_border");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
label: Item
|
||||
{
|
||||
anchors.fill: parent
|
||||
anchors.left: parent.left
|
||||
Item
|
||||
{
|
||||
id: icon
|
||||
anchors.left: parent.left
|
||||
height: parent.height
|
||||
width: Theme.getSize("section_icon_column").width
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: Theme.getSize("thick_margin").width
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return Theme.getColor("setting_category_disabled_text");
|
||||
}
|
||||
else if((control.hovered || control.activeFocus) && control.checkable && control.checked)
|
||||
{
|
||||
return Theme.getColor("setting_category_active_hover_text");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("setting_category_active_text");
|
||||
}
|
||||
else if(control.hovered || control.activeFocus)
|
||||
{
|
||||
return Theme.getColor("setting_category_hover_text");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("setting_category_text");
|
||||
}
|
||||
}
|
||||
source: control.iconSource;
|
||||
width: Theme.getSize("section_icon").width;
|
||||
height: Theme.getSize("section_icon").height;
|
||||
sourceSize.width: width + 15 * screenScaleFactor
|
||||
sourceSize.height: width + 15 * screenScaleFactor
|
||||
}
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
anchors
|
||||
{
|
||||
left: icon.right
|
||||
leftMargin: Theme.getSize("default_margin").width
|
||||
right: parent.right
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
text: control.text
|
||||
font: Theme.getFont("setting_category")
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return Theme.getColor("setting_category_disabled_text");
|
||||
}
|
||||
else if((control.hovered || control.activeFocus) && control.checkable && control.checked)
|
||||
{
|
||||
return Theme.getColor("setting_category_active_hover_text");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("setting_category_active_text");
|
||||
}
|
||||
else if(control.hovered || control.activeFocus)
|
||||
{
|
||||
return Theme.getColor("setting_category_hover_text");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("setting_category_text");
|
||||
}
|
||||
}
|
||||
fontSizeMode: Text.HorizontalFit
|
||||
minimumPointSize: 8
|
||||
}
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: category_arrow
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: Theme.getSize("default_margin").width * 3 - Math.round(width / 2)
|
||||
width: Theme.getSize("standard_arrow").width
|
||||
height: Theme.getSize("standard_arrow").height
|
||||
sourceSize.width: width
|
||||
sourceSize.height: width
|
||||
color:
|
||||
{
|
||||
if(!control.enabled)
|
||||
{
|
||||
return Theme.getColor("setting_category_disabled_text");
|
||||
}
|
||||
else if((control.hovered || control.activeFocus) && control.checkable && control.checked)
|
||||
{
|
||||
return Theme.getColor("setting_category_active_hover_text");
|
||||
}
|
||||
else if(control.pressed || (control.checkable && control.checked))
|
||||
{
|
||||
return Theme.getColor("setting_category_active_text");
|
||||
}
|
||||
else if(control.hovered || control.activeFocus)
|
||||
{
|
||||
return Theme.getColor("setting_category_hover_text");
|
||||
}
|
||||
else
|
||||
{
|
||||
return Theme.getColor("setting_category_text");
|
||||
}
|
||||
}
|
||||
source: control.checked ? Theme.getIcon("arrow_bottom") : Theme.getIcon("arrow_left")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
property Component scrollview: Component
|
||||
{
|
||||
ScrollViewStyle
|
||||
|
@ -1144,60 +840,4 @@ QtObject
|
|||
label: Item { }
|
||||
}
|
||||
}
|
||||
|
||||
property Component toolbox_action_button: Component
|
||||
{
|
||||
ButtonStyle
|
||||
{
|
||||
background: Rectangle
|
||||
{
|
||||
implicitWidth: UM.Theme.getSize("toolbox_action_button").width
|
||||
implicitHeight: UM.Theme.getSize("toolbox_action_button").height
|
||||
color:
|
||||
{
|
||||
if (control.installed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("primary_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("primary");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
label: Label
|
||||
{
|
||||
text: control.text
|
||||
color:
|
||||
{
|
||||
if (control.installed)
|
||||
{
|
||||
return UM.Theme.getColor("action_button_disabled_text");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (control.hovered)
|
||||
{
|
||||
return UM.Theme.getColor("button_text_hover");
|
||||
}
|
||||
else
|
||||
{
|
||||
return UM.Theme.getColor("button_text");
|
||||
}
|
||||
}
|
||||
}
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font: UM.Theme.getFont("default_bold")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -124,7 +124,6 @@
|
|||
"text_detail": [174, 174, 174, 128],
|
||||
"text_link": [50, 130, 255, 255],
|
||||
"text_inactive": [174, 174, 174, 255],
|
||||
"text_hover": [70, 84, 113, 255],
|
||||
"text_pressed": [50, 130, 255, 255],
|
||||
"text_subtext": [0, 0, 0, 255],
|
||||
"text_medium": [128, 128, 128, 255],
|
||||
|
@ -230,15 +229,11 @@
|
|||
"slider_groove": [223, 223, 223, 255],
|
||||
"slider_groove_fill": [10, 8, 80, 255],
|
||||
"slider_handle": [10, 8, 80, 255],
|
||||
"slider_handle_hover": [77, 182, 226, 255],
|
||||
"slider_handle_active": [50, 130, 255, 255],
|
||||
"slider_text_background": [255, 255, 255, 255],
|
||||
|
||||
"quality_slider_unavailable": [179, 179, 179, 255],
|
||||
"quality_slider_available": [0, 0, 0, 255],
|
||||
"quality_slider_handle": [0, 0, 0, 255],
|
||||
"quality_slider_handle_hover": [127, 127, 127, 255],
|
||||
"quality_slider_text": [0, 0, 0, 255],
|
||||
|
||||
"checkbox": [255, 255, 255, 255],
|
||||
"checkbox_hover": [255, 255, 255, 255],
|
||||
|
@ -247,15 +242,6 @@
|
|||
"checkbox_mark": [119, 122, 124, 255],
|
||||
"checkbox_text": [27, 27, 27, 255],
|
||||
|
||||
"mode_switch": [255, 255, 255, 255],
|
||||
"mode_switch_hover": [255, 255, 255, 255],
|
||||
"mode_switch_border": [127, 127, 127, 255],
|
||||
"mode_switch_border_hover": [50, 130, 255, 255],
|
||||
"mode_switch_handle": [31, 36, 39, 255],
|
||||
"mode_switch_text": [31, 36, 39, 255],
|
||||
"mode_switch_text_hover": [31, 36, 39, 255],
|
||||
"mode_switch_text_checked": [50, 130, 255, 255],
|
||||
|
||||
"tooltip": [68, 192, 255, 255],
|
||||
"tooltip_text": [255, 255, 255, 255],
|
||||
|
||||
|
@ -386,7 +372,6 @@
|
|||
"print_setup_item": [0.0, 2.0],
|
||||
"print_setup_extruder_box": [0.0, 6.0],
|
||||
|
||||
"configuration_selector_widget": [35.0, 4.0],
|
||||
"configuration_selector_mode_tabs": [0.0, 3.0],
|
||||
|
||||
"action_panel_widget": [25.0, 0.0],
|
||||
|
@ -418,9 +403,6 @@
|
|||
|
||||
"extruder_icon": [1.8, 1.8],
|
||||
|
||||
"simple_mode_infill_caption": [0.0, 5.0],
|
||||
"simple_mode_infill_height": [0.0, 8.0],
|
||||
|
||||
"section": [0.0, 2.2],
|
||||
"section_icon": [1.6, 1.6],
|
||||
"section_icon_column": [2.8, 0.0],
|
||||
|
@ -434,7 +416,6 @@
|
|||
"setting_text_maxwidth": [40.0, 0.0],
|
||||
|
||||
"standard_list_lineheight": [1.5, 1.5],
|
||||
"standard_list_input": [20.0, 25.0],
|
||||
"standard_arrow": [0.8, 0.8],
|
||||
|
||||
"button": [4, 4],
|
||||
|
@ -488,7 +469,6 @@
|
|||
|
||||
"modal_window_minimum": [60.0, 45],
|
||||
"license_window_minimum": [45, 45],
|
||||
"wizard_progress": [10.0, 0.0],
|
||||
|
||||
"message": [30.0, 5.0],
|
||||
"message_close": [1, 1],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue