[vlc-commits] [Git][videolan/vlc][master] 2 commits: qml: add ToolTipExt.qml widget
Hugo Beauzée-Luyssen (@chouquette)
gitlab at videolan.org
Fri Oct 22 08:26:14 UTC 2021
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
baab6e95 by Fatih Uzunoglu at 2021-10-22T08:04:41+00:00
qml: add ToolTipExt.qml widget
- - - - -
e9c2c881 by Fatih Uzunoglu at 2021-10-22T08:04:41+00:00
qml: use ToolTipExt where possible
- - - - -
11 changed files:
- modules/gui/qt/Makefile.am
- modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml
- modules/gui/qt/player/qml/LanguageMenu.qml
- modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
- modules/gui/qt/playlist/qml/PlaylistListView.qml
- modules/gui/qt/vlc.qrc
- modules/gui/qt/widgets/qml/IconControlButton.qml
- modules/gui/qt/widgets/qml/IconToolButton.qml
- modules/gui/qt/widgets/qml/PointingTooltip.qml
- modules/gui/qt/widgets/qml/ToolTipArea.qml
- + modules/gui/qt/widgets/qml/ToolTipExt.qml
Changes:
=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -902,7 +902,8 @@ libqt_plugin_la_QML = \
gui/qt/widgets/qml/ListSubtitleLabel.qml \
gui/qt/widgets/qml/PointingTooltip.qml \
gui/qt/widgets/qml/FrostedGlassEffect.qml \
- gui/qt/widgets/qml/OverlayMenu.qml
+ gui/qt/widgets/qml/OverlayMenu.qml \
+ gui/qt/widgets/qml/ToolTipExt.qml
lib_qt_plugin_la_QRC = gui/qt/vlc.qrc
=====================================
modules/gui/qt/dialogs/toolbar/qml/ToolbarEditorDialog.qml
=====================================
@@ -143,7 +143,7 @@ WindowDialog {
mainInterface.controlbarProfileModel.selectedProfile = (mainInterface.controlbarProfileModel.rowCount() - 1)
}
- ToolTip.visible: hovered
+ toolTip.visible: hovered
}
Widgets.IconToolButton {
@@ -156,7 +156,7 @@ WindowDialog {
mainInterface.controlbarProfileModel.currentModel.injectDefaults(false)
}
- ToolTip.visible: hovered
+ toolTip.visible: hovered
}
Widgets.IconToolButton {
@@ -167,7 +167,7 @@ WindowDialog {
mainInterface.controlbarProfileModel.deleteSelectedProfile()
}
- ToolTip.visible: hovered
+ toolTip.visible: hovered
}
}
=====================================
modules/gui/qt/player/qml/LanguageMenu.qml
=====================================
@@ -153,10 +153,10 @@ T.Popup {
highlighted: index === 3
&& player.subtitleTracks.multiSelect
- ToolTip.visible: (hovered || activeFocus)
- ToolTip.text: modelData.tooltip
- ToolTip.delay: 1000
- ToolTip.toolTip.z: 2
+ toolTip.visible: (hovered || activeFocus)
+ toolTip.text: modelData.tooltip
+ toolTip.delay: 1000
+ toolTip.z: 2
Navigation.parentItem: btnsCol
=====================================
modules/gui/qt/player/qml/controlbarcontrols/ArtworkInfoWidget.qml
=====================================
@@ -105,7 +105,7 @@ AbstractButton {
width: VLCStyle.dp(60)
height: VLCStyle.dp(60)
- ToolTip {
+ Widgets.ToolTipExt {
x: parent.x
visible: artworkInfoItem.visible
@@ -113,14 +113,9 @@ AbstractButton {
&& (artworkInfoItem.hovered || artworkInfoItem.visualFocus)
delay: 500
- contentItem: Text {
- text: i18n.qtr("%1\n%2\n%3").arg(titleLabel.text).arg(artistLabel.text).arg(progressIndicator.text)
- color: colors.tooltipTextColor
- }
+ text: i18n.qtr("%1\n%2\n%3").arg(titleLabel.text).arg(artistLabel.text).arg(progressIndicator.text)
- background: Rectangle {
- color: colors.tooltipColor
- }
+ colors: artworkInfoItem.colors
}
}
}
=====================================
modules/gui/qt/playlist/qml/PlaylistListView.qml
=====================================
@@ -464,9 +464,11 @@ Control {
}
}
- ToolTip {
+ Widgets.ToolTipExt {
id: plInfoTooltip
delay: 750
+
+ colors: root.colors
}
delegate: PlaylistDelegate {
=====================================
modules/gui/qt/vlc.qrc
=====================================
@@ -258,6 +258,7 @@
<file alias="IconControlButton.qml">widgets/qml/IconControlButton.qml</file>
<file alias="ShadowCoverGenerator.qml">widgets/qml/ShadowCoverGenerator.qml</file>
<file alias="GridShadows.qml">widgets/qml/GridShadows.qml</file>
+ <file alias="ToolTipExt.qml">widgets/qml/ToolTipExt.qml</file>
</qresource>
<qresource prefix="/network">
<file alias="AddressbarButton.qml">network/qml/AddressbarButton.qml</file>
=====================================
modules/gui/qt/widgets/qml/IconControlButton.qml
=====================================
@@ -34,4 +34,6 @@ IconToolButton {
: colors.blendColors(colors.playerBg, colors.playerControlBarFg, 0.75)
colorFocus: colors.bgFocus
+
+ toolTip.colors: colors
}
=====================================
modules/gui/qt/widgets/qml/IconToolButton.qml
=====================================
@@ -21,6 +21,7 @@ import QtQuick.Controls 2.4
import org.videolan.vlc 0.1
+import "qrc:///widgets/" as Widgets
import "qrc:///style/"
ToolButton {
@@ -49,6 +50,8 @@ ToolButton {
// Aliases
+ property alias toolTip: toolTip
+
// active border color
property alias colorFocus: background.activeBorderColor
@@ -58,9 +61,6 @@ ToolButton {
enabled: !paintOnly
- ToolTip.text: text
- ToolTip.delay: 500
-
// Keys
Keys.priority: Keys.AfterItem
@@ -69,6 +69,12 @@ ToolButton {
// Childs
+ Widgets.ToolTipExt {
+ id: toolTip
+ text: control.text
+ delay: 500
+ }
+
background: AnimatedBackground {
id: background
=====================================
modules/gui/qt/widgets/qml/PointingTooltip.qml
=====================================
@@ -20,7 +20,7 @@ import QtQuick.Controls 2.4
import "qrc:///style/"
-ToolTip {
+ToolTipExt {
id: pointingTooltip
margins: 0
@@ -29,19 +29,9 @@ ToolTip {
x: _x
y: pos.y - (implicitHeight + arrowArea.implicitHeight + VLCStyle.dp(7.5))
- font.pixelSize: VLCStyle.fontSize_normal
-
- property VLCColors colors: VLCStyle.colors
-
readonly property real _x: pos.x - (width / 2)
property point pos
- contentItem: Label {
- text: pointingTooltip.text
- font: pointingTooltip.font
- color: colors.tooltipTextColor
- }
-
background: Rectangle {
border.color: colors.border
color: colors.tooltipColor
=====================================
modules/gui/qt/widgets/qml/ToolTipArea.qml
=====================================
@@ -29,7 +29,7 @@ MouseArea {
hoverEnabled: true
propagateComposedEvents: true
- ToolTip {
+ ToolTipExt {
id: tip
text: "plop"
delay: VLCStyle.delayToolTipAppear
=====================================
modules/gui/qt/widgets/qml/ToolTipExt.qml
=====================================
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (C) 2021 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.11
+import QtQuick.Controls 2.4
+
+import "qrc:///style/"
+
+ToolTip {
+ id: control
+
+ margins: VLCStyle.margin_xsmall
+ padding: VLCStyle.margin_xsmall
+
+ font.pixelSize: VLCStyle.fontSize_normal
+
+ property VLCColors colors: VLCStyle.colors
+
+ contentItem: Text {
+ text: control.text
+ font: control.font
+
+ color: colors.tooltipTextColor
+ }
+
+ background: Rectangle {
+ border.color: colors.border
+ color: colors.tooltipColor
+ }
+}
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/457dcf4fd325a4b14567684876933a4fcb555383...e9c2c881f666f2ed67460d74aa05664d686f9eb8
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/457dcf4fd325a4b14567684876933a4fcb555383...e9c2c881f666f2ed67460d74aa05664d686f9eb8
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list