forked from qt-creator/qt-creator
QmlDesigner: Add tooltips in StateEditor
Task-number: QDS-7736 Change-Id: I6732043da895e04e6ed70f74d8342ba7ff7354fe Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
66ec244cf9
commit
a7c15838e2
@@ -26,6 +26,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import StatesEditor
|
||||
import HelperWidgets 2.0 as HelperWidgets
|
||||
import StudioControls 1.0 as StudioControls
|
||||
import StudioTheme as StudioTheme
|
||||
|
||||
@@ -369,6 +370,23 @@ Rectangle {
|
||||
width: stateGroupLabel.visible ? StudioTheme.Values.defaultControlWidth
|
||||
: root.width - 2 * root.padding
|
||||
|
||||
HelperWidgets.Tooltip { id: comboBoxTooltip }
|
||||
|
||||
Timer {
|
||||
interval: 1000
|
||||
running: stateGroupComboBox.hovered
|
||||
onTriggered: comboBoxTooltip.showText(stateGroupComboBox,
|
||||
hoverHandler.point.position,
|
||||
qsTr("Switch State Group"))
|
||||
}
|
||||
|
||||
onHoverChanged: {
|
||||
if (!stateGroupComboBox.hovered)
|
||||
comboBoxTooltip.hideText()
|
||||
}
|
||||
|
||||
HoverHandler { id: hoverHandler }
|
||||
|
||||
popup.onOpened: editDialog.close()
|
||||
|
||||
// currentIndex needs special treatment, because if model is changed, it will be
|
||||
@@ -398,25 +416,28 @@ Rectangle {
|
||||
spacing: StudioTheme.Values.toolbarSpacing
|
||||
leftPadding: toolBar.doubleRow ? root.padding : 0
|
||||
|
||||
StudioControls.AbstractButton {
|
||||
HelperWidgets.AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.plus
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
tooltip: qsTr("Create State Group")
|
||||
onClicked: statesEditorModel.addStateGroup("stateGroup")
|
||||
}
|
||||
|
||||
StudioControls.AbstractButton {
|
||||
HelperWidgets.AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.minus
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
enabled: statesEditorModel.activeStateGroupIndex !== 0
|
||||
tooltip: qsTr("Remove State Group")
|
||||
onClicked: statesEditorModel.removeStateGroup()
|
||||
}
|
||||
|
||||
StudioControls.AbstractButton {
|
||||
HelperWidgets.AbstractButton {
|
||||
id: editButton
|
||||
buttonIcon: StudioTheme.Constants.edit
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
enabled: statesEditorModel.activeStateGroupIndex !== 0
|
||||
checked: editDialog.visible
|
||||
tooltip: qsTr("Rename State Group")
|
||||
onClicked: {
|
||||
if (editDialog.opened)
|
||||
editDialog.close()
|
||||
@@ -439,20 +460,22 @@ Rectangle {
|
||||
spacing: StudioTheme.Values.toolbarSpacing
|
||||
rightPadding: root.padding
|
||||
|
||||
StudioControls.AbstractButton {
|
||||
HelperWidgets.AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.gridView
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
enabled: !root.tinyMode
|
||||
tooltip: qsTr("Show thumbnails")
|
||||
onClicked: {
|
||||
for (var i = 0; i < statesRepeater.count; ++i)
|
||||
statesRepeater.itemAt(i).setPropertyChangesVisible(false)
|
||||
}
|
||||
}
|
||||
|
||||
StudioControls.AbstractButton {
|
||||
HelperWidgets.AbstractButton {
|
||||
buttonIcon: StudioTheme.Constants.textFullJustification
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
enabled: !root.tinyMode
|
||||
tooltip: qsTr("Show property changes")
|
||||
onClicked: {
|
||||
for (var i = 0; i < statesRepeater.count; ++i)
|
||||
statesRepeater.itemAt(i).setPropertyChangesVisible(true)
|
||||
|
@@ -25,9 +25,9 @@
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
import HelperWidgets 2.0 as HelperWidgets
|
||||
import StudioControls 1.0 as StudioControls
|
||||
import QtQuick.Layouts 6.0
|
||||
import StudioTheme 1.0 as StudioTheme
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -148,13 +148,14 @@ Item {
|
||||
rows: 1
|
||||
spacing: stateBackground.thumbSpacing
|
||||
|
||||
StudioControls.AbstractButton {
|
||||
HelperWidgets.AbstractButton {
|
||||
id: defaultButton
|
||||
width: 50
|
||||
height: stateBackground.controlHeight
|
||||
checkedInverted: true
|
||||
buttonIcon: qsTr("Default")
|
||||
iconFont: StudioTheme.Constants.font
|
||||
tooltip: qsTr("Set State as default")
|
||||
onClicked: {
|
||||
root.defaultClicked()
|
||||
root.focusSignal()
|
||||
|
Reference in New Issue
Block a user