[totem] Add view-sidebar icon from Hylke Bons
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [totem] Add view-sidebar icon from Hylke Bons
- Date: Wed, 18 Aug 2010 16:53:37 +0000 (UTC)
commit 53c48b2363fea334eed04beb0f83500b3a271a2b
Author: Bastien Nocera <hadess hadess net>
Date: Wed Aug 18 17:52:25 2010 +0100
Add view-sidebar icon from Hylke Bons
And remove the arrow.
data/icons/scalable/Makefile.am | 5 +-
data/icons/scalable/view-sidebar-symbolic.svg | 88 +++++++++++++++++++++++++
src/totem-object.c | 18 ++++--
src/totem-sidebar.c | 14 +----
4 files changed, 106 insertions(+), 19 deletions(-)
---
diff --git a/data/icons/scalable/Makefile.am b/data/icons/scalable/Makefile.am
index 2ceb23d..a153c4e 100644
--- a/data/icons/scalable/Makefile.am
+++ b/data/icons/scalable/Makefile.am
@@ -4,4 +4,7 @@ icon_DATA = totem.svg
tvicondir = $(datadir)/icons/hicolor/scalable/devices/
tvicon_DATA = totem-tv.svg
-EXTRA_DIST = $(icon_DATA) $(tvicon_DATA)
+sidebaricondir = $(datadir)/icons/hicolor/scalable/actions/
+sidebaricon_DATA = view-sidebar-symbolic.svg
+
+EXTRA_DIST = $(icon_DATA) $(tvicon_DATA) $(sidebaricon_DATA)
diff --git a/data/icons/scalable/view-sidebar-symbolic.svg b/data/icons/scalable/view-sidebar-symbolic.svg
new file mode 100644
index 0000000..d857d4f
--- /dev/null
+++ b/data/icons/scalable/view-sidebar-symbolic.svg
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16px"
+ height="16px"
+ id="svg2827"
+ version="1.1"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="New document 3">
+ <defs
+ id="defs2829">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 8 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="16 : 8 : 1"
+ inkscape:persp3d-origin="8 : 5.3333333 : 1"
+ id="perspective2835" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.6568542"
+ inkscape:cx="8"
+ inkscape:cy="8"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:grid-bbox="true"
+ inkscape:document-units="px"
+ inkscape:window-width="1440"
+ inkscape:window-height="845"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2837" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata2832">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ id="layer1"
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer">
+ <path
+ style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="M 2,2 14,2"
+ id="path2839"
+ sodipodi:nodetypes="cc" />
+ <path
+ id="path3613"
+ d="M 2,6 14,6"
+ style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ d="m 2,10 12,0"
+ id="path3615"
+ sodipodi:nodetypes="cc" />
+ <path
+ id="path3617"
+ d="m 2,14 12,0"
+ style="fill:none;stroke:#2e3436;stroke-width:2;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ sodipodi:nodetypes="cc" />
+ </g>
+</svg>
diff --git a/src/totem-object.c b/src/totem-object.c
index ba8e31e..9688c3e 100644
--- a/src/totem-object.c
+++ b/src/totem-object.c
@@ -4012,7 +4012,8 @@ totem_setup_window (TotemObject *totem)
void
totem_callback_connect (TotemObject *totem)
{
- GtkWidget *item, *arrow;
+ GtkWidget *item, *image, *label;
+ GIcon *icon;
GtkAction *action;
GtkActionGroup *action_group;
GtkBox *box;
@@ -4076,10 +4077,17 @@ totem_callback_connect (TotemObject *totem)
action = gtk_action_group_get_action (totem->main_action_group, "sidebar");
item = gtk_toggle_button_new ();
gtk_activatable_set_related_action (GTK_ACTIVATABLE (item), action);
- arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
- g_object_set_data (G_OBJECT (box), "arrow", arrow);
- gtk_button_set_image_position (GTK_BUTTON (item), GTK_POS_RIGHT);
- gtk_button_set_image (GTK_BUTTON (item), arrow);
+
+ /* Remove the label */
+ label = gtk_bin_get_child (GTK_BIN (item));
+ gtk_widget_destroy (label);
+
+ /* Force add an icon, so it doesn't follow the
+ * gtk-button-images setting */
+ icon = g_themed_icon_new_with_default_fallbacks ("view-sidebar-symbolic");
+ image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON);
+ gtk_widget_show (image);
+ gtk_container_add (GTK_CONTAINER (item), image);
gtk_box_pack_start (box, item, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (item), "drag_data_received",
G_CALLBACK (drop_playlist_cb), totem);
diff --git a/src/totem-sidebar.c b/src/totem-sidebar.c
index 56c5b4d..11c34e2 100644
--- a/src/totem-sidebar.c
+++ b/src/totem-sidebar.c
@@ -63,7 +63,6 @@ void
totem_sidebar_toggle (Totem *totem, gboolean state)
{
GtkAction *action;
- GtkWidget *box, *arrow;
if (gtk_widget_get_visible (GTK_WIDGET (totem->sidebar)) == state)
return;
@@ -78,10 +77,6 @@ totem_sidebar_toggle (Totem *totem, gboolean state)
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), state);
totem_signal_unblock_by_data (G_OBJECT (action), totem);
- box = GTK_WIDGET (gtk_builder_get_object (totem->xml, "tmw_sidebar_button_hbox"));
- arrow = g_object_get_data (G_OBJECT (box), "arrow");
- gtk_arrow_set (GTK_ARROW (arrow), state ? GTK_ARROW_LEFT : GTK_ARROW_RIGHT, GTK_SHADOW_NONE);
-
totem->sidebar_shown = state;
cb_resize(totem);
}
@@ -167,15 +162,8 @@ totem_sidebar_setup (Totem *totem, gboolean visible, const char *page_id)
gtk_widget_show_all (totem->sidebar);
gtk_widget_realize (totem->sidebar);
- if (!visible) {
+ if (!visible)
gtk_widget_hide (totem->sidebar);
- } else {
- GtkWidget *box, *arrow;
-
- box = GTK_WIDGET (gtk_builder_get_object (totem->xml, "tmw_sidebar_button_hbox"));
- arrow = g_object_get_data (G_OBJECT (box), "arrow");
- gtk_arrow_set (GTK_ARROW (arrow), GTK_ARROW_LEFT, GTK_SHADOW_NONE);
- }
}
char *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]