EffectComposer: Fix infoText timer

InfoText timer is now properly stopped and started as required.

Fixes: QDS-15052
Change-Id: I1ca9db9f11698c5e6e459e3569c75c3f66ca2797
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2025-04-10 13:24:56 +03:00
parent ed1bece5ec
commit e205ddac12

View File

@@ -80,9 +80,10 @@ HelperWidgets.Section {
function showNodeExistsWarning(enable) function showNodeExistsWarning(enable)
{ {
infoText.text = qsTr("An effect with this name already exists.\nSuffix was added to make the name unique.") infoText.text = qsTr("An effect with this name already exists.\nSuffix was added to make the name unique.")
infoTimer.restart()
infoText.visible = enable
infoText.color = StudioTheme.Values.themeWarning infoText.color = StudioTheme.Values.themeWarning
infoText.visible = enable
if (infoText.visible)
infoTimer.restart()
} }
function showNodeAddedToLibraryInfo(message) function showNodeAddedToLibraryInfo(message)
@@ -95,15 +96,17 @@ HelperWidgets.Section {
infoText.text = message infoText.text = message
infoText.color = StudioTheme.Values.themeInteraction infoText.color = StudioTheme.Values.themeInteraction
} }
infoTimer.restart()
infoText.visible = message !== "" infoText.visible = message !== ""
if (infoText.visible)
infoTimer.restart()
} }
function showNeedRenameInfo() function showNeedRenameInfo()
{ {
infoTimer.stop()
infoText.text = qsTr("A built-in effect with this name already exists in the library.\nPlease rename the effect before adding it to the library.") infoText.text = qsTr("A built-in effect with this name already exists in the library.\nPlease rename the effect before adding it to the library.")
infoText.visible = true
infoText.color = StudioTheme.Values.themeWarning infoText.color = StudioTheme.Values.themeWarning
infoText.visible = true
} }
onVisibleChanged: { onVisibleChanged: {
@@ -120,7 +123,7 @@ HelperWidgets.Section {
onTriggered: { onTriggered: {
infoText.visible = false infoText.visible = false
infoTimer.running = false infoTimer.stop()
} }
} }
} }