mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 13:03:59 -06:00
commit
e29baf0cec
12 changed files with 2178 additions and 105 deletions
|
@ -7,6 +7,7 @@ import QtQuick.Controls 2.1
|
|||
import QtGraphicalEffects 1.0 // For the dropshadow
|
||||
|
||||
import UM 1.1 as UM
|
||||
import Cura 1.0 as Cura
|
||||
|
||||
Button
|
||||
{
|
||||
|
@ -16,6 +17,7 @@ Button
|
|||
property alias textFont: buttonText.font
|
||||
property alias cornerRadius: backgroundRect.radius
|
||||
property alias tooltip: tooltip.text
|
||||
property alias cornerSide: backgroundRect.cornerSide
|
||||
|
||||
property color color: UM.Theme.getColor("primary")
|
||||
property color hoverColor: UM.Theme.getColor("primary_hover")
|
||||
|
@ -82,9 +84,10 @@ Button
|
|||
}
|
||||
}
|
||||
|
||||
background: Rectangle
|
||||
background: Cura.RoundedRectangle
|
||||
{
|
||||
id: backgroundRect
|
||||
cornerSide: Cura.RoundedRectangle.Direction.All
|
||||
color: button.enabled ? (button.hovered ? button.hoverColor : button.color) : button.disabledColor
|
||||
radius: UM.Theme.getSize("action_button_radius").width
|
||||
border.width: UM.Theme.getSize("default_lining").width
|
||||
|
|
|
@ -17,6 +17,7 @@ Item
|
|||
id: saveToButton
|
||||
height: parent.height
|
||||
fixedWidthMode: true
|
||||
cornerSide: deviceSelectionMenu.visible ? Cura.RoundedRectangle.Direction.Left : Cura.RoundedRectangle.Direction.All
|
||||
|
||||
anchors
|
||||
{
|
||||
|
@ -44,6 +45,7 @@ Item
|
|||
|
||||
shadowEnabled: true
|
||||
shadowColor: UM.Theme.getColor("primary_shadow")
|
||||
cornerSide: Cura.RoundedRectangle.Direction.Right
|
||||
|
||||
anchors
|
||||
{
|
||||
|
|
|
@ -101,16 +101,24 @@ Column
|
|||
}
|
||||
}
|
||||
|
||||
Row
|
||||
Item
|
||||
{
|
||||
id: buttonRow
|
||||
spacing: UM.Theme.getSize("default_margin").width
|
||||
width: parent.width
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
|
||||
Cura.SecondaryButton
|
||||
{
|
||||
id: previewStageShortcut
|
||||
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: outputDevicesButton.left
|
||||
rightMargin: UM.Theme.getSize("default_margin").width
|
||||
}
|
||||
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
leftPadding: UM.Theme.getSize("default_margin").width
|
||||
rightPadding: UM.Theme.getSize("default_margin").width
|
||||
|
@ -125,6 +133,9 @@ Column
|
|||
|
||||
Cura.OutputDevicesActionButton
|
||||
{
|
||||
id: outputDevicesButton
|
||||
|
||||
anchors.right: parent.right
|
||||
width: previewStageShortcut.visible ? UM.Theme.getSize("action_button").width : parent.width
|
||||
height: UM.Theme.getSize("action_button").height
|
||||
}
|
||||
|
|
|
@ -88,6 +88,30 @@ UM.MainWindow
|
|||
window: base
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: headerBackground
|
||||
anchors
|
||||
{
|
||||
top: applicationMenu.bottom
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
}
|
||||
height: stageMenu.source != "" ? Math.round(mainWindowHeader.height + stageMenu.height / 2) : mainWindowHeader.height
|
||||
color: UM.Theme.getColor("main_window_header_background")
|
||||
|
||||
// This is the new fancy pattern
|
||||
Image
|
||||
{
|
||||
id: backgourndPattern
|
||||
anchors.fill: parent
|
||||
fillMode: Image.Tile
|
||||
source: UM.Theme.getImage("header_pattern")
|
||||
horizontalAlignment: Image.AlignLeft
|
||||
verticalAlignment: Image.AlignTop
|
||||
}
|
||||
}
|
||||
|
||||
MainWindowHeader
|
||||
{
|
||||
id: mainWindowHeader
|
||||
|
@ -144,44 +168,6 @@ UM.MainWindow
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle
|
||||
{
|
||||
id: stageMenuBackground
|
||||
anchors
|
||||
{
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
top: parent.top
|
||||
}
|
||||
visible: stageMenu.source != ""
|
||||
height: visible ? Math.round(UM.Theme.getSize("stage_menu").height / 2) : 0
|
||||
|
||||
LinearGradient
|
||||
{
|
||||
anchors.fill: parent
|
||||
start: Qt.point(0, 0)
|
||||
end: Qt.point(parent.width, 0)
|
||||
gradient: Gradient
|
||||
{
|
||||
GradientStop
|
||||
{
|
||||
position: 0.0
|
||||
color: UM.Theme.getColor("main_window_header_background")
|
||||
}
|
||||
GradientStop
|
||||
{
|
||||
position: 0.5
|
||||
color: UM.Theme.getColor("main_window_header_background_gradient")
|
||||
}
|
||||
GradientStop
|
||||
{
|
||||
position: 1.0
|
||||
color: UM.Theme.getColor("main_window_header_background")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections
|
||||
{
|
||||
target: stageMenu.item
|
||||
|
@ -257,7 +243,8 @@ UM.MainWindow
|
|||
|
||||
anchors
|
||||
{
|
||||
top: stageMenuBackground.bottom
|
||||
// Align to the top of the stageMenu since the stageMenu may not exist
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: parent.bottom
|
||||
|
|
|
@ -35,9 +35,9 @@ UM.Dialog
|
|||
{
|
||||
id: logo
|
||||
width: (base.minimumWidth * 0.85) | 0
|
||||
height: (width * (1/4.25)) | 0
|
||||
height: (width * (UM.Theme.getSize("logo").height / UM.Theme.getSize("logo").width)) | 0
|
||||
|
||||
source: UM.Theme.getImage("logo")
|
||||
source: UM.Theme.getImage("logo_about")
|
||||
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: ((base.minimumWidth - width) / 2) | 0
|
||||
|
|
|
@ -12,38 +12,13 @@ import QtGraphicalEffects 1.0
|
|||
|
||||
import "../Account"
|
||||
|
||||
Rectangle
|
||||
Item
|
||||
{
|
||||
id: base
|
||||
|
||||
implicitHeight: UM.Theme.getSize("main_window_header").height
|
||||
implicitWidth: UM.Theme.getSize("main_window_header").width
|
||||
|
||||
LinearGradient
|
||||
{
|
||||
anchors.fill: parent
|
||||
start: Qt.point(0, 0)
|
||||
end: Qt.point(parent.width, 0)
|
||||
gradient: Gradient
|
||||
{
|
||||
GradientStop
|
||||
{
|
||||
position: 0.0
|
||||
color: UM.Theme.getColor("main_window_header_background")
|
||||
}
|
||||
GradientStop
|
||||
{
|
||||
position: 0.5
|
||||
color: UM.Theme.getColor("main_window_header_background_gradient")
|
||||
}
|
||||
GradientStop
|
||||
{
|
||||
position: 1.0
|
||||
color: UM.Theme.getColor("main_window_header_background")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Image
|
||||
{
|
||||
id: logo
|
||||
|
|
|
@ -25,29 +25,52 @@ Cura.ExpandableComponent
|
|||
name: "cura"
|
||||
}
|
||||
|
||||
headerItem: Cura.IconLabel
|
||||
headerItem: Item
|
||||
{
|
||||
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||
source:
|
||||
{
|
||||
if (isNetworkPrinter)
|
||||
{
|
||||
if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1)
|
||||
{
|
||||
return UM.Theme.getIcon("printer_group")
|
||||
}
|
||||
return UM.Theme.getIcon("printer_single")
|
||||
}
|
||||
return ""
|
||||
}
|
||||
font: UM.Theme.getFont("medium")
|
||||
color: UM.Theme.getColor("text")
|
||||
iconSize: UM.Theme.getSize("machine_selector_icon").width
|
||||
implicitHeight: icon.height
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
id: icon
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
source:
|
||||
{
|
||||
if (isNetworkPrinter)
|
||||
{
|
||||
if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1)
|
||||
{
|
||||
return UM.Theme.getIcon("printer_group")
|
||||
}
|
||||
return UM.Theme.getIcon("printer_single")
|
||||
}
|
||||
return ""
|
||||
}
|
||||
width: UM.Theme.getSize("machine_selector_icon").width
|
||||
height: width
|
||||
|
||||
color: UM.Theme.getColor("machine_selector_printer_icon")
|
||||
visible: source != ""
|
||||
}
|
||||
|
||||
Label
|
||||
{
|
||||
id: label
|
||||
anchors.left: icon.visible ? icon.right : parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.leftMargin: UM.Theme.getSize("thin_margin").width
|
||||
anchors.verticalCenter: icon.verticalCenter
|
||||
text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName
|
||||
elide: Text.ElideRight
|
||||
color: UM.Theme.getColor("text")
|
||||
font: UM.Theme.getFont("medium")
|
||||
renderType: Text.NativeRendering
|
||||
}
|
||||
|
||||
UM.RecolorImage
|
||||
{
|
||||
anchors
|
||||
{
|
||||
bottom: parent.bottom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue