[vlc-commits] [Git][videolan/vlc][master] 14 commits: qt: set application version
Steve Lhomme (@robUx4)
gitlab at videolan.org
Fri Jul 3 17:51:41 UTC 2026
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
d8c5d94d by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qt: set application version
- - - - -
9ac97775 by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qt: introduce property `UpdateModel::explicitCheck`
- - - - -
c0ae64df by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qml: restrict opening update pane if update is not explicitly checked
If the update is not explicitly checked, we should not open the pane
unless new update is found or an error is encountered.
- - - - -
741d8e15 by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qt: add enum `Mode` in `DialogsProvider`
- - - - -
0fd0da4d by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qt: add parameter `DialogsProvider::Mode` to `DialogsProvider::updateDialog()`
- - - - -
bfd32e59 by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qt: open legacy update dialog in more applicable cases
Since we now have `explicitCheck` property in update
model, we can trigger opening the legacy dialog in
more applicable cases.
- - - - -
0b896185 by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qml: anchor pip player to update pane loader in `MainDisplay`
- - - - -
3e7960c5 by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qt: update negative/neutral/positive colors in `systempalettethemeprovider.cpp`
- - - - -
cd770daa by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qt: update negative/neutral/positive colors in `SystemPalette`
- - - - -
ceabddbc by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qml: use primary color set for foreground in `Dialogs.qml`
The error dialog uses negative background color, using
negative foreground color would not provide enough
contrast.
- - - - -
3dff153d by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qml: provide current version in `UpdatePane`
- - - - -
6f82e5fc by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qml: colorize the new version in neutral color in `UpdatePane`
- - - - -
399bea25 by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qml: colorize "error" red in `UpdatePane`
- - - - -
a7fe8a23 by Fatih Uzunoglu at 2026-07-03T17:16:12+00:00
qml: fix reference error regarding `UpdateModel` in `MainDisplay`
- - - - -
12 changed files:
- modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml
- modules/gui/qt/dialogs/dialogs_provider.cpp
- modules/gui/qt/dialogs/dialogs_provider.hpp
- modules/gui/qt/dialogs/help/help.cpp
- modules/gui/qt/dialogs/help/help.hpp
- modules/gui/qt/maininterface/mainctx.cpp
- modules/gui/qt/maininterface/qml/MainDisplay.qml
- modules/gui/qt/maininterface/qml/UpdatePane.qml
- modules/gui/qt/menus/menus.cpp
- modules/gui/qt/qt.cpp
- modules/gui/qt/style/systempalette.cpp
- modules/gui/qt/style/systempalettethemeprovider.cpp
Changes:
=====================================
modules/gui/qt/dialogs/dialogs/qml/Dialogs.qml
=====================================
@@ -198,7 +198,7 @@ Item {
Widgets.IconLabel {
text: VLCIcons.info
- color: errorMsgTheme.fg.negative
+ color: errorMsgTheme.fg.primary
Layout.leftMargin: VLCStyle.margin_xxsmall
}
@@ -215,7 +215,7 @@ Item {
wrapMode: Text.WrapAnywhere
font.pixelSize: VLCStyle.fontSize_normal
font.bold: true
- color: errorMsgTheme.fg.negative
+ color: errorMsgTheme.fg.primary
}
Widgets.TextToolButton {
@@ -240,7 +240,7 @@ Item {
description: qsTr("Dismiss")
Layout.rightMargin: VLCStyle.margin_xxsmall
- color: closeBtn.colorContext.fg.negative
+ color: closeBtn.colorContext.fg.primary
backgroundColor: closeBtn.colorContext.bg.negative
onClicked: {
=====================================
modules/gui/qt/dialogs/dialogs_provider.cpp
=====================================
@@ -304,9 +304,23 @@ void DialogsProvider::helpDialog()
}
#ifdef UPDATE_CHECK
-void DialogsProvider::updateDialog()
+void DialogsProvider::updateDialog(Mode mode)
{
- toggleDialogVisible(m_updateDialog);
+ ensureDialog(m_updateDialog);
+ assert(m_updateDialog);
+
+ switch (mode)
+ {
+ case Mode::Show:
+ m_updateDialog->show();
+ break;
+ case Mode::Hide:
+ m_updateDialog->hide();
+ break;
+ case Mode::Toggle:
+ default:
+ toggleDialogVisible(m_updateDialog);
+ };
}
#endif
=====================================
modules/gui/qt/dialogs/dialogs_provider.hpp
=====================================
@@ -95,6 +95,14 @@ class DialogsProvider : public QObject, public Singleton<DialogsProvider>
friend class Singleton<DialogsProvider>;
public:
+ enum Mode
+ {
+ Show,
+ Hide,
+ Toggle
+ };
+ Q_ENUM(Mode)
+
static DialogsProvider *getInstance()
{
const auto instance = Singleton<DialogsProvider>::getInstance<false>();
@@ -189,7 +197,7 @@ public slots:
#endif
void helpDialog();
#if defined(UPDATE_CHECK)
- void updateDialog();
+ void updateDialog(Mode mode = Toggle);
#endif
void aboutDialog();
void gotoTimeDialog();
=====================================
modules/gui/qt/dialogs/help/help.cpp
=====================================
@@ -205,6 +205,7 @@ public:
const update_release_t* m_release = nullptr;
UpdateModel::Status m_status = UpdateModel::Unchecked;
+ bool m_explicitCheck = false;
UpdateModel* q_ptr = nullptr;
};
@@ -283,11 +284,18 @@ UpdateModel::~UpdateModel()
update_Delete( d->m_update );
}
-void UpdateModel::checkUpdate()
+void UpdateModel::checkUpdate(bool explicitCheck)
{
Q_D(UpdateModel);
if (d->m_status == Checking)
return;
+
+ if (d->m_explicitCheck != explicitCheck)
+ {
+ d->m_explicitCheck = explicitCheck;
+ emit explicitCheckChanged();
+ }
+
d->m_release = nullptr;
d->m_status = Checking;
emit updateStatusChanged();
@@ -373,6 +381,11 @@ double UpdateModel::getProgress() const
return 0.0;
}
+bool UpdateModel::explicitCheck() const
+{
+ Q_D(const UpdateModel);
+ return d->m_explicitCheck;
+}
/*****************************************************************************
=====================================
modules/gui/qt/dialogs/help/help.hpp
=====================================
@@ -95,12 +95,13 @@ public:
Q_PROPERTY(QString description READ getDescription NOTIFY updateStatusChanged FINAL)
Q_PROPERTY(QString url READ getUrl NOTIFY updateStatusChanged FINAL)
Q_PROPERTY(double progress READ getProgress NOTIFY progressChanged FINAL) // TODO
+ Q_PROPERTY(bool explicitCheck READ explicitCheck NOTIFY explicitCheckChanged FINAL)
public:
explicit UpdateModel(qt_intf_t * p_intf);
~UpdateModel();
- Q_INVOKABLE void checkUpdate();
+ Q_INVOKABLE void checkUpdate(bool explicitCheck = false);
Q_INVOKABLE bool download(QString destDir);
Q_INVOKABLE bool download();
@@ -115,10 +116,12 @@ public:
QString getDescription() const;
QString getUrl() const;
double getProgress() const;
+ bool explicitCheck() const;
signals:
void updateStatusChanged();
void progressChanged();
+ void explicitCheckChanged();
private:
Q_DECLARE_PRIVATE(UpdateModel)
=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -1246,43 +1246,54 @@ UpdateModel* MainCtx::getUpdateModel() const
m_updateModel = std::make_unique<UpdateModel>(p_intf);
connect(m_updateModel.get(), &UpdateModel::updateStatusChanged, this, [this](){
- switch (m_updateModel->updateStatus())
- {
- case UpdateModel::NeedUpdate:
- qWarning() << "Need update";
+ // No-op, modern update pane opens itself automatically when status changes.
+ // However, the old update dialog is used as fallback in case for any reason
+ // the modern pane is not available.
- // No-op, modern update pane opens itself automatically when status changes.
- // However, the old update dialog is used as fallback in case for any reason
- // the modern pane is not available.
+ const auto openLegacyDialogIfNecessary = [&]() {
+ // Fallback:
+ if (Q_LIKELY(p_intf &&
+ p_intf->p_compositor &&
+ p_intf->p_compositor->quickWindow() &&
+ p_intf->p_compositor->quickWindow()->contentItem()))
+ {
+ 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 */))
+ {
+ qDebug("No acknowledgement from the modern update loader, falling back to the old update dialog.");
+ THEDP->updateDialog(DialogsProvider::Show);
+ }
+ }, Qt::QueuedConnection);
+ }
+ else
{
- // Fallback:
-
- if (Q_LIKELY(p_intf &&
- p_intf->p_compositor &&
- p_intf->p_compositor->quickWindow() &&
- p_intf->p_compositor->quickWindow()->contentItem()))
- {
- 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 */))
- {
- qDebug("No acknowledgement from the modern update loader, falling back to the old update dialog.");
- THEDP->updateDialog();
- }
- }, Qt::QueuedConnection);
- }
- else
- {
- qDebug("Compositor is not available, falling back to the old update dialog.");
- THEDP->updateDialog();
- }
+ qDebug("Compositor is not available, falling back to the old update dialog.");
+ THEDP->updateDialog();
}
+ };
- break;
- default:
- break;
+ if (m_updateModel->explicitCheck())
+ {
+ if (m_updateModel->updateStatus() != UpdateModel::Unchecked)
+ openLegacyDialogIfNecessary();
+ }
+ else
+ {
+ switch (m_updateModel->updateStatus())
+ {
+ case UpdateModel::UpToDate:
+ case UpdateModel::Unchecked:
+ case UpdateModel::Checking:
+ break;
+ case UpdateModel::NeedUpdate:
+ qWarning() << "Need update";
+ [[fallthrough]];
+ default:
+ openLegacyDialogIfNecessary();
+ }
}
});
}
=====================================
modules/gui/qt/maininterface/qml/MainDisplay.qml
=====================================
@@ -683,11 +683,29 @@ FocusScope {
anchors.right: parent.right
anchors.bottom: loaderProgress.top
- active: !!UpdateModel && (shouldShow || height > 0.0)
+ readonly property bool updateModelIsAvailable: (typeof UpdateModel !== 'undefined')
+
+ active: updateModelIsAvailable && (shouldShow || height > 0.0)
focus: !!item
- readonly property bool shouldShow: !!UpdateModel && (UpdateModel.updateStatus !== UpdateModel.Unchecked)
+ readonly property bool shouldShow: {
+ if (!updateModelIsAvailable)
+ return false
+
+ if (UpdateModel.explicitCheck) {
+ return (UpdateModel.updateStatus !== UpdateModel.Unchecked)
+ } else {
+ switch (UpdateModel.updateStatus) {
+ case UpdateModel.Unchecked:
+ case UpdateModel.Checking:
+ case UpdateModel.UpToDate:
+ return false
+ default:
+ return true
+ }
+ }
+ }
// This property can be used to enable/disable the animation:
property alias toggleAnimation: heightBehavior.enabled
@@ -702,8 +720,7 @@ FocusScope {
}
onActiveChanged: {
- console.assert(!!UpdateModel)
- if (!active)
+ if (updateModelIsAvailable && !active)
UpdateModel.resetStatus()
}
@@ -773,7 +790,7 @@ FocusScope {
PIPPlayer {
id: playerPip
anchors {
- bottom: miniPlayer.top
+ bottom: loaderUpdatePane.top
left: parent.left
bottomMargin: VLCStyle.margin_normal
leftMargin: VLCStyle.margin_normal + VLCStyle.applicationHorizontalMargin
@@ -788,7 +805,7 @@ FocusScope {
dragXMin: 0
dragXMax: g_mainDisplay.width - playerPip.width
dragYMin: sourcesBanner.y + sourcesBanner.height
- dragYMax: miniPlayer.y - playerPip.height
+ dragYMax: loaderUpdatePane.y - playerPip.height
//keep the player visible on resize
Connections {
=====================================
modules/gui/qt/maininterface/qml/UpdatePane.qml
=====================================
@@ -81,14 +81,16 @@ T.Pane {
switch (UpdateModel.updateStatus) {
case UpdateModel.NeedUpdate:
const extra = UpdateModel.extra
- return qsTr("A new version of VLC (%1.%2.%3%4) is available.").arg(UpdateModel.major)
- .arg(UpdateModel.minor)
- .arg(UpdateModel.revision)
- .arg(extra === 0 ? "" : "." + extra)
+ return qsTr("A new version of VLC is available: <font color=\"%1\">%2.%3.%4%5</font>").arg(theme.fg.neutral)
+ .arg(UpdateModel.major)
+ .arg(UpdateModel.minor)
+ .arg(UpdateModel.revision)
+ .arg(extra === 0 ? "" : "." + extra)
case UpdateModel.UpToDate:
- return qsTr("You have the latest version of VLC media player.")
+ return qsTr("You have the latest version of VLC media player: <font color=\"%1\">%2</font>.").arg(theme.accent)
+ .arg(Application.version)
case UpdateModel.CheckFailed:
- return qsTr("An error occurred while checking for updates...")
+ return qsTr("An <font color=\"%1\">error</font> occurred while checking for updates...").arg(theme.fg.negative)
case UpdateModel.Checking:
return qsTr("Checking for updates...")
default:
=====================================
modules/gui/qt/menus/menus.cpp
=====================================
@@ -560,7 +560,7 @@ void VLCMenuBar::HelpMenu(qt_intf_t *p_intf, QMenu *menu )
{
const auto updateModel = ctx->getUpdateModel();
assert(updateModel);
- updateModel->checkUpdate();
+ updateModel->checkUpdate(true);
}
});
#endif
=====================================
modules/gui/qt/qt.cpp
=====================================
@@ -1117,6 +1117,7 @@ static void *Thread( void *obj )
#endif
app.setApplicationDisplayName( qtr("VLC media player") );
+ app.setApplicationVersion( QString::fromUtf8(VERSION_MESSAGE) );
if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
app.setWindowIcon( QIcon::fromTheme( "vlc-xmas", QIcon( ":/logo/vlc128-xmas.png" ) ) );
=====================================
modules/gui/qt/style/systempalette.cpp
=====================================
@@ -489,13 +489,13 @@ void SystemPalette::makeLightPalette()
setColor(CS, C::Fg, C::Secondary, C::Normal, setColorAlpha(Qt::black, 0.7));
setColor(CS, C::Bg, C::Negative, C::Normal, QColor("#fde7e9")); //FIXME
- setColor(CS, C::Fg, C::Negative, C::Normal, Qt::black); //FIXME
+ setColor(CS, C::Fg, C::Negative, C::Normal, Qt::red);
setColor(CS, C::Bg, C::Neutral, C::Normal, QColor("#e4dab8")); //FIXME
- setColor(CS, C::Fg, C::Neutral, C::Normal, Qt::black); //FIXME
+ setColor(CS, C::Fg, C::Neutral, C::Normal, orange800);
setColor(CS, C::Bg, C::Positive, C::Normal, QColor("#dff6dd")); //FIXME
- setColor(CS, C::Fg, C::Positive, C::Normal, Qt::black); //FIXME
+ setColor(CS, C::Fg, C::Positive, C::Normal, Qt::green);
setColor(CS, C::Decoration, C::VisualFocus, C::Normal, setColorAlpha(Qt::black, 0.0) );
setColor(CS, C::Decoration, C::VisualFocus, C::Focused, Qt::black );
@@ -701,14 +701,14 @@ void SystemPalette::makeDarkPalette()
setColor(CS, C::Fg, C::Secondary, C::Normal, setColorAlpha(Qt::white, 0.6));
- setColor(CS, C::Bg, C::Negative, C::Normal, QColor("#FF99A4")); //FIXME
- setColor(CS, C::Fg, C::Negative, C::Normal, Qt::black); //FIXME
+ setColor(CS, C::Bg, C::Negative, C::Normal, QColor(Qt::darkRed));
+ setColor(CS, C::Fg, C::Negative, C::Normal, Qt::red);
- setColor(CS, C::Bg, C::Neutral, C::Normal, QColor("#FCE100")); //FIXME
- setColor(CS, C::Fg, C::Neutral, C::Normal, Qt::black); //FIXME
+ setColor(CS, C::Bg, C::Neutral, C::Normal, QColor(Qt::darkYellow));
+ setColor(CS, C::Fg, C::Neutral, C::Normal, orange500);
- setColor(CS, C::Bg, C::Positive, C::Normal, QColor("#6CCB5F")); //FIXME
- setColor(CS, C::Fg, C::Positive, C::Normal, Qt::black); //FIXME
+ setColor(CS, C::Bg, C::Positive, C::Normal, QColor(Qt::darkGreen));
+ setColor(CS, C::Fg, C::Positive, C::Normal, Qt::green);
setColor(CS, C::Decoration, C::VisualFocus, C::Normal, setColorAlpha(Qt::white, 0.0) );
setColor(CS, C::Decoration, C::VisualFocus, C::Focused, Qt::white );
=====================================
modules/gui/qt/style/systempalettethemeprovider.cpp
=====================================
@@ -176,20 +176,20 @@ static int updatePalette(vlc_qt_theme_provider_t* obj)
QColor buttonBgNormal = palette.color(QPalette::Normal, QPalette::Button);
buttonBgNormal.setAlpha(0);
- QColor negative("#C42B1C");
+ QColor negative(sys->m_isDark ? QColor(Qt::darkRed) : "#fde7e9");
QColor negativeHover = negative.lighter(110);
QColor negativePressed = negative.lighter(150);
- QColor textOnNegative(Qt::white);
+ QColor textOnNegative(Qt::red);
- QColor neutral("#c6bf00");
+ QColor neutral(sys->m_isDark ? QColor(Qt::darkYellow) : "#e4dab8");
QColor neutralHover = neutral.lighter(110);
QColor neutralPressed = neutral.lighter(150);
- QColor textOnNeutral(Qt::white);
+ QColor textOnNeutral(sys->m_isDark ? "#FF8800" : "#FF610A");
- QColor positive("#0F7B0F");
+ QColor positive(sys->m_isDark ? QColor(Qt::darkGreen) : "#dff6dd");
QColor positiveHover = positive.lighter(110);
QColor positivePressed = positive.lighter(150);
- QColor textOnPositive(Qt::white);
+ QColor textOnPositive(Qt::green);
QColor inputBorderNormal = blendColors(palette.color(QPalette::Normal, QPalette::Base),
palette.color(QPalette::Normal, QPalette::Text));
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f921e50993f30f3ef5ee3673d00d868f198faca2...a7fe8a23ef08fda714aca99ba209ec8c00cfaad1
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/f921e50993f30f3ef5ee3673d00d868f198faca2...a7fe8a23ef08fda714aca99ba209ec8c00cfaad1
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