Commit 4917bfb8 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

HACK for minimalView to go around a Qt bug/feature

that doesn't update the QAction checked state when QMenu is hidden

Fix #1742
parent 95e1579e
...@@ -796,6 +796,8 @@ void MainInterface::undockPlaylist() ...@@ -796,6 +796,8 @@ void MainInterface::undockPlaylist()
void MainInterface::toggleMinimalView() void MainInterface::toggleMinimalView()
{ {
/* HACK for minimalView, see menus.cpp */
if( !menuBar()->isVisible() ) QVLCMenu::minimalViewAction->toggle();
TOGGLEV( menuBar() ); TOGGLEV( menuBar() );
TOGGLEV( controls ); TOGGLEV( controls );
TOGGLEV( statusBar() ); TOGGLEV( statusBar() );
......
...@@ -72,6 +72,10 @@ enum ...@@ -72,6 +72,10 @@ enum
static QActionGroup *currentGroup; static QActionGroup *currentGroup;
/* HACK for minimalView to go around a Qt bug/feature
* that doesn't update the QAction checked state when QMenu is hidden */
QAction *QVLCMenu::minimalViewAction = NULL;
// Add static entries to menus // Add static entries to menus
void addDPStaticEntry( QMenu *menu, void addDPStaticEntry( QMenu *menu,
const QString text, const QString text,
...@@ -376,6 +380,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf, ...@@ -376,6 +380,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
action->setCheckable( true ); action->setCheckable( true );
if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE ) if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE )
action->setChecked( true ); action->setChecked( true );
minimalViewAction = action; /* HACK for minimalView */
/* FullScreen View */ /* FullScreen View */
action = menu->addAction( qtr( "Fullscreen Interface" ), mi, action = menu->addAction( qtr( "Fullscreen Interface" ), mi,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "qt4.hpp" #include "qt4.hpp"
#include <QObject> #include <QObject>
#include <QAction>
#include <vector> #include <vector>
/* Folder vs. Directory */ /* Folder vs. Directory */
...@@ -100,6 +101,9 @@ public: ...@@ -100,6 +101,9 @@ public:
/* Actions */ /* Actions */
static void DoAction( intf_thread_t *, QObject * ); static void DoAction( intf_thread_t *, QObject * );
/* HACK for minimalView */
static QAction *minimalViewAction;
private: private:
/* Generic automenu methods */ /* Generic automenu methods */
static QMenu * Populate( intf_thread_t *, QMenu *current, static QMenu * Populate( intf_thread_t *, QMenu *current,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment