diff --git a/modules/gui/qt/Makefile.am b/modules/gui/qt/Makefile.am index e4b6c6cd33..9918887b96 100644 --- a/modules/gui/qt/Makefile.am +++ b/modules/gui/qt/Makefile.am @@ -1030,6 +1030,7 @@ libqt_plugin_la_QML = \ util/qml/NativeMenu.qml \ util/qml/MLContextMenu.qml \ util/qml/FadeControllerStateGroup.qml \ + widgets/qml/LabelExt.qml \ widgets/qml/ActionButtonOverlay.qml \ widgets/qml/ActionButtonPrimary.qml \ widgets/qml/BannerTabButton.qml \ diff --git a/modules/gui/qt/vlc.qrc b/modules/gui/qt/vlc.qrc index 0b18a30395..24031bd409 100644 --- a/modules/gui/qt/vlc.qrc +++ b/modules/gui/qt/vlc.qrc @@ -150,6 +150,7 @@ maininterface/qml/MainViewLoader.qml + widgets/qml/LabelExt.qml widgets/qml/EmptyLabel.qml widgets/qml/EmptyLabelButton.qml widgets/qml/EmptyLabelHint.qml diff --git a/modules/gui/qt/widgets/qml/LabelExt.qml b/modules/gui/qt/widgets/qml/LabelExt.qml new file mode 100644 index 0000000000..bff006099f --- /dev/null +++ b/modules/gui/qt/widgets/qml/LabelExt.qml @@ -0,0 +1,30 @@ +/***************************************************************************** + * Copyright (C) 2024 VLC authors and VideoLAN + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * ( at your option ) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ +import QtQuick 2.12 +import QtQuick.Templates 2.12 as T +import "qrc:///style/" + +T.Label { + T.ToolTip.visible: (elide !== Text.ElideNone) && (width < implicitWidth) && hoverHandler.hovered + T.ToolTip.delay: VLCStyle.delayToolTipAppear + T.ToolTip.text: text + + HoverHandler { + id: hoverHandler + } +}