[vlc-commits] [Git][videolan/vlc][master] 10 commits: qt: also check for update button for old update dialog fallback

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Thu Nov 26 07:16:42 UTC 2026



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
f553d115 by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qt: also check for update button for old update dialog fallback

- - - - -
9b27b7f4 by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qt: add missing colors for standard button in system palette theme provider

- - - - -
30c0faba by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qt: use `GtkButton#button` for standard button in `gtkthemeprovider`

Co-authored-by: Leon Vitanos <leon.vitanos at gmail.com>

- - - - -
ab6de2f3 by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qt: add missing colors for standard button in gtk theme provider

Co-authored-by: Leon Vitanos <leon.vitanos at gmail.com>

- - - - -
18c2fdda by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qml: introduce update button in side navigation pane

- - - - -
21bf073c by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qml: do not show the update pane if update button is shown

Only applicable when the check is not explicit (such as during automatic
check at start).

- - - - -
a95eead1 by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qt: add `BadgeType` enum and property `badge` in `SidePanelCtx`

- - - - -
bf051309 by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qt: fix `SidePanelCtx` is not registered in qml engine

It should have been registered anonymously, since its
used in QML.

But now that there is an `enum`, it can be registered
as uncreatable element.

- - - - -
6486d0cf by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qml: show badge in side bar toggle button when applicable

This is currently used in the case update found or error
button is available, but is not shown because the side bar
is fully collapsed due to small window width.

- - - - -
3d86ce42 by Fatih Uzunoglu at 2026-11-26T07:50:27+01:00
qt: fix explicit check is not set with update re-check button

- - - - -


11 changed files:

- modules/gui/qt/dialogs/help/help.cpp
- modules/gui/qt/maininterface/mainctx.cpp
- modules/gui/qt/maininterface/mainctx_submodels.cpp
- modules/gui/qt/maininterface/mainctx_submodels.hpp
- modules/gui/qt/maininterface/mainui.cpp
- modules/gui/qt/maininterface/qml/LocalTopbar.qml
- modules/gui/qt/maininterface/qml/MainDisplay.qml
- modules/gui/qt/maininterface/qml/SideNavigationPane.qml
- modules/gui/qt/maininterface/qml/UpdatePane.qml
- modules/gui/qt/style/gtkthemeprovider/gtkthemeprovider.cpp
- modules/gui/qt/style/systempalettethemeprovider.cpp


Changes:

=====================================
modules/gui/qt/dialogs/help/help.cpp
=====================================
@@ -478,7 +478,7 @@ void UpdateDialog::checkOrDownload()
     case UpdateModel::CheckFailed:
     {
         ui.stackedWidget->setCurrentWidget( ui.updateRequestPage );
-        m_model->checkUpdate();
+        m_model->checkUpdate(true);
         break;
     }
     case UpdateModel::NeedUpdate:


=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -1224,7 +1224,9 @@ UpdateModel* MainCtx::getUpdateModel() const
                     const auto target = p_intf->p_compositor->quickWindow()->contentItem();
                     QMetaObject::invokeMethod(target, [target]() {
                         const auto updatePaneLoader = target->findChild<QQuickItem*>(QStringLiteral("updatePaneLoader"));
-                        if (!updatePaneLoader || (updatePaneLoader->property("status").toInt() != 1 /* Loader.Ready */))
+                        const auto updateButtonLoader = target->findChild<QQuickItem*>(QStringLiteral("updateButtonLoader"));
+                        if ((!updatePaneLoader || (updatePaneLoader->property("status").toInt() != 1 /* Loader.Ready */)) &&
+                            (!updateButtonLoader || (updateButtonLoader->property("status").toInt() != 1 /* Loader.Ready */)))
                         {
                             qDebug("No acknowledgement from the modern update loader, falling back to the old update dialog.");
                             THEDP->updateDialog(DialogsProvider::Show);


=====================================
modules/gui/qt/maininterface/mainctx_submodels.cpp
=====================================
@@ -58,3 +58,11 @@ void SidePanelCtx::setWidth(double value)
     m_width = unscaledValue;
     emit widthChanged(width());
 }
+
+void SidePanelCtx::setBadge(BadgeType badge)
+{
+    if (m_badge == badge)
+        return;
+    m_badge = badge;
+    emit badgeChanged(badge);
+}


=====================================
modules/gui/qt/maininterface/mainctx_submodels.hpp
=====================================
@@ -114,28 +114,45 @@ class SidePanelCtx: public QObject
     Q_OBJECT
     Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL)
     Q_PROPERTY(bool docked READ isDocked WRITE setDocked NOTIFY dockedChanged FINAL)
+    Q_PROPERTY(BadgeType badge READ badge WRITE setBadge NOTIFY badgeChanged FINAL)
     Q_PROPERTY(double width READ width WRITE setWidth NOTIFY widthChanged FINAL)
 
+    QML_ELEMENT
+    QML_UNCREATABLE("")
+
 public:
+    enum BadgeType
+    {
+        BadgeNone,
+        BadgeNeutral,
+        BadgePositive,
+        BadgeNegative
+    };
+    Q_ENUM(BadgeType)
+
     SidePanelCtx(MainCtx* ctx, QObject* parent = nullptr);
 
     inline bool isDocked() const { return m_docked; }
     inline bool isVisible() const { return m_visible; }
+    inline BadgeType badge() const { return m_badge; }
     double width() const;
 
     void setDocked(bool value);
     void setVisible(bool value);
     void setWidth(double value);
+    void setBadge(BadgeType badge);
 
 signals:
     void visibleChanged(bool visible);
     void dockedChanged(bool);
     void widthChanged(double);
+    void badgeChanged(SidePanelCtx::BadgeType);
 
 private:
     MainCtx* m_ctx = nullptr;
     bool m_visible = true;
     bool m_docked = false;
+    BadgeType m_badge = BadgeNone;
     // size in dp
     double  m_width = 120;
 


=====================================
modules/gui/qt/maininterface/mainui.cpp
=====================================
@@ -228,6 +228,7 @@ void MainUI::registerQMLTypes()
 #endif
         qmlRegisterTypesAndRevisions<SearchCtx>(uri, versionMajor);
         qmlRegisterTypesAndRevisions<SortCtx>(uri, versionMajor);
+        qmlRegisterTypesAndRevisions<SidePanelCtx>(uri, versionMajor);
         qmlRegisterUncreatableType<UINotifier>(uri, versionMajor, versionMinor, "UINotifier", "");
         qmlRegisterSingletonInstance<UINotifier>(uri, versionMajor, versionMinor, "UINotifier", new UINotifier(m_mainCtx, m_mainCtx));
         qmlRegisterSingletonInstance<NavigationHistory>(uri, versionMajor, versionMinor, "History", new NavigationHistory(this));


=====================================
modules/gui/qt/maininterface/qml/LocalTopbar.qml
=====================================
@@ -117,6 +117,53 @@ T.ToolBar {
 
                     onClicked: root.toggleNavigationVisibility()
 
+                    Rectangle {
+                        id: badgeIndicator
+
+                        parent: navigationVisibilty
+                        z: 99
+
+                        anchors.top: parent.top
+                        anchors.right: parent.right
+                        anchors.topMargin: VLCStyle.margin_xxxsmall
+                        anchors.rightMargin: VLCStyle.margin_xxxsmall
+
+                        color: "transparent"
+
+                        readonly property int badgeType: MainCtx.navigationPanel.badge
+
+                        onBadgeTypeChanged: {
+                            switch (badgeType) {
+                            case SidePanelCtx.BadgePositive:
+                                badgeIndicator.color = Qt.binding(() => theme.fg.positive)
+                                break
+                            case SidePanelCtx.BadgeNegative:
+                                badgeIndicator.color = Qt.binding(() => theme.fg.negative)
+                                break
+                            case SidePanelCtx.BadgeNeutral:
+                                badgeIndicator.color = Qt.binding(() => theme.fg.neutral)
+                                break
+                            default:
+                                break
+                            }
+                        }
+
+                        radius: (width / 2)
+
+                        height: width
+                        width: VLCStyle.dp(8, VLCStyle.scale)
+
+                        visible: (opacity > 0.0)
+
+                        opacity: (MainCtx.navigationPanel.badge !== SidePanelCtx.BadgeNone) ? 1.0 : 0.0
+
+                        Behavior on opacity {
+                            OpacityAnimator {
+                                duration: VLCStyle.duration_short
+                            }
+                        }
+                    }
+
                     Navigation.parentItem: navigationButtons
                     Navigation.rightItem: historyBack
                 }


=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -857,6 +857,9 @@ FocusScope {
             if (UpdateModel.explicitCheck) {
                 return (UpdateModel.updateStatus !== UpdateModel.Unchecked)
             } else {
+                if (sidebar.loaderUpdateButton.active && !sidebar.loaderUpdateButton.suppressed)
+                    return false
+
                 if (UpdateModel.updateStatus === UpdateModel.updateStatusOnAcknowledgment)
                     return false // already dismissed with the same status
 


=====================================
modules/gui/qt/maininterface/qml/SideNavigationPane.qml
=====================================
@@ -60,6 +60,8 @@ T.Pane {
         colorSet: ColorContext.Window
     }
 
+    property alias loaderUpdateButton: loaderUpdateButton
+
     Accessible.name: qsTr("Sidebar")
 
     NavigationModel {
@@ -157,7 +159,7 @@ T.Pane {
                 }
 
                 Navigation.parentItem: root
-                Navigation.downItem: preferenceButton
+                Navigation.downItem: loaderUpdateButton
 
                 delegate: SideNavigationDelegate {
                     id: delegate
@@ -261,6 +263,248 @@ T.Pane {
                 }
             }
 
+            Loader {
+                id: loaderUpdateButton
+
+                // WARNING: Object name is used from C++ side to acknowledge the modern update pane is loaded,
+                //          if C++ side does not get this acknowledgement, the old update dialog is shown as
+                //          fallback.
+                objectName: "updateButtonLoader"
+
+                visible: active
+
+                Layout.fillWidth: true
+
+                readonly property bool updateModelIsAvailable: (typeof UpdateModel !== 'undefined')
+
+                opacity: 0.0
+
+                Behavior on opacity {
+                    OpacityAnimator {
+                        duration: VLCStyle.duration_short
+                    }
+                }
+
+                active: updateModelIsAvailable && (shouldShow || opacity > 0.0)
+
+                Binding {
+                    target: MainCtx.navigationPanel
+                    property: "badge"
+                    when: loaderUpdateButton.shouldShow &&
+                          !loaderUpdateButton.visible &&
+                          !loaderUpdateButton.suppressed
+                    value: {
+                       if (!loaderUpdateButton.updateModelIsAvailable)
+                           return SidePanelCtx.BadgeNone
+
+                        switch (UpdateModel.updateStatus) {
+                        case UpdateModel.NeedUpdate:
+                            return SidePanelCtx.BadgePositive
+                        case UpdateModel.CheckFailed:
+                            return SidePanelCtx.BadgeNegative
+                        default:
+                            return SidePanelCtx.BadgeNeutral
+                        }
+                    }
+                }
+
+                readonly property bool shouldShow: {
+                    if (!updateModelIsAvailable)
+                        return false
+
+                    if (DialogsProvider.updateDialogVisible)
+                        return false
+                        
+                    if (UpdateModel.explicitCheck) {
+                        return false // This button is only meant for non-explicit update checks (unlike update pane).
+                    } else {
+                        if (UpdateModel.updateStatus === UpdateModel.updateStatusOnAcknowledgment)
+                            return false // already dismissed with the same status
+
+                        switch (UpdateModel.updateStatus) {
+                            case UpdateModel.NeedUpdate:
+                            case UpdateModel.CheckFailed:
+                                return true
+                            default:
+                                return false
+                        }
+                    }
+                }
+
+                onShouldShowChanged: {
+                    if (shouldShow) {
+                        opacity = 1.0
+                        suppressed = false
+                    }
+                }
+
+                property bool suppressed: false
+
+                function dismiss(suppress /* : bool */ = false) {
+                    // This could be also be an assertion:
+                    if (updateModelIsAvailable) {
+                        if (!suppress)
+                            UpdateModel.updateStatusOnAcknowledgment = UpdateModel.updateStatus
+                    }
+
+                    if (suppress)
+                        suppressed = true
+
+                    opacity = 0.0
+                }
+
+                Navigation.parentItem: root
+                Navigation.upItem: listView
+                Navigation.downItem: preferenceButton
+
+                sourceComponent: Widgets.ButtonExt {
+                    id: updateButton
+
+                    focus: true
+
+                    radius: VLCStyle.button_radius
+
+                    verticalPadding: VLCStyle.margin_xxsmall
+
+                    leftPadding: root.safeAreaLeftMargin + VLCStyle.margin_xsmall
+                    rightPadding: root.safeAreaRightMargin + VLCStyle.margin_xsmall
+
+                    leftInset: root.safeAreaLeftMargin + VLCStyle.margin_xxsmall
+                    rightInset: root.safeAreaRightMargin + VLCStyle.margin_xxsmall
+
+                    topInset: VLCStyle.margin_xxxsmall
+                    bottomInset: VLCStyle.margin_xxxsmall
+
+                    topPadding: VLCStyle.margin_xxsmall
+                    bottomPadding: VLCStyle.margin_xxsmall
+
+                    spacing: VLCStyle.margin_xsmall
+
+                    showText: root.delegateShowText
+
+                    iconSize: VLCStyle.icon_banner
+
+                    font.pixelSize: VLCStyle.fontSize_normal
+
+                    text: {
+                        switch (UpdateModel.updateStatus) {
+                        case UpdateModel.NeedUpdate:
+                            return qsTr("Update found!")
+                        case UpdateModel.CheckFailed:
+                            return qsTr("Update error!")
+                        default:
+                            return qsTr("N/A")
+                        }
+                    }
+
+                    Navigation.parentItem: loaderUpdateButton
+
+                    Keys.onCancelPressed: {
+                        loaderUpdateButton.dismiss()
+                    }
+
+                    Keys.onEscapePressed: {
+                        loaderUpdateButton.dismiss()
+                    }
+
+                    onClicked: {
+                        loaderUpdateButton.dismiss(true)
+                    }
+
+                    background: Widgets.AnimatedBackground {
+                        enabled: updateButton.colorContext.initialized
+
+                        color: {
+                            switch (UpdateModel.updateStatus) {
+                            case UpdateModel.NeedUpdate:
+                                return updateButton.colorContext.bg.positive
+                            case UpdateModel.CheckFailed:
+                                return updateButton.colorContext.bg.negative
+                            default:
+                                return updateButton.colorContext.bg.neutral
+                            }
+                        }
+
+                        border.color: updateButton.visualFocus ? updateButton.colorFocus
+                                                               : (updateButton.colorContext.border.a > 0.0 ? updateButton.colorContext.border
+                                                                                                           : color)
+
+                        radius: updateButton.radius
+
+                        opacity: 0.8
+                    }
+
+                    contentItem: RowLayout {
+                        spacing: updateButton.spacing
+
+                        property alias label: contentText
+
+                        Widgets.IconLabel {
+                            Layout.fillHeight: true
+
+                            font.pixelSize: updateButton.iconSize
+
+                            text: VLCIcons.ic_fluent_arrow_sync_24_regular
+
+                            color: updateButton.colorContext.fg.primary
+                        }
+
+                        Widgets.LabelExt {
+                            id: contentText
+
+                            Layout.fillWidth: true
+                            Layout.fillHeight: true
+
+                            font: updateButton.font
+
+                            visible: updateButton.showText
+
+                            elide: Text.ElideRight
+
+                            verticalAlignment: Text.AlignVCenter
+
+                            text: updateButton.text
+
+                            color: updateButton.colorContext.fg.primary
+
+                            Accessible.ignored: true
+                        }
+
+                        Widgets.IconToolButton {
+                            id: closeButton
+
+                            Layout.fillHeight: true
+                            Layout.maximumHeight: width
+
+                            implicitHeight: contentText.implicitHeight
+
+                            description: qsTr("Dismiss the update button")
+                            text: VLCIcons.close
+
+                            visible: contentText.visible
+
+                            // We handle escape key press in `updateButton`:
+                            activeFocusOnTab: false
+
+                            onClicked: {
+                                loaderUpdateButton.dismiss()
+                            }
+
+                            // This blocks propagating hover to the root button (updateButton):
+                            HoverHandler {
+                                id: hoverHandler
+
+                                Component.onCompleted: {
+                                    // TODO: Directly set with Qt 6.3
+                                    if (hoverHandler.blocking !== undefined)
+                                        hoverHandler.blocking = true
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
             SideNavigationDelegate {
                 id: preferenceButton
 
@@ -288,7 +532,7 @@ T.Pane {
                 focusPolicy: Qt.StrongFocus
 
                 Navigation.parentItem: root
-                Navigation.upItem: listView
+                Navigation.upItem: loaderUpdateButton
 
                 Keys.priority: Keys.AfterItem
                 Keys.onPressed: (e) => Navigation.defaultKeyAction(e)


=====================================
modules/gui/qt/maininterface/qml/UpdatePane.qml
=====================================
@@ -169,7 +169,7 @@ T.Pane {
 
                 onClicked: {
                     descriptionFlickable.revealed = false
-                    UpdateModel.checkUpdate()
+                    UpdateModel.checkUpdate(true)
                 }
 
                 Navigation.parentItem: root


=====================================
modules/gui/qt/style/gtkthemeprovider/gtkthemeprovider.cpp
=====================================
@@ -306,12 +306,21 @@ static int updatePalette(vlc_qt_theme_provider_t* obj)
         setGtkColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_PRIMARY, VQTC_STATE_NORMAL, tabButtonNormalBg);
     }
 
-#define BUTTON_STANDARD_SELECTOR VIEW_SELECTOR " GtkButton#button.flat"
+#define BUTTON_STANDARD_SELECTOR VIEW_SELECTOR " GtkButton#button"
     {
         auto CS = VQTC_SET_BUTTON_STANDARD;
         setGtkColorSetBg(obj, CS, VQTC_NAME_PRIMARY, BUTTON_STANDARD_SELECTOR);
         setGtkColorSetFg(obj, CS, VQTC_NAME_PRIMARY, BUTTON_STANDARD_SELECTOR);
         setGtkColorSetBorder(obj, CS, BUTTON_STANDARD_SELECTOR);
+
+        setGtkColorSetBg(obj, CS, VQTC_NAME_NEGATIVE, BUTTON_STANDARD_SELECTOR ".destructive-action");
+        setGtkColorSetFg(obj, CS, VQTC_NAME_NEGATIVE, BUTTON_STANDARD_SELECTOR ".destructive-action");
+
+        setGtkColorSetBg(obj, CS, VQTC_NAME_NEUTRAL, BUTTON_STANDARD_SELECTOR ".warning");
+        setGtkColorSetFg(obj, CS, VQTC_NAME_NEUTRAL, BUTTON_STANDARD_SELECTOR ".warning");
+
+        setGtkColorSetBg(obj, CS, VQTC_NAME_POSITIVE, BUTTON_STANDARD_SELECTOR ".suggested-action");
+        setGtkColorSetFg(obj, CS, VQTC_NAME_POSITIVE, BUTTON_STANDARD_SELECTOR ".suggested-action");
     }
 
 #define BUTTON_ACCENT_SELECTOR VIEW_SELECTOR " GtkButton#button.suggested-action"


=====================================
modules/gui/qt/style/systempalettethemeprovider.cpp
=====================================
@@ -338,6 +338,13 @@ static int updatePalette(vlc_qt_theme_provider_t* obj)
 
         //always no border
         setQtColor(obj, CS, VQTC_SECTION_DECORATION, VQTC_NAME_BORDER, VQTC_STATE_NORMAL, Qt::transparent);
+
+        setQtColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_POSITIVE, VQTC_STATE_NORMAL, positive);
+        setQtColor(obj, CS, VQTC_SECTION_FG, VQTC_NAME_POSITIVE, VQTC_STATE_NORMAL, textOnPositive);
+        setQtColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_NEGATIVE, VQTC_STATE_NORMAL, negative);
+        setQtColor(obj, CS, VQTC_SECTION_FG, VQTC_NAME_NEGATIVE, VQTC_STATE_NORMAL, textOnNegative);
+        setQtColor(obj, CS, VQTC_SECTION_BG, VQTC_NAME_NEUTRAL, VQTC_STATE_NORMAL, neutral);
+        setQtColor(obj, CS, VQTC_SECTION_FG, VQTC_NAME_NEUTRAL, VQTC_STATE_NORMAL, textOnNeutral);
     }
 
     //Tooltip



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/865394f5d5a8ee1a139ec07e8a08765a46c38c59...3d86ce421d286bee2b36a7bc30ef00deef88c7a7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/865394f5d5a8ee1a139ec07e8a08765a46c38c59...3d86ce421d286bee2b36a7bc30ef00deef88c7a7
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the vlc-commits mailing list