Commit 75395c12 authored by Nate Graham's avatar Nate Graham
Browse files

Clean up code for FlatButtonWithToolTip

- Don't set accessible.name and .description properties, as Qt injects
  these automatically for icons-only buttons set using the display:
  property
- Use the Kirigami duration for how long it takes the tooltip to appear
- Only show a tooltip if the button has remained icons-only and wasn't
  overridden to show text too
- Remove unnecessary imports
- Bump versions of necessary imports
parent cafc34d8
Pipeline #202241 passed with stage
in 5 minutes and 29 seconds
......@@ -4,24 +4,21 @@
SPDX-License-Identifier: LGPL-3.0-or-later
*/
import QtQuick 2.7
import QtQuick.Layouts 1.2
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.3
import org.kde.kirigami 2.5 as Kirigami
import QtQuick 2.15
import QtQuick.Controls 2.15
import org.kde.kirigami 2.15 as Kirigami
import org.kde.elisa 1.0
ToolButton {
display: AbstractButton.IconOnly
ToolTip.visible: hovered && text.length > 0
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.visible: hovered
&& text.length > 0
&& display === AbstractButton.IconOnly
ToolTip.delay: Kirigami.Units.toolTipDelay
ToolTip.text: text
Keys.onReturnPressed: action ? action.trigger() : clicked()
Keys.onEnterPressed: action ? action.trigger() : clicked()
Accessible.name: ToolTip.text
Accessible.description: ToolTip.text
Accessible.onPressAction: clicked()
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment