[vlc-commits] [Git][videolan/vlc][master] 4 commits: qml: implement ButtonExt
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Oct 31 09:02:08 UTC 2022
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
60bebb0e by Prince Gupta at 2022-10-31T08:36:38+00:00
qml: implement ButtonExt
implementation copied from TabButtonExt
- - - - -
7bb5a39d by Prince Gupta at 2022-10-31T08:36:38+00:00
qml: use ButtonExt instead of TabButtonExt
where TabButtonExt is used as a 'Button'
- - - - -
b5bd5aeb by Prince Gupta at 2022-10-31T08:36:38+00:00
qml: use BannerTabButton in Editor tab bar
also don't access out-of context property from base class
- - - - -
c4d3bdd4 by Prince Gupta at 2022-10-31T08:36:38+00:00
qml: remove TabButtonExt
TabButtonExt is more like a Button, 'BannerTabButton' is more suited as a TabButton
- - - - -
13 changed files:
- modules/gui/qt/Makefile.am
- modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
- modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
- modules/gui/qt/medialibrary/qml/EmptyLabelButton.qml
- modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
- modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
- modules/gui/qt/network/qml/BrowseTreeDisplay.qml
- modules/gui/qt/network/qml/ServicesManage.qml
- modules/gui/qt/player/qml/ResumeDialog.qml
- modules/gui/qt/vlc.qrc
- modules/gui/qt/widgets/qml/ActionButtonOverlay.qml
- modules/gui/qt/widgets/qml/ActionButtonPrimary.qml
- modules/gui/qt/widgets/qml/TabButtonExt.qml â modules/gui/qt/widgets/qml/ButtonExt.qml
Changes:
=====================================
modules/gui/qt/Makefile.am
=====================================
@@ -1019,7 +1019,7 @@ libqt_plugin_la_QML = \
gui/qt/widgets/qml/SpinBoxExt.qml \
gui/qt/widgets/qml/StackViewExt.qml \
gui/qt/widgets/qml/PageLoader.qml \
- gui/qt/widgets/qml/TabButtonExt.qml \
+ gui/qt/widgets/qml/ButtonExt.qml \
gui/qt/widgets/qml/TableColumns.qml \
gui/qt/widgets/qml/TransparentSpinBox.qml \
gui/qt/widgets/qml/TextToolButton.qml \
=====================================
modules/gui/qt/dialogs/toolbar/qml/EditorTabButton.qml
=====================================
@@ -23,53 +23,18 @@ import org.videolan.vlc 0.1
import "qrc:///style/"
import "qrc:///widgets/" as Widgets
-TabButton {
- id: mainPlayerControl
-
- readonly property bool active: index === bar.currentIndex
+Widgets.BannerTabButton {
+ id: root
implicitWidth: VLCStyle.button_width_large
- contentItem: Widgets.ListLabel {
- text: {
- var text = mainPlayerControl.text
-
- if (!!MainCtx.controlbarProfileModel.currentModel &&
- MainCtx.controlbarProfileModel.currentModel.getModel(mainPlayerControl.identifier).dirty)
- return _markDirty(text)
- else
- return text
- }
-
- horizontalAlignment: Text.AlignHCenter
- }
-
- background: Rectangle {
- color: active ? VLCStyle.colors.bgAlt : hovered ? VLCStyle.colors.bgHover : VLCStyle.colors.bg
-
- border.color: VLCStyle.colors.accent
- border.width: active ? VLCStyle.dp(1, VLCStyle.scale) : 0
-
- Rectangle {
- width: parent.width - parent.border.width * 2
- anchors.horizontalCenter: parent.horizontalCenter
- anchors.top: parent.bottom
-
- anchors.topMargin: -(height / 2)
-
- color: parent.color
-
- visible: active
-
- height: parent.border.width * 2
- }
- }
+ signal dropEnterred()
DropArea {
anchors.fill: parent
onEntered: {
- bar.currentIndex = index
+ root.dropEnterred()
}
}
}
=====================================
modules/gui/qt/dialogs/toolbar/qml/ToolbarEditor.qml
=====================================
@@ -55,8 +55,25 @@ Rectangle{
model: PlayerListModel.model
delegate: EditorTabButton {
- text: modelData.name
readonly property int identifier: modelData.identifier
+
+ selected: index === bar.currentIndex
+
+ implicitWidth: VLCStyle.button_width_large
+
+ text: {
+ var text = modelData.name
+
+ if (!!MainCtx.controlbarProfileModel.currentModel &&
+ MainCtx.controlbarProfileModel.currentModel.getModel(identifier).dirty)
+ return _markDirty(text)
+ else
+ return text
+ }
+
+ onDropEnterred: {
+ bar.currentIndex = index
+ }
}
}
}
=====================================
modules/gui/qt/medialibrary/qml/EmptyLabelButton.qml
=====================================
@@ -63,7 +63,7 @@ EmptyLabel {
// Children
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: button
anchors.horizontalCenter: parent.horizontalCenter
=====================================
modules/gui/qt/medialibrary/qml/MusicAlbumsGridExpandDelegate.qml
=====================================
@@ -152,7 +152,7 @@ FocusScope {
onClicked: MediaLib.addAndPlay( model.id )
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: enqueueActionBtn
iconTxt: VLCIcons.enqueue
=====================================
modules/gui/qt/medialibrary/qml/VideoInfoExpandPanel.qml
=====================================
@@ -132,7 +132,7 @@ FocusScope {
onClicked: MediaLib.addAndPlay( model.id )
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: enqueueActionBtn
iconTxt: VLCIcons.enqueue
@@ -197,7 +197,7 @@ FocusScope {
textFormat: Text.StyledText
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: showMoreButton
text: root._showMoreInfo ? I18n.qtr("View Less") : I18n.qtr("View More")
=====================================
modules/gui/qt/network/qml/BrowseTreeDisplay.qml
=====================================
@@ -180,7 +180,7 @@ FocusScope {
Layout.fillWidth: true
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: btn
focus: true
@@ -287,7 +287,7 @@ FocusScope {
Layout.fillWidth: true
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: btn
focus: true
=====================================
modules/gui/qt/network/qml/ServicesManage.qml
=====================================
@@ -93,7 +93,7 @@ Widgets.KeyNavigableListView {
}
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: action_btn
focus: true
=====================================
modules/gui/qt/player/qml/ResumeDialog.qml
=====================================
@@ -104,7 +104,7 @@ FocusScope {
text: I18n.qtr("Do you want to restart the playback where you left off?")
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: continueBtn
Layout.preferredHeight: implicitHeight
Layout.preferredWidth: implicitWidth
@@ -123,7 +123,7 @@ FocusScope {
Keys.onPressed: continueBtn.Navigation.defaultKeyAction(event)
}
- Widgets.TabButtonExt {
+ Widgets.ButtonExt {
id: closeBtn
Layout.preferredHeight: implicitHeight
Layout.preferredWidth: implicitWidth
=====================================
modules/gui/qt/vlc.qrc
=====================================
@@ -190,7 +190,7 @@
<file alias="VideoProgressBar.qml">widgets/qml/VideoProgressBar.qml</file>
<file alias="NavigableCol.qml">widgets/qml/NavigableCol.qml</file>
<file alias="NavigableRow.qml">widgets/qml/NavigableRow.qml</file>
- <file alias="TabButtonExt.qml">widgets/qml/TabButtonExt.qml</file>
+ <file alias="ButtonExt.qml">widgets/qml/ButtonExt.qml</file>
<file alias="ScrollingText.qml">widgets/qml/ScrollingText.qml</file>
<file alias="CaptionLabel.qml">widgets/qml/CaptionLabel.qml</file>
<file alias="IconLabel.qml">widgets/qml/IconLabel.qml</file>
=====================================
modules/gui/qt/widgets/qml/ActionButtonOverlay.qml
=====================================
@@ -22,7 +22,7 @@ import QtQuick 2.11
import "qrc:///style/"
-TabButtonExt {
+ButtonExt {
// Style
iconSize: VLCStyle.icon_actionButton
=====================================
modules/gui/qt/widgets/qml/ActionButtonPrimary.qml
=====================================
@@ -22,7 +22,7 @@ import QtQuick 2.11
import "qrc:///style/"
-TabButtonExt {
+ButtonExt {
// Style
iconSize: VLCStyle.icon_actionButton
=====================================
modules/gui/qt/widgets/qml/TabButtonExt.qml â modules/gui/qt/widgets/qml/ButtonExt.qml
=====================================
@@ -26,7 +26,7 @@ import org.videolan.vlc 0.1
import "qrc:///widgets/" as Widgets
import "qrc:///style/"
-T.TabButton {
+T.Button {
id: control
// Properties
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f3cc3b97448f72d287bb46f1b071b9eeb3b72005...c4d3bdd4c3a03613f796baef188134317024ba2b
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f3cc3b97448f72d287bb46f1b071b9eeb3b72005...c4d3bdd4c3a03613f796baef188134317024ba2b
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