[vlc-commits] [Git][videolan/vlc][master] 6 commits: qml: fix tabbutton active status
Felix Paul Kühne (@fkuehne)
gitlab at videolan.org
Mon Feb 6 18:31:19 UTC 2023
Felix Paul Kühne pushed to branch master at VideoLAN / VLC
Commits:
b857c681 by Pierre Lamot at 2023-02-06T17:55:29+00:00
qml: fix tabbutton active status
- - - - -
db9de3f1 by Pierre Lamot at 2023-02-06T17:55:29+00:00
qml: remove unused indicator in TextToolButton
TextToolButton are never checked
- - - - -
c49c5a82 by Pierre Lamot at 2023-02-06T17:55:29+00:00
qml: remove unused active indicator in IconToolButton
state is indicated by the color of the button content
- - - - -
13f59bb2 by Pierre Lamot at 2023-02-06T17:55:29+00:00
qml: fix current indicator not shown on focus in MusicArtistDelegate
- - - - -
56d82dd7 by Pierre Lamot at 2023-02-06T17:55:29+00:00
qml: fix Banner tabbutton margins
- - - - -
6d749765 by Pierre Lamot at 2023-02-06T17:55:29+00:00
qml: adapt button color according to the button state in Teletext Widget
- - - - -
7 changed files:
- modules/gui/qt/maininterface/qml/BannerSources.qml
- modules/gui/qt/maininterface/qml/MainDisplay.qml
- modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml
- modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml
- modules/gui/qt/widgets/qml/BannerTabButton.qml
- modules/gui/qt/widgets/qml/IconToolButton.qml
- modules/gui/qt/widgets/qml/TextToolButton.qml
Changes:
=====================================
modules/gui/qt/maininterface/qml/BannerSources.qml
=====================================
@@ -179,7 +179,7 @@ FocusScope {
focus: true
- indexFocus: selectedIndex
+ indexFocus: root.selectedIndex
Navigation.parentItem: root
Navigation.leftItem: history_back.enabled ? history_back : null
@@ -189,7 +189,7 @@ FocusScope {
iconTxt: model.icon
color: VLCStyle.colors.setColorAlpha(VLCStyle.colors.buttonHover, 0)
showText: globalToolbar.colapseTabButtons
- selected: model.index === selectedIndex
+ selected: model.index === root.selectedIndex
onClicked: root.itemClicked(model.index)
height: globalMenuGroup.height
}
=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -109,12 +109,12 @@ FocusScope {
sourcesBanner.selectedIndex = pageModel.filter(function (e) {
return e.listed
}).findIndex(function (e) {
- return e.name === root.view
+ return e.name === root.view.name
})
if (item.pageModel !== undefined)
sourcesBanner.subSelectedIndex = item.pageModel.findIndex(function (e) {
- return e.name === item.view
+ return e.name === item.view.name
})
if (Player.hasVideoOutput && MainCtx.hasEmbededVideo)
=====================================
modules/gui/qt/medialibrary/qml/MusicArtistDelegate.qml
=====================================
@@ -41,7 +41,7 @@ T.Control {
// Aliases
// Private
- readonly property bool _isHover: contentItem.containsMouse
+ readonly property bool _isHover: contentItem.containsMouse || root.activeFocus
// Signals
=====================================
modules/gui/qt/player/qml/controlbarcontrols/TeletextWidget.qml
=====================================
@@ -42,6 +42,16 @@ T.Pane {
Keys.priority: Keys.AfterItem
Keys.onPressed: Navigation.defaultKeyAction(event)
+ function _teletextButtonColor(item, base)
+ {
+ if (!item.enabled)
+ return VLCStyle.colors.setColorAlpha(base, 0.2)
+ else if (item.hovered && !item.down)
+ return Qt.lighter(base)
+ else
+ return base
+ }
+
Column {
id: column
@@ -201,7 +211,7 @@ T.Pane {
text: I18n.qtr("Red key")
colors: root.colors
- color: "red"
+ color: root._teletextButtonColor(this, "red")
Navigation.parentItem: root
Navigation.leftItem: indexKeyBtn
@@ -221,7 +231,7 @@ T.Pane {
text: I18n.qtr("Green key")
colors: root.colors
- color: "green"
+ color: root._teletextButtonColor(this, "green")
Navigation.parentItem: root
Navigation.leftItem: redKeyBtn
@@ -241,7 +251,7 @@ T.Pane {
text: I18n.qtr("Yellow key")
colors: root.colors
- color: "yellow"
+ color: root._teletextButtonColor(this, "yellow")
Navigation.parentItem: root
Navigation.leftItem: greenKeyBtn
@@ -261,7 +271,7 @@ T.Pane {
text: I18n.qtr("Blue key")
colors: root.colors
- color: "blue"
+ color: root._teletextButtonColor(this, "blue")
Navigation.parentItem: root
Navigation.leftItem: yellowKeyBtn
=====================================
modules/gui/qt/widgets/qml/BannerTabButton.qml
=====================================
@@ -90,13 +90,15 @@ T.TabButton {
}
contentItem: Item {
- implicitWidth: tabRow.implicitWidth
+ implicitWidth: tabRow.implicitWidth + VLCStyle.margin_xxsmall * 2
implicitHeight: tabRow.implicitHeight
RowLayout {
id: tabRow
anchors.centerIn: parent
+ anchors.leftMargin: VLCStyle.margin_xxsmall
+ anchors.rightMargin: VLCStyle.margin_xxsmall
spacing: VLCStyle.margin_xsmall
@@ -132,7 +134,7 @@ T.TabButton {
orientation: Qt.Horizontal
- margin: VLCStyle.dp(3, VLCStyle.scale)
+ margin: VLCStyle.margin_xxsmall
visible: (control.showCurrentIndicator && control.selected)
}
=====================================
modules/gui/qt/widgets/qml/IconToolButton.qml
=====================================
@@ -122,23 +122,5 @@ T.ToolButton {
font.underline: control.font.underline
Accessible.ignored: true
-
- T.Label {
- anchors.centerIn: parent
-
- verticalAlignment: Text.AlignVCenter
- horizontalAlignment: Text.AlignHCenter
-
- visible: !paintOnly && control.checked
-
- text: VLCIcons.active_indicator
-
- color: background ? background.foregroundColor : control.color
-
- font.pixelSize: control.size
- font.family: VLCIcons.fontFamily
-
- Accessible.ignored: true
- }
}
}
=====================================
modules/gui/qt/widgets/qml/TextToolButton.qml
=====================================
@@ -44,23 +44,6 @@ T.ToolButton {
color: VLCStyle.colors.text
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
-
- anchors {
- verticalCenter: parent.verticalCenter
- rightMargin: VLCStyle.margin_xsmall
- leftMargin: VLCStyle.margin_small
- }
-
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
- height: 2
- visible: control.checked
- color: control.activeFocus ? VLCStyle.colors.accent : VLCStyle.colors.bgHover
- }
}
background: AnimatedBackground {
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/871904989aaed3a93471c233dee8ce07630b151d...6d749765124cf10469609dacf38ff8d99ff2eda7
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/871904989aaed3a93471c233dee8ce07630b151d...6d749765124cf10469609dacf38ff8d99ff2eda7
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list