mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-23 14:06:28 +02:00
[ui] Update MaterialToolButton style
* flatten the button * color its icon when checked
This commit is contained in:
parent
1c873508ef
commit
b9999c01eb
3 changed files with 27 additions and 17 deletions
|
@ -37,35 +37,28 @@ Item {
|
|||
background: Rectangle { color: Qt.darker(Colors.sysPalette.window, 1.2) }
|
||||
Column {
|
||||
height: parent.height
|
||||
ToolButton {
|
||||
spacing: 1
|
||||
MaterialToolButton {
|
||||
text: MaterialIcons.refresh
|
||||
ToolTip.text: "Reload"
|
||||
ToolTip.visible: hovered
|
||||
font.family: MaterialIcons.fontFamily
|
||||
onClicked: loadSource()
|
||||
}
|
||||
ToolButton {
|
||||
MaterialToolButton {
|
||||
text: MaterialIcons.vertical_align_top
|
||||
ToolTip.text: "Scroll to Top"
|
||||
ToolTip.visible: hovered
|
||||
font.family: MaterialIcons.fontFamily
|
||||
onClicked: textView.positionViewAtBeginning()
|
||||
}
|
||||
ToolButton {
|
||||
MaterialToolButton {
|
||||
id: autoscroll
|
||||
text: MaterialIcons.vertical_align_bottom
|
||||
ToolTip.text: "Scroll to Bottom"
|
||||
ToolTip.visible: hovered
|
||||
font.family: MaterialIcons.fontFamily
|
||||
onClicked: textView.positionViewAtEnd()
|
||||
checkable: false
|
||||
checked: textView.atYEnd
|
||||
}
|
||||
ToolButton {
|
||||
MaterialToolButton {
|
||||
text: MaterialIcons.assignment
|
||||
ToolTip.text: "Copy"
|
||||
ToolTip.visible: hovered
|
||||
font.family: MaterialIcons.fontFamily
|
||||
onClicked: copySubMenu.open()
|
||||
Menu {
|
||||
id: copySubMenu
|
||||
|
@ -88,11 +81,9 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
ToolButton {
|
||||
MaterialToolButton {
|
||||
text: MaterialIcons.open_in_new
|
||||
ToolTip.text: "Open Externally"
|
||||
ToolTip.visible: hovered
|
||||
font.family: MaterialIcons.fontFamily
|
||||
enabled: root.source !== ""
|
||||
onClicked: Qt.openUrlExternally(root.source)
|
||||
}
|
||||
|
|
|
@ -35,9 +35,11 @@ Panel {
|
|||
text: MaterialIcons.more_vert
|
||||
font.pointSize: 11
|
||||
padding: 2
|
||||
onClicked: graphEditorMenu.open()
|
||||
checkable: true
|
||||
checked: galleryMenu.visible
|
||||
onClicked: galleryMenu.open()
|
||||
Menu {
|
||||
id: graphEditorMenu
|
||||
id: galleryMenu
|
||||
y: parent.height
|
||||
x: -width + parent.width
|
||||
MenuItem {
|
||||
|
|
|
@ -12,4 +12,21 @@ ToolButton {
|
|||
font.pointSize: 13
|
||||
ToolTip.visible: ToolTip.text && hovered
|
||||
ToolTip.delay: 100
|
||||
Component.onCompleted: {
|
||||
contentItem.color = Qt.binding(function() { return checked ? palette.highlight : palette.text })
|
||||
}
|
||||
background: Rectangle {
|
||||
color: {
|
||||
if(pressed || checked || hovered)
|
||||
{
|
||||
if(pressed || checked)
|
||||
return Qt.darker(parent.palette.base, 1.3)
|
||||
if(hovered)
|
||||
return Qt.darker(parent.palette.base, 0.6)
|
||||
}
|
||||
return "transparent";
|
||||
}
|
||||
|
||||
border.color: checked ? Qt.darker(parent.palette.base, 1.4) : "transparent"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue