mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 06:15:10 +08:00
moved manage packages button inside the tabBar and adjusted styling
This commit is contained in:
parent
0e646a97f2
commit
4c6441f65e
@ -7,18 +7,21 @@ import Cura 1.6 as Cura
|
|||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
import QtQuick.Controls 2.15
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
Button
|
TabButton
|
||||||
{
|
{
|
||||||
id: root
|
id: root
|
||||||
width: UM.Theme.getSize("button_icon").width
|
width: UM.Theme.getSize("button_icon").width+UM.Theme.getSize("narrow_margin").width
|
||||||
height: UM.Theme.getSize("button_icon").height
|
height: UM.Theme.getSize("button_icon").height
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
property color backgroundColor: hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
property color inactiveBackgroundColor : hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("detail_background")
|
||||||
|
property color activeBackgroundColor : UM.Theme.getColor("main_background")
|
||||||
|
leftInset: UM.Theme.getSize("narrow_margin").width
|
||||||
|
|
||||||
background: Rectangle
|
background: Rectangle
|
||||||
{
|
{
|
||||||
color: backgroundColor
|
color: parent.checked ? activeBackgroundColor : inactiveBackgroundColor
|
||||||
border.color: transparent
|
border.color: parent.checked ? UM.Theme.getColor("detail_background") : "transparent"
|
||||||
|
border.width: UM.Theme.getSize("thick_lining").width
|
||||||
radius: Math.round(width * 0.5)
|
radius: Math.round(width * 0.5)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +42,8 @@ Button
|
|||||||
|
|
||||||
color: UM.Theme.getColor("icon")
|
color: UM.Theme.getColor("icon")
|
||||||
source: UM.Theme.getIcon("Settings")
|
source: UM.Theme.getIcon("Settings")
|
||||||
anchors.centerIn: parent
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.horizontalCenterOffset: Math.round(UM.Theme.getSize("narrow_margin").width /2)
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -75,24 +75,11 @@ Window
|
|||||||
Layout.preferredWidth: parent.width
|
Layout.preferredWidth: parent.width
|
||||||
Layout.preferredHeight: childrenRect.height
|
Layout.preferredHeight: childrenRect.height
|
||||||
|
|
||||||
ManagePackagesButton
|
|
||||||
{
|
|
||||||
id: managePackagesButton
|
|
||||||
|
|
||||||
anchors.right: parent.right
|
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
|
||||||
|
|
||||||
onClicked:
|
|
||||||
{
|
|
||||||
content.source = "ManagedPackages.qml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Page selection.
|
// Page selection.
|
||||||
TabBar
|
TabBar
|
||||||
{
|
{
|
||||||
id: pageSelectionTabBar
|
id: pageSelectionTabBar
|
||||||
anchors.right: managePackagesButton.left
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
anchors.rightMargin: UM.Theme.getSize("default_margin").width
|
||||||
height: UM.Theme.getSize("button_icon").height
|
height: UM.Theme.getSize("button_icon").height
|
||||||
spacing: 0
|
spacing: 0
|
||||||
@ -109,6 +96,10 @@ Window
|
|||||||
text: catalog.i18nc("@button", "Materials")
|
text: catalog.i18nc("@button", "Materials")
|
||||||
onClicked: content.source = "Materials.qml"
|
onClicked: content.source = "Materials.qml"
|
||||||
}
|
}
|
||||||
|
ManagePackagesButton
|
||||||
|
{
|
||||||
|
onClicked: content.source = "ManagedPackages.qml"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ TabButton
|
|||||||
{
|
{
|
||||||
property string pageTitle
|
property string pageTitle
|
||||||
padding: UM.Theme.getSize("narrow_margin").width
|
padding: UM.Theme.getSize("narrow_margin").width
|
||||||
|
horizontalPadding: UM.Theme.getSize("default_margin").width
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
property color inactiveBackgroundColor : hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("detail_background")
|
property color inactiveBackgroundColor : hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("detail_background")
|
||||||
property color activeBackgroundColor : UM.Theme.getColor("main_background")
|
property color activeBackgroundColor : UM.Theme.getColor("main_background")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user