[vlc-devel] commit: HACK for minimalView to go around a Qt bug/feature ( Jean-Baptiste Kempf )
git version control
git at videolan.org
Sat Jul 26 06:19:08 CEST 2008
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Fri Jul 25 21:20:59 2008 -0700| [4917bfb899bf9d93ec1efb737980b2eb69f3125f]
HACK for minimalView to go around a Qt bug/feature
that doesn't update the QAction checked state when QMenu is hidden
Fix #1742
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4917bfb899bf9d93ec1efb737980b2eb69f3125f
---
modules/gui/qt4/main_interface.cpp | 2 ++
modules/gui/qt4/menus.cpp | 5 +++++
modules/gui/qt4/menus.hpp | 4 ++++
3 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/modules/gui/qt4/main_interface.cpp b/modules/gui/qt4/main_interface.cpp
index bc1321b..16f79f5 100644
--- a/modules/gui/qt4/main_interface.cpp
+++ b/modules/gui/qt4/main_interface.cpp
@@ -796,6 +796,8 @@ void MainInterface::undockPlaylist()
void MainInterface::toggleMinimalView()
{
+ /* HACK for minimalView, see menus.cpp */
+ if( !menuBar()->isVisible() ) QVLCMenu::minimalViewAction->toggle();
TOGGLEV( menuBar() );
TOGGLEV( controls );
TOGGLEV( statusBar() );
diff --git a/modules/gui/qt4/menus.cpp b/modules/gui/qt4/menus.cpp
index 8b547c7..dd75e45 100644
--- a/modules/gui/qt4/menus.cpp
+++ b/modules/gui/qt4/menus.cpp
@@ -72,6 +72,10 @@ enum
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
void addDPStaticEntry( QMenu *menu,
const QString text,
@@ -376,6 +380,7 @@ QMenu *QVLCMenu::ToolsMenu( intf_thread_t *p_intf,
action->setCheckable( true );
if( mi->getControlsVisibilityStatus() & CONTROLS_VISIBLE )
action->setChecked( true );
+ minimalViewAction = action; /* HACK for minimalView */
/* FullScreen View */
action = menu->addAction( qtr( "Fullscreen Interface" ), mi,
diff --git a/modules/gui/qt4/menus.hpp b/modules/gui/qt4/menus.hpp
index 0120ded..d1f8f5d 100644
--- a/modules/gui/qt4/menus.hpp
+++ b/modules/gui/qt4/menus.hpp
@@ -28,6 +28,7 @@
#include "qt4.hpp"
#include <QObject>
+#include <QAction>
#include <vector>
/* Folder vs. Directory */
@@ -100,6 +101,9 @@ public:
/* Actions */
static void DoAction( intf_thread_t *, QObject * );
+
+ /* HACK for minimalView */
+ static QAction *minimalViewAction;
private:
/* Generic automenu methods */
static QMenu * Populate( intf_thread_t *, QMenu *current,
More information about the vlc-devel
mailing list