Merge branch 'CURA-8421_Introduce_app_switcher' into CURA-8422_add_platform_links

This commit is contained in:
Konstantinos Karmas 2021-09-21 11:35:02 +02:00
commit cd505d575d
7 changed files with 33 additions and 33 deletions

View File

@ -12,8 +12,8 @@ Item
property var profile: Cura.API.account.userProfile property var profile: Cura.API.account.userProfile
property var loggedIn: Cura.API.account.isLoggedIn property var loggedIn: Cura.API.account.isLoggedIn
height: signInButton.height > accountWidget.height ? signInButton.height : accountWidget.height height: signInButton.visible ? signInButton.height : accountWidget.height
width: signInButton.width > accountWidget.width ? signInButton.width : accountWidget.width width: signInButton.visible ? signInButton.width : accountWidget.width
Button Button
{ {
@ -54,7 +54,6 @@ Item
id: accountWidget id: accountWidget
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: signInButton.horizontalCenter
implicitHeight: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) implicitHeight: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
implicitWidth: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) implicitWidth: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
@ -142,7 +141,7 @@ Item
borderColor: UM.Theme.getColor("lining") borderColor: UM.Theme.getColor("lining")
borderWidth: UM.Theme.getSize("default_lining").width borderWidth: UM.Theme.getSize("default_lining").width
target: Qt.point(width - (signInButton.width / 2), -10) target: Qt.point(width - ((signInButton.visible ? signInButton.width : accountWidget.width) / 2), -10)
arrowSize: UM.Theme.getSize("default_arrow").width arrowSize: UM.Theme.getSize("default_arrow").width
} }

View File

@ -36,14 +36,13 @@ Button
{ {
id: applicationButtonContent id: applicationButtonContent
anchors.centerIn: parent anchors.centerIn: parent
spacing: UM.Theme.getSize("default_margin").width
UM.RecolorImage UM.RecolorImage
{ {
id: applicationIcon id: applicationIcon
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
color: UM.Theme.getColor("monitor_icon_primary") color: UM.Theme.getColor("icon")
width: UM.Theme.getSize("application_switcher_icon").width width: UM.Theme.getSize("application_switcher_icon").width
height: width height: width
@ -65,7 +64,7 @@ Button
{ {
id: externalLinkIndicatorBackground id: externalLinkIndicatorBackground
anchors.centerIn: parent anchors.centerIn: parent
width: UM.Theme.getSize("small_button_icon").width width: UM.Theme.getSize("icon_indicator_background").width
height: width height: width
color: base.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button") color: base.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
radius: 0.5 * width radius: 0.5 * width
@ -76,9 +75,9 @@ Button
id: externalLinkIndicatorIcon id: externalLinkIndicatorIcon
anchors.centerIn: parent anchors.centerIn: parent
width: UM.Theme.getSize("printer_status_icon").width width: UM.Theme.getSize("icon_indicator").width
height: width height: width
color: UM.Theme.getColor("monitor_icon_primary") color: UM.Theme.getColor("icon")
source: UM.Theme.getIcon("LinkExternal") source: UM.Theme.getIcon("LinkExternal")
} }
} }
@ -91,10 +90,11 @@ Button
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
width: base.width - UM.Theme.getSize("default_margin").width width: base.width - UM.Theme.getSize("default_margin").width
height: base.height - applicationIcon.height - 2 * UM.Theme.getSize("default_margin").width // Account for the top and bottom margins
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
maximumLineCount: 2 verticalAlignment: Text.AlignVCenter
wrapMode: Text.Wrap wrapMode: Text.Wrap
elide: Text.ElideRight elide: Text.ElideRight
} }
} }
} }

View File

@ -11,13 +11,12 @@ import Cura 1.1 as Cura
Item Item
{ {
id: applicationSwitcherWidget id: applicationSwitcherWidget
width: appSwitcherButton.width width: applicationSwitcherButton.width
height: width height: width
Button Button
{ {
id: appSwitcherButton id: applicationSwitcherButton
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
@ -26,29 +25,29 @@ Item
background: UM.RecolorImage background: UM.RecolorImage
{ {
width: UM.Theme.getSize("small_button_icon").width width: parent.width
height: width height: width
anchors.verticalCenter: appSwitcherButton.verticalCenter anchors.verticalCenter: applicationSwitcherButton.verticalCenter
anchors.horizontalCenter: appSwitcherButton.horizontalCenter anchors.horizontalCenter: applicationSwitcherButton.horizontalCenter
color: UM.Theme.getColor("main_background") color: UM.Theme.getColor("main_background")
source: UM.Theme.getIcon("ApplicationSwitcher") source: UM.Theme.getIcon("BlockGrid")
} }
onClicked: onClicked:
{ {
if (popup.opened) if (applicationSwitcherPopup.opened)
{ {
popup.close() applicationSwitcherPopup.close()
} else { } else {
popup.open() applicationSwitcherPopup.open()
} }
} }
} }
Popup Popup
{ {
id: popup id: applicationSwitcherPopup
y: parent.height + UM.Theme.getSize("default_arrow").height y: parent.height + UM.Theme.getSize("default_arrow").height
x: parent.width - width x: parent.width - width
@ -63,7 +62,7 @@ Item
contentItem: Item contentItem: Item
{ {
id: projectListContainer id: applicationsContainer
anchors.fill: parent anchors.fill: parent
anchors.margins: UM.Theme.getSize("wide_margin").width anchors.margins: UM.Theme.getSize("wide_margin").width
@ -73,17 +72,16 @@ Item
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
width: gridLayout.width width: ultimakerPlatformLinksGrid.width
Grid Grid
{ {
id: gridLayout id: ultimakerPlatformLinksGrid
columns: 3 columns: 3
spacing: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").width
Repeater Repeater
{ {
id:gridgenerate
model: model:
[ [
{ {
@ -147,7 +145,7 @@ Item
displayName: modelData.displayName displayName: modelData.displayName
iconSource: modelData.thumbnail iconSource: modelData.thumbnail
tooltipText: modelData.description tooltipText: modelData.description
isExternalLink: (index % 2 == 0) isExternalLink: true
onClicked: Qt.openUrlExternally(modelData.link) onClicked: Qt.openUrlExternally(modelData.link)
} }
@ -163,7 +161,7 @@ Item
borderColor: UM.Theme.getColor("lining") borderColor: UM.Theme.getColor("lining")
borderWidth: UM.Theme.getSize("default_lining").width borderWidth: UM.Theme.getSize("default_lining").width
target: Qt.point(width - (appSwitcherButton.width / 2), -10) target: Qt.point(width - (applicationSwitcherButton.width / 2), -10)
arrowSize: UM.Theme.getSize("default_arrow").width arrowSize: UM.Theme.getSize("default_arrow").width
} }

View File

@ -146,7 +146,7 @@ Item
{ {
verticalCenter: parent.verticalCenter verticalCenter: parent.verticalCenter
right: accountWidget.left right: accountWidget.left
// rightMargin: UM.Theme.getSize("default_margin").width rightMargin: UM.Theme.getSize("default_margin").width
} }
} }

View File

@ -1,3 +0,0 @@
<svg viewBox="0 0 18 18" xmlns="http://www.w3.org/2000/svg">
<path d="M4 4H0V3C0 2.20435 0.316071 1.44129 0.87868 0.87868C1.44129 0.316071 2.20435 0 3 0H4V4ZM11 0H7V4H11V0ZM18 3C18 2.20435 17.6839 1.44129 17.1213 0.87868C16.5587 0.316071 15.7956 0 15 0H14V4H18V3ZM4 7H0V11H4V7ZM11 7H7V11H11V7ZM18 7H14V11H18V7ZM4 14H0V15C0 15.7956 0.316071 16.5587 0.87868 17.1213C1.44129 17.6839 2.20435 18 3 18H4V14ZM11 14H7V18H11V14ZM18 15V14H14V18H15C15.7956 18 16.5587 17.6839 17.1213 17.1213C17.6839 16.5587 18 15.7956 18 15Z" fill="#000E1A"/>
</svg>

Before

Width:  |  Height:  |  Size: 540 B

View File

@ -0,0 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M7 7H3V6C3 5.20435 3.31607 4.44129 3.87868 3.87868C4.44129 3.31607 5.20435 3 6 3H7V7ZM14 3H10V7H14V3ZM21 6C21 5.20435 20.6839 4.44129 20.1213 3.87868C19.5587 3.31607 18.7956 3 18 3H17V7H21V6ZM7 10H3V14H7V10ZM14 10H10V14H14V10ZM21 10H17V14H21V10ZM7 17H3V18C3 18.7956 3.31607 19.5587 3.87868 20.1213C4.44129 20.6839 5.20435 21 6 21H7V17ZM14 17H10V21H14V17ZM21 18V17H17V21H18C18.7956 21 19.5587 20.6839 20.1213 20.1213C20.6839 19.5587 21 18.7956 21 18Z" fill="#000E1A"/>
</svg>

After

Width:  |  Height:  |  Size: 580 B

View File

@ -574,6 +574,9 @@
"favorites_button": [2, 2], "favorites_button": [2, 2],
"favorites_button_icon": [1.2, 1.2], "favorites_button_icon": [1.2, 1.2],
"icon_indicator_background": [1.5, 1.5],
"icon_indicator": [1, 1],
"printer_status_icon": [1.0, 1.0], "printer_status_icon": [1.0, 1.0],
"printer_sync_icon": [1.2, 1.2], "printer_sync_icon": [1.2, 1.2],