[vlc-commits] npapi: gtk: Change play/pause icon accordingly

Hugo Beauzée-Luyssen git at videolan.org
Tue Mar 31 10:51:55 CEST 2015


npapi-vlc | branch: cleanup | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Mar 26 15:42:09 2015 +0100| [05d998441458b51ac89606a28a077f449a4c2eda] | committer: Hugo Beauzée-Luyssen

npapi: gtk: Change play/pause icon accordingly

> http://git.videolan.org/gitweb.cgi/npapi-vlc.git/?a=commit;h=05d998441458b51ac89606a28a077f449a4c2eda
---

 npapi/vlcplugin_gtk.cpp |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/npapi/vlcplugin_gtk.cpp b/npapi/vlcplugin_gtk.cpp
index f58638e..ecced4a 100644
--- a/npapi/vlcplugin_gtk.cpp
+++ b/npapi/vlcplugin_gtk.cpp
@@ -463,6 +463,15 @@ bool VlcPluginGtk::create_windows()
     toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_MEDIA_PLAY);
     g_signal_connect(G_OBJECT(toolitem), "clicked", G_CALLBACK(toolbar_handler), this);
     gtk_toolbar_insert(GTK_TOOLBAR(toolbar), toolitem, -1);
+    m_player.get_mp().eventManager().onPaused([this, toolitem]() {
+        gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(toolitem), GTK_STOCK_MEDIA_PLAY);
+    });
+    m_player.get_mp().eventManager().onPlaying([this, toolitem]() {
+        gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(toolitem), GTK_STOCK_MEDIA_PAUSE);
+    });
+    m_player.get_mp().eventManager().onStopped([this, toolitem]() {
+        gtk_tool_button_set_stock_id(GTK_TOOL_BUTTON(toolitem), GTK_STOCK_MEDIA_PLAY);
+    });
     /* stop */
     toolitem = gtk_tool_button_new_from_stock(GTK_STOCK_MEDIA_STOP);
     g_signal_connect(G_OBJECT(toolitem), "clicked", G_CALLBACK(toolbar_handler), this);



More information about the vlc-commits mailing list