[vlc-commits] qt: toogle info panel visibility
Romain Vimont
git at videolan.org
Mon Apr 30 11:54:08 CEST 2018
vlc/vlc-3.0 | branch: master | Romain Vimont <rom1v at videolabs.io> | Wed Apr 18 11:57:41 2018 +0200| [ac96a5f21ea8e5e961b088777c43dd13ad8a7fa6] | committer: Hugo Beauzée-Luyssen
qt: toogle info panel visibility
Make the info button toggle the info panel visibility: if the panel is
already open, clicking on the info button closes it (like the
"adjustments and effects" panel).
Fixes #19767
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
(cherry picked from commit a8ed2d9f047ca133c125505cec96ad260a80dfa6)
Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=ac96a5f21ea8e5e961b088777c43dd13ad8a7fa6
---
modules/gui/qt/dialogs/mediainfo.cpp | 5 +++++
modules/gui/qt/dialogs/mediainfo.hpp | 1 +
modules/gui/qt/dialogs_provider.cpp | 12 ++++++++++--
3 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt/dialogs/mediainfo.cpp b/modules/gui/qt/dialogs/mediainfo.cpp
index 59d4dd6e45..ff658b9ac5 100644
--- a/modules/gui/qt/dialogs/mediainfo.cpp
+++ b/modules/gui/qt/dialogs/mediainfo.cpp
@@ -143,6 +143,11 @@ void MediaInfoDialog::showTab( panel i_tab = META_PANEL )
show();
}
+int MediaInfoDialog::currentTab()
+{
+ return infoTabW->currentIndex();
+}
+
void MediaInfoDialog::saveMeta()
{
MP->saveMeta();
diff --git a/modules/gui/qt/dialogs/mediainfo.hpp b/modules/gui/qt/dialogs/mediainfo.hpp
index 7740208ff7..34a40c316b 100644
--- a/modules/gui/qt/dialogs/mediainfo.hpp
+++ b/modules/gui/qt/dialogs/mediainfo.hpp
@@ -47,6 +47,7 @@ public:
};
void showTab( panel );
+ int currentTab();
#if 0
void setInput( input_item_t * );
#endif
diff --git a/modules/gui/qt/dialogs_provider.cpp b/modules/gui/qt/dialogs_provider.cpp
index 0484af8c59..71315de1cb 100644
--- a/modules/gui/qt/dialogs_provider.cpp
+++ b/modules/gui/qt/dialogs_provider.cpp
@@ -311,12 +311,20 @@ void DialogsProvider::aboutDialog()
void DialogsProvider::mediaInfoDialog()
{
- MediaInfoDialog::getInstance( p_intf )->showTab( MediaInfoDialog::META_PANEL );
+ MediaInfoDialog *dialog = MediaInfoDialog::getInstance( p_intf );
+ if( !dialog->isVisible() || dialog->currentTab() != MediaInfoDialog::META_PANEL )
+ dialog->showTab( MediaInfoDialog::META_PANEL );
+ else
+ dialog->hide();
}
void DialogsProvider::mediaCodecDialog()
{
- MediaInfoDialog::getInstance( p_intf )->showTab( MediaInfoDialog::INFO_PANEL );
+ MediaInfoDialog *dialog = MediaInfoDialog::getInstance( p_intf );
+ if( !dialog->isVisible() || dialog->currentTab() != MediaInfoDialog::INFO_PANEL )
+ dialog->showTab( MediaInfoDialog::INFO_PANEL );
+ else
+ dialog->hide();
}
void DialogsProvider::bookmarksDialog()
More information about the vlc-commits
mailing list