rbatten / gnome-mplayer

Automatically exported from code.google.com/p/gnome-mplayer
GNU General Public License v2.0
0 stars 0 forks source link

Enhacement: Use symbolic icons #607

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The current version 1.0.5 uses a dark theme, which is great. But it still uses 
old(static) icons for the << and  >> and another set(from the applied theme) 
for the play/pause ans stop. It would be great is you use symbolic icons like 
Totem does.

Original issue reported on code.google.com by the.red....@gmail.com on 6 Apr 2012 at 6:08

GoogleCodeExporter commented 8 years ago
All icons should be symbolic in everything from 0.9.9.2 and higher.

Here is the code that loads the buttons..

icon_theme = gtk_icon_theme_get_default();
    image_play = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY, button_size);
    image_stop = gtk_image_new_from_stock(GTK_STOCK_MEDIA_STOP, button_size);
    image_pause = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PAUSE, button_size);
    image_ff = gtk_image_new_from_stock(GTK_STOCK_MEDIA_FORWARD, button_size);
    image_rew = gtk_image_new_from_stock(GTK_STOCK_MEDIA_REWIND, button_size);
    image_prev = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PREVIOUS, button_size);
    image_next = gtk_image_new_from_stock(GTK_STOCK_MEDIA_NEXT, button_size);
    image_menu = gtk_image_new_from_stock(GTK_STOCK_INDEX, button_size);
    image_fs = gtk_image_new_from_stock(GTK_STOCK_FULLSCREEN, button_size);

Original comment by kdeko...@gmail.com on 6 Apr 2012 at 6:13

GoogleCodeExporter commented 8 years ago

Original comment by kdeko...@gmail.com on 6 Apr 2012 at 6:13

GoogleCodeExporter commented 8 years ago
No. It is not using symbolic icons. It's using the stock GTK icons. Look how it 
should look(left).

Original comment by the.red....@gmail.com on 6 Apr 2012 at 6:20

Attachments:

GoogleCodeExporter commented 8 years ago
Also, all the icons should change to the current icon theme.

Original comment by the.red....@gmail.com on 6 Apr 2012 at 6:23

GoogleCodeExporter commented 8 years ago
Can you see if this patch fixes it? I personally didn't notice a difference, 
but the documentation seems to imply that it should work (not that the 
documentation is all that great). I may have to look into the totem code to see 
what they did.

Index: src/gui.c
===================================================================
--- src/gui.c   (revision 2234)
+++ src/gui.c   (working copy)
@@ -7312,7 +7312,17 @@
     gtk_box_pack_start(GTK_BOX(vbox_master), pane, TRUE, TRUE, 0);
     gtk_box_pack_start(GTK_BOX(vbox_master), controls_box, FALSE, FALSE, 0);
     gtk_container_add(GTK_CONTAINER(window), vbox_master);
-    icon_theme = gtk_icon_theme_get_default();
+#ifdef GTK3_ENABLED
+   image_play = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_MEDIA_PLAY, button_size));
+   image_stop = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_MEDIA_STOP, button_size));
+   image_pause = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_MEDIA_PAUSE, button_size));
+   image_ff = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_MEDIA_FORWARD, button_size));
+   image_rew = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_MEDIA_REWIND, button_size));
+   image_prev = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_MEDIA_PREVIOUS, button_size));
+   image_next = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_MEDIA_NEXT, button_size));
+   image_menu = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_INDEX, button_size));
+   image_fs = gtk_image_new_from_pixbuf(gtk_widget_render_icon_pixbuf(window, 
GTK_STOCK_FULLSCREEN, button_size));
+#else  
     image_play = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY, button_size);
     image_stop = gtk_image_new_from_stock(GTK_STOCK_MEDIA_STOP, button_size);
     image_pause = gtk_image_new_from_stock(GTK_STOCK_MEDIA_PAUSE, button_size);
@@ -7322,7 +7332,9 @@
     image_next = gtk_image_new_from_stock(GTK_STOCK_MEDIA_NEXT, button_size);
     image_menu = gtk_image_new_from_stock(GTK_STOCK_INDEX, button_size);
     image_fs = gtk_image_new_from_stock(GTK_STOCK_FULLSCREEN, button_size);
+#endif
     icon_list = NULL;
+    icon_theme = gtk_icon_theme_get_default();
     if (gtk_icon_theme_has_icon(icon_theme, "gnome-mplayer")) {
         pb_icon = gtk_icon_theme_load_icon(icon_theme, "gnome-mplayer", 128, 0, NULL);
         if (pb_icon)

Original comment by kdeko...@gmail.com on 6 Apr 2012 at 7:03

GoogleCodeExporter commented 8 years ago
That patch is wrong. I found the correct thing to do, although I personally 
think it is odd. Anyway, the code in SVN r2237

Original comment by kdeko...@gmail.com on 6 Apr 2012 at 7:37

GoogleCodeExporter commented 8 years ago
Sorry, still not entirely fixed. :/

-The media buttons should be dark when are inactive and no file is loaded (like 
the current fullscreen button).
- The volume icon is still not themed properly.
- The play/pause icons aren't themed properly.(when playing).

Also, maybe unrelated, but I get a lot of 'X is deprecated, use Y instead' 
messages when compiling.

Original comment by the.red....@gmail.com on 6 Apr 2012 at 7:57

Attachments:

GoogleCodeExporter commented 8 years ago
When a video's loaded(pause icon)

Original comment by the.red....@gmail.com on 6 Apr 2012 at 7:58

Attachments:

GoogleCodeExporter commented 8 years ago
play/pause buttons are already fixed.

volume is a GTK bug, as I am just using a GtkVolumeButton and doing nothing to 
that icon. This is part of the unhappiness I have with GTK around this. If I 
say I want the stock button, it should give me the correct button no matter 
what the theme. I believe this is the problem with the volume button. It is 
using stock icons.

I'll look into setting the media buttons being disabled on load.

Original comment by kdeko...@gmail.com on 6 Apr 2012 at 8:05

GoogleCodeExporter commented 8 years ago
In Totem, icons do change if you use a different icon-theme. Including the 
volume icon.

Original comment by the.red....@gmail.com on 6 Apr 2012 at 8:12

GoogleCodeExporter commented 8 years ago
I have fixed the sensitivity settings of the buttons..

I found a property on the GtkVolumeButton that I didn't know existed. So this 
should all be fixed now.

Original comment by kdeko...@gmail.com on 6 Apr 2012 at 8:27

GoogleCodeExporter commented 8 years ago
Yes! Thank you. :)

Original comment by the.red....@gmail.com on 6 Apr 2012 at 8:50