Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (2)
......@@ -27,6 +27,7 @@
# include "config.h"
#endif
#include "qt.hpp"
#include "components/simple_preferences.hpp"
#include "components/preferences_widgets.hpp"
......@@ -771,11 +772,15 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
/* defaults to qt */
ui.qt->setChecked( true );
}
if ( var_InheritBool( p_intf, "qt-dark-palette" ) )
ui.qtdark->setChecked( true ); /*dark palette*/
free( psz_intf );
optionWidgets["skinRB"] = ui.skins;
optionWidgets["qtRB"] = ui.qt;
#if !defined( _WIN32)
ui.stylesCombo->addItem( qtr("System's default") );
ui.stylesCombo->addItems( QStyleFactory::keys() );
ui.stylesCombo->setCurrentIndex( ui.stylesCombo->findText(
......@@ -786,10 +791,7 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
CONNECT( ui.stylesCombo, currentIndexChanged( QString ), this, changeStyle( QString ) );
optionWidgets["styleCB"] = ui.stylesCombo;
#else
ui.stylesCombo->hide();
ui.stylesLabel->hide();
#endif
radioGroup = new QButtonGroup(this);
radioGroup->addButton( ui.qt, 0 );
radioGroup->addButton( ui.skins, 1 );
......@@ -797,6 +799,20 @@ SPrefsPanel::SPrefsPanel( intf_thread_t *_p_intf, QWidget *_parent,
ui.styleStackedWidget, setCurrentIndex( int ) );
ui.styleStackedWidget->setCurrentIndex( radioGroup->checkedId() );
CONFIG_BOOL( "qt-dark-palette", qtdark );
// Connecting the stateChanged signal of the checkbox
connect(ui.qtdark, &QCheckBox::stateChanged, ui.stylesCombo, [combobox = ui.stylesCombo](const int state) {
if (state == Qt::CheckState::Checked) {
// Set the current style to "Fusion"
combobox->setCurrentText(QStringLiteral("Fusion"));
// Apply the dark palette
applyDarkPalette();
} else {
// Remove the custom palette and revert to the default
QApplication::setPalette(QApplication::style()->standardPalette());
}
});
CONNECT( ui.minimalviewBox, toggled( bool ),
ui.mainPreview, setNormalPreview( bool ) );
CONFIG_BOOL( "qt-minimal-view", minimalviewBox );
......
......@@ -30,7 +30,7 @@
#include <QDialogButtonBox>
FirstRun::FirstRun( QWidget *_p, intf_thread_t *_p_intf )
: QWidget( _p ), p_intf( _p_intf )
: QVLCDialog( _p, _p_intf), p_intf( _p_intf )
{
msg_Dbg( p_intf, "Boring first Run Wizard" );
buildPrivDialog();
......
......@@ -22,12 +22,10 @@
*****************************************************************************/
#include "qt.hpp"
#include <QWidget>
#include <QSettings>
#include "util/qvlcframe.hpp"
class QCheckBox;
class FirstRun : public QWidget
class FirstRun : public QVLCDialog
{
Q_OBJECT
public:
......
......@@ -87,12 +87,23 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
setWindowRole( "vlc-about" );
setWindowModality( Qt::WindowModal );
ui.version->setText(qfu( " " VERSION_MESSAGE ) );
ui.title->setText("<html><head/><body><p><span style=\" font-size:26pt; color:#353535;\"> " + qtr( "VLC media player" ) + " </span></p></body></html>");
QString linkColor;
if ( var_InheritBool( p_intf, "qt-dark-palette" ) ) {
ui.horizontalFrame->setStyleSheet("background-color: rgb(10, 10, 10);");
ui.footer->setStyleSheet("background-color: rgb(25, 25, 25);");
linkColor = "#ffa851";
} else {
ui.horizontalFrame->setStyleSheet("background-color: rgb(230, 230, 230);");
ui.footer->setStyleSheet("background-color: rgb(245, 245, 245);");
linkColor = "#0057ae";
}
ui.MainBlabla->setText("<html><head/><body>" +
qtr( "<p>VLC media player is a free and open source media player, encoder, and streamer made by the volunteers of the <a href=\"http://www.videolan.org/\"><span style=\" text-decoration: underline; color:#0057ae;\">VideoLAN</span></a> community.</p><p>VLC uses its internal codecs, works on essentially every popular platform, and can read almost all files, CDs, DVDs, network streams, capture cards and other media formats!</p><p><a href=\"http://www.videolan.org/contribute/\"><span style=\" text-decoration: underline; color:#0057ae;\">Help and join us!</span></a>" ) +
"</p></body> </html>");
ui.version->setText(qfu( " " VERSION_MESSAGE ) );
ui.title->setText("<html><head/><body><p><span style=\" font-size:26pt;\"> " + qtr( "VLC media player" ) + " </span></p></body></html>");
QString translatedString = qtr( "<p>VLC media player is a free and open source media player, encoder, and streamer made by the volunteers of the <a href=\"http://www.videolan.org/\"><span style=\" text-decoration: underline; color:#0057ae;\">VideoLAN</span></a> community.</p><p>VLC uses its internal codecs, works on essentially every popular platform, and can read almost all files, CDs, DVDs, network streams, capture cards and other media formats!</p><p><a href=\"http://www.videolan.org/contribute/\"><span style=\" text-decoration: underline; color:#0057ae;\">Help and join us!</span></a>" );
if ( var_InheritBool( p_intf, "qt-dark-palette" ) )
translatedString.remove(QLatin1String("#0057ae"));
ui.MainBlabla->setText("<html><head/><body>" + translatedString + "</p></body> </html>");
#if 0
if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
......@@ -116,15 +127,17 @@ AboutDialog::AboutDialog( intf_thread_t *_p_intf)
/* People who wrote the software */
ui.authorsPage->setText( qfu( psz_authors ) );
ui.licenseButton->setText( "<html><head/><body><p><span style=\" text-decoration: underline; color:#0057ae;\">"+qtr( "License" )+"</span></p></body></html>");
ui.licenseButton->installEventFilter( this );
ui.authorsButton->setText( "<html><head/><body><p><span style=\" text-decoration: underline; color:#0057ae;\">"+qtr( "Authors" )+"</span></p></body></html>");
ui.authorsButton->installEventFilter( this );
ui.licenseButton->setText(QString("<html><head/><body><p><span style=\" text-decoration: underline; color:%1;\">%2</span></p></body></html>")
.arg(linkColor, qtr("License")));
ui.licenseButton->installEventFilter(this);
ui.creditsButton->setText( "<html><head/><body><p><span style=\" text-decoration: underline; color:#0057ae;\">"+qtr( "Credits" )+"</span></p></body></html>");
ui.creditsButton->installEventFilter( this );
ui.authorsButton->setText(QString("<html><head/><body><p><span style=\" text-decoration: underline; color:%1;\">%2</span></p></body></html>")
.arg(linkColor, qtr("Authors")));
ui.authorsButton->installEventFilter(this);
ui.creditsButton->setText(QString("<html><head/><body><p><span style=\" text-decoration: underline; color:%1;\">%2</span></p></body></html>")
.arg(linkColor, qtr("Credits")));
ui.creditsButton->installEventFilter(this);
ui.version->installEventFilter( this );
}
......
......@@ -121,6 +121,9 @@ static void ShowDialog ( intf_thread_t *, int, int, intf_dialog_args_t * );
#define ERROR_TEXT N_( "Show unimportant error and warnings dialogs" )
#define QT_DARK_TEXT N_( "Applies a dark palette to the style." )
#define QT_DARK_LONGTEXT N_( "Applies a dark palette to the style. Works best with Fusion style." )
#define UPDATER_TEXT N_( "Activate the updates availability notification" )
#define UPDATER_LONGTEXT N_( "Activate the automatic notification of new " \
"versions of the software. It runs once every " \
......@@ -256,6 +259,8 @@ vlc_module_begin ()
RECENTPLAY_FILTER_TEXT, RECENTPLAY_FILTER_LONGTEXT, false )
add_integer( "qt-continue", 1, CONTINUE_PLAYBACK_TEXT, CONTINUE_PLAYBACK_TEXT, false )
change_integer_list(i_continue_list, psz_continue_list_text )
add_bool( "qt-dark-palette", false, QT_DARK_TEXT,
QT_DARK_LONGTEXT, false )
#ifdef UPDATE_CHECK
add_bool( "qt-updates-notif", true, UPDATER_TEXT,
......@@ -403,6 +408,57 @@ static bool HasWayland( void )
}
#endif
bool isDarkPaletteEnabled(intf_thread_t *p_intf) {
static const bool darkPalette = var_InheritBool( p_intf, "qt-dark-palette" );
return darkPalette;
}
void applyDarkPalette() {
QPalette darkPalette;
QColor darkColor("#2d2d2d");
QColor gray("#808080");
QColor lightGray("#aaaaaa");
QColor baseColor("#191919");
// Active group (the currently focused window)
darkPalette.setColor(QPalette::Active, QPalette::Window, darkColor);
darkPalette.setColor(QPalette::Active, QPalette::WindowText, Qt::white);
darkPalette.setColor(QPalette::Active, QPalette::Base, baseColor);
darkPalette.setColor(QPalette::Active, QPalette::AlternateBase, darkColor);
darkPalette.setColor(QPalette::Active, QPalette::Button, darkColor);
darkPalette.setColor(QPalette::Active, QPalette::ButtonText, Qt::white);
darkPalette.setColor(QPalette::Active, QPalette::Text, Qt::white);
darkPalette.setColor(QPalette::Active, QPalette::Highlight, QColor("#2A82DA"));
darkPalette.setColor(QPalette::Active, QPalette::HighlightedText, Qt::white);
darkPalette.setColor(QPalette::Active, QPalette::Link, QColor("#FFA851"));
// Inactive group (unfocused window)
darkPalette.setColor(QPalette::Inactive, QPalette::Window, darkColor);
darkPalette.setColor(QPalette::Inactive, QPalette::WindowText, lightGray);
darkPalette.setColor(QPalette::Inactive, QPalette::Base, baseColor);
darkPalette.setColor(QPalette::Inactive, QPalette::AlternateBase, darkColor);
darkPalette.setColor(QPalette::Inactive, QPalette::Button, darkColor);
darkPalette.setColor(QPalette::Inactive, QPalette::ButtonText, lightGray);
darkPalette.setColor(QPalette::Inactive, QPalette::Text, lightGray);
darkPalette.setColor(QPalette::Inactive, QPalette::Highlight, QColor("#2A82DA"));
darkPalette.setColor(QPalette::Inactive, QPalette::HighlightedText, lightGray);
// Disabled group (grayed-out widgets)
darkPalette.setColor(QPalette::Disabled, QPalette::Window, darkColor);
darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, lightGray);
darkPalette.setColor(QPalette::Disabled, QPalette::Base, baseColor);
darkPalette.setColor(QPalette::Disabled, QPalette::AlternateBase, darkColor);
darkPalette.setColor(QPalette::Disabled, QPalette::Button, lightGray.darker());
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, gray);
darkPalette.setColor(QPalette::Disabled, QPalette::Text, gray);
darkPalette.setColor(QPalette::Disabled, QPalette::Highlight, gray);
darkPalette.setColor(QPalette::Disabled, QPalette::HighlightedText, gray);
darkPalette.setColor(QPalette::Disabled, QPalette::Light, darkColor);
// Apply the dark palette globally
QApplication::setPalette(darkPalette);
}
/* Open Interface */
static int Open( vlc_object_t *p_this, bool isDialogProvider )
{
......@@ -637,9 +693,13 @@ static void *ThreadPlatform( void *obj, char *platform_name )
/* Loads and tries to apply the preferred QStyle */
QString s_style = getSettings()->value( "MainWindow/QtStyle", "" ).toString();
if( s_style.compare("") != 0 )
if (!s_style.isEmpty())
QApplication::setStyle( s_style );
// Apply dark palette only if dark palette is enabled
if (isDarkPaletteEnabled(p_intf))
applyDarkPalette();
/* Launch */
app.exec();
......
......@@ -63,6 +63,9 @@ enum{
NOTIFICATION_ALWAYS = 2,
};
bool isDarkPaletteEnabled(intf_thread_t *);
void applyDarkPalette();
struct intf_sys_t
{
vlc_thread_t thread;
......
......@@ -65,10 +65,6 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(245, 245, 245);
color:rgb(0,0,0);</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="2" column="2" rowspan="4">
<widget class="QStackedWidget" name="stackedWidget">
......@@ -288,9 +284,6 @@ margin-bottom: 6px;</string>
<height>60</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: rgb(230, 230, 230);color:rgb(0,0,0);</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="margin">
<number>0</number>
......
......@@ -284,6 +284,13 @@
<item row="11" column="2" colspan="2">
<widget class="QComboBox" name="autoRaiseComboBox"/>
</item>
<item row="4" column="2">
<widget class="QCheckBox" name="qtdark">
<property name="text">
<string>Use a dark palette</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
......@@ -36,6 +36,47 @@
#include "qt.hpp"
#ifdef _WIN32
#include <QLibrary>
#include <QSysInfo>
#include <dwmapi.h>
inline bool setImmersiveDarkModeAttribute(HWND hwnd, bool enable) {
typedef HRESULT(WINAPI *DwmSetWindowAttributeFunc)(HWND, DWORD, LPCVOID, DWORD);
static const auto dwmSetWindowAttributeFunc = []() -> DwmSetWindowAttributeFunc {
if (QSysInfo::windowsVersion() < QSysInfo::WinVersion::WV_WINDOWS10)
return nullptr;
QLibrary dwmapidll("dwmapi");
return reinterpret_cast<DwmSetWindowAttributeFunc>(dwmapidll.resolve("DwmSetWindowAttribute"));
}();
if (!dwmSetWindowAttributeFunc || !hwnd)
return false;
const BOOL pvAttribute = enable ? TRUE : FALSE;
enum Attribute : DWORD {
DWMWA_USE_IMMERSIVE_DARK_MODE = 20,
DWMWA_USE_DARK_MODE_UNDOCUMENTED = 19
};
return SUCCEEDED(dwmSetWindowAttributeFunc(hwnd, Attribute::DWMWA_USE_IMMERSIVE_DARK_MODE, &pvAttribute, sizeof(pvAttribute)))
|| SUCCEEDED(dwmSetWindowAttributeFunc(hwnd, Attribute::DWMWA_USE_DARK_MODE_UNDOCUMENTED, &pvAttribute, sizeof(pvAttribute)));
}
// Overloaded function to apply dark mode to QWidget*
inline bool setImmersiveDarkModeAttribute(QWidget *widget) {
if (widget->isWindow()) {
widget->ensurePolished();
HWND hwnd = (HWND)widget->winId(); // Get native window handle
return setImmersiveDarkModeAttribute(hwnd,true); // Call the HWND version
}
return false;
}
#endif
class QVLCTools
{
public:
......@@ -102,7 +143,12 @@ class QVLCFrame : public QWidget
{
public:
QVLCFrame( intf_thread_t *_p_intf ) : QWidget( NULL ), p_intf( _p_intf )
{};
{
#ifdef Q_OS_WIN
if (isDarkPaletteEnabled(p_intf))
setImmersiveDarkModeAttribute(this);
#endif
};
virtual ~QVLCFrame() {};
void toggleVisible()
......@@ -155,6 +201,10 @@ public:
{
setWindowFlags( Qt::Dialog|Qt::WindowMinMaxButtonsHint|
Qt::WindowSystemMenuHint|Qt::WindowCloseButtonHint );
#ifdef Q_OS_WIN
if (isDarkPaletteEnabled(p_intf))
setImmersiveDarkModeAttribute(this);
#endif
}
virtual ~QVLCDialog() {};
void toggleVisible()
......@@ -191,7 +241,13 @@ protected:
class QVLCMW : public QMainWindow
{
public:
QVLCMW( intf_thread_t *_p_intf ) : QMainWindow( NULL ), p_intf( _p_intf ){}
QVLCMW( intf_thread_t *_p_intf ) : QMainWindow( NULL ), p_intf( _p_intf )
{
#ifdef Q_OS_WIN
if (isDarkPaletteEnabled(p_intf))
setImmersiveDarkModeAttribute(this);
#endif
}
void toggleVisible()
{
if( isVisible() ) hide();
......