qt: add LabelExt.qml

LabelExt shows tool tip by default if its
width is not sufficient.
This commit is contained in:
Fatih Uzunoglu 2024-03-20 17:49:36 +02:00 committed by Steve Lhomme
parent cd06bb5ec3
commit a7c21e837e
3 changed files with 32 additions and 0 deletions

View File

@ -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 \

View File

@ -150,6 +150,7 @@
<file alias="MainViewLoader.qml">maininterface/qml/MainViewLoader.qml</file>
</qresource>
<qresource prefix="/widgets">
<file alias="LabelExt.qml">widgets/qml/LabelExt.qml</file>
<file alias="EmptyLabel.qml">widgets/qml/EmptyLabel.qml</file>
<file alias="EmptyLabelButton.qml">widgets/qml/EmptyLabelButton.qml</file>
<file alias="EmptyLabelHint.qml">widgets/qml/EmptyLabelHint.qml</file>

View File

@ -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
}
}