summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun McCance <shaunm@gnome.org>2011-04-10 19:26:32 -0400
committerShaun McCance <shaunm@gnome.org>2011-04-10 19:26:32 -0400
commit5184bc6d60044599d7e468156c5a31b6153dba64 (patch)
treee287893e30142307fd8744d698d67294b92bc0f7
parent286300edec254e2bc3c722b6d47ff4f2a1b69ea4 (diff)
downloadyelp-5184bc6d60044599d7e468156c5a31b6153dba64.tar.gz
Don't crash when g-i-t-symbolic not installed, use symbolic properly
-rw-r--r--data/icons/hicolor/scalable/actions/Makefile.am2
-rw-r--r--data/icons/hicolor/scalable/actions/yelp-bookmark-add-symbolic.svg127
-rw-r--r--data/icons/hicolor/scalable/actions/yelp-bookmark-remove-symbolic.svg (renamed from data/icons/hicolor/scalable/actions/yelp-bookmark-symbolic.svg)17
-rw-r--r--libyelp/yelp-docbook-document.c2
-rw-r--r--libyelp/yelp-document.c4
-rw-r--r--libyelp/yelp-location-entry.c145
-rw-r--r--libyelp/yelp-mallard-document.c12
-rw-r--r--libyelp/yelp-settings.c129
-rw-r--r--libyelp/yelp-settings.h4
-rw-r--r--libyelp/yelp-view.c2
-rw-r--r--src/yelp-window.c2
11 files changed, 200 insertions, 246 deletions
diff --git a/data/icons/hicolor/scalable/actions/Makefile.am b/data/icons/hicolor/scalable/actions/Makefile.am
index c53189a5..57a337b8 100644
--- a/data/icons/hicolor/scalable/actions/Makefile.am
+++ b/data/icons/hicolor/scalable/actions/Makefile.am
@@ -1,5 +1,5 @@
icondir = $(datadir)/yelp/icons/hicolor/scalable/actions
-icon_DATA = yelp-bookmark-symbolic.svg
+icon_DATA = yelp-bookmark-add-symbolic.svg yelp-bookmark-remove-symbolic.svg
EXTRA_DIST = $(icon_DATA)
diff --git a/data/icons/hicolor/scalable/actions/yelp-bookmark-add-symbolic.svg b/data/icons/hicolor/scalable/actions/yelp-bookmark-add-symbolic.svg
new file mode 100644
index 00000000..a72ef50a
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/yelp-bookmark-add-symbolic.svg
@@ -0,0 +1,127 @@
+<?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"
+ id="svg7384"
+ version="1.1"
+ inkscape:version="0.48.0 r9654"
+ height="16"
+ sodipodi:docname="user-bookmarks-symbolic.svg"
+ width="16">
+ <metadata
+ id="metadata90">
+ <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>Gnome Symbolic Icon Theme</dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <sodipodi:namedview
+ inkscape:cy="8.5334717"
+ inkscape:current-layer="layer13"
+ inkscape:window-width="1502"
+ pagecolor="#555753"
+ showborder="false"
+ showguides="true"
+ inkscape:snap-nodes="false"
+ objecttolerance="10"
+ showgrid="false"
+ inkscape:object-nodes="true"
+ inkscape:pageshadow="2"
+ inkscape:guide-bbox="true"
+ inkscape:window-x="52"
+ inkscape:snap-bbox="true"
+ bordercolor="#666666"
+ id="namedview88"
+ inkscape:window-maximized="0"
+ inkscape:snap-global="true"
+ inkscape:window-y="25"
+ gridtolerance="10"
+ inkscape:zoom="45.254834"
+ inkscape:window-height="957"
+ borderopacity="1"
+ guidetolerance="10"
+ inkscape:cx="9.2503058"
+ inkscape:bbox-paths="false"
+ inkscape:snap-grids="true"
+ inkscape:pageopacity="1"
+ inkscape:snap-to-guides="true">
+ <inkscape:grid
+ visible="true"
+ spacingx="1px"
+ type="xygrid"
+ spacingy="1px"
+ id="grid4866"
+ empspacing="2"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <title
+ id="title9167">Gnome Symbolic Icon Theme</title>
+ <defs
+ id="defs7386" />
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="layer9"
+ inkscape:label="status"
+ style="display:inline" />
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="layer10"
+ inkscape:label="devices" />
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="layer11"
+ inkscape:label="apps" />
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="layer12"
+ inkscape:label="actions" />
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="layer13"
+ inkscape:label="places">
+ <g
+ transform="translate(294.0002,-820)"
+ id="g11910"
+ inkscape:label="folder-remote" />
+ <path
+ style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#babdb6;fill-opacity:1;stroke:none;stroke-width:0.95488404999999998;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
+ d="m 530.00474,176.18698 c -0.27249,-0.001 -0.51142,0.15025 -0.68478,0.30025 -0.17335,0.15 -0.30149,0.32965 -0.42107,0.52715 -0.23917,0.395 -0.42432,0.86102 -0.61061,1.34691 -0.18629,0.4859 -0.37373,0.99085 -0.5449,1.3791 -0.17116,0.38825 -0.35613,0.63535 -0.38725,0.65777 -0.031,0.0223 -0.3617,0.13095 -0.78405,0.17017 -0.42235,0.0392 -0.95236,0.0551 -1.4721,0.0777 -0.51973,0.0226 -1.02097,0.0743 -1.47127,0.17588 -0.22516,0.0508 -0.45543,0.11764 -0.6526,0.23452 -0.19718,0.11689 -0.40104,0.30159 -0.48625,0.56042 -0.0852,0.25883 -0.0177,0.50818 0.0714,0.71941 0.0891,0.21123 0.214,0.4113 0.36488,0.58606 0.30176,0.34953 0.68383,0.67818 1.08838,1.0055 0.40455,0.32732 0.83666,0.62403 1.15301,0.90678 0.31635,0.28275 0.51709,0.5809 0.52878,0.61742 0.0116,0.0363 0.002,0.37243 -0.0916,0.78623 -0.0932,0.41379 -0.24189,0.90917 -0.381,1.41046 -0.1391,0.50128 -0.27245,1.01571 -0.31499,1.47536 -0.0213,0.22983 -0.0121,0.4306 0.0382,0.65424 0.0502,0.22363 0.14559,0.49048 0.36542,0.65151 0.21984,0.16102 0.49291,0.17709 0.72132,0.15763 0.22842,-0.0195 0.44031,-0.0796 0.65315,-0.16907 0.42567,-0.17899 0.86671,-0.44725 1.30302,-0.73086 0.43632,-0.2836 0.87035,-0.58226 1.23703,-0.79575 0.36668,-0.2135 0.71187,-0.30096 0.75023,-0.3008 0.0382,1.6e-4 0.35794,0.10475 0.72268,0.32126 0.36474,0.21652 0.78361,0.48812 1.21738,0.77534 0.43376,0.28721 0.85882,0.59228 1.28282,0.77478 0.21201,0.0913 0.42765,0.13685 0.65587,0.15818 0.22822,0.0213 0.49752,-0.0103 0.7186,-0.16962 0.22107,-0.15931 0.33545,-0.4018 0.38753,-0.62505 0.0521,-0.22325 0.0793,-0.42498 0.06,-0.65505 -0.0387,-0.46015 -0.17189,-0.9676 -0.30679,-1.47019 -0.13489,-0.50259 -0.28222,-1.02222 -0.37196,-1.43692 -0.0897,-0.4147 -0.084,-0.74843 -0.072,-0.78486 0.0119,-0.0362 0.20008,-0.31344 0.51871,-0.59342 0.31863,-0.27997 0.73057,-0.60206 1.13776,-0.92584 0.40719,-0.32378 0.79989,-0.64416 1.10449,-0.99102 0.1523,-0.17343 0.29725,-0.34915 0.38807,-0.5596 0.0908,-0.21045 0.14239,-0.49374 0.0592,-0.75323 -0.0832,-0.25948 -0.26655,-0.43399 -0.46279,-0.55252 -0.19623,-0.11852 -0.43189,-0.20365 -0.65668,-0.25635 -0.44958,-0.1054 -0.95433,-0.12435 -1.47401,-0.15137 -0.51967,-0.027 -1.05131,-0.0431 -1.47345,-0.0859 -0.42214,-0.0428 -0.72338,-0.16741 -0.75432,-0.19009 -0.0308,-0.0225 -0.26334,-0.29414 -0.43115,-0.68369 -0.16781,-0.38956 -0.32022,-0.88307 -0.50232,-1.37038 -0.1821,-0.48731 -0.36474,-0.97269 -0.6005,-1.36956 -0.11787,-0.19844 -0.25769,-0.36866 -0.42978,-0.52007 -0.16518,-0.1453 -0.39812,-0.27852 -0.65696,-0.28908 l -0.0327,2.7e-4 z m 0.008,1.01449 c -0.0225,-8e-5 -0.0186,-0.0129 0.033,0.0325 0.0515,0.0453 0.11362,0.14949 0.19881,0.2929 0.17038,0.28681 0.35708,0.73389 0.53368,1.20648 0.1766,0.47258 0.34536,0.96185 0.53532,1.40283 0.18996,0.44098 0.35665,0.83362 0.72922,1.10667 0.37257,0.27305 0.80145,0.30091 1.27928,0.34936 0.47783,0.0485 1.00221,0.0594 1.50619,0.0856 0.50397,0.0262 0.98536,0.0765 1.31037,0.15274 0.1625,0.0381 0.30217,0.0923 0.36107,0.1279 -8.6e-4,0.003 0.0139,0.001 2.7e-4,0.0327 -0.0272,0.063 -0.0836,0.20355 -0.19363,0.32888 -0.22012,0.25068 -0.61253,0.54531 -1.0074,0.85931 -0.39487,0.31399 -0.80953,0.6419 -1.17021,0.95884 -0.36069,0.31693 -0.66515,0.58259 -0.8097,1.02129 -0.14454,0.43871 -0.0577,0.87205 0.0439,1.34147 0.10157,0.46942 0.24114,0.94951 0.37196,1.43692 0.13082,0.4874 0.24473,0.97419 0.2727,1.30683 0.014,0.16632 0.0186,0.29297 0.003,0.35998 -0.0156,0.067 -0.0179,0.0458 2.8e-4,0.0327 0.0182,-0.0131 0.003,0.007 -0.0655,5.4e-4 -0.0684,-0.006 -0.17486,-0.0295 -0.32807,-0.0954 -0.30643,-0.1319 -0.73047,-0.39918 -1.15111,-0.6777 -0.42065,-0.27852 -0.83776,-0.59541 -1.25065,-0.84051 -0.41289,-0.24509 -0.78547,-0.4459 -1.24737,-0.4478 -0.4619,-0.002 -0.82471,0.22684 -1.23975,0.4685 -0.41505,0.24166 -0.84663,0.521 -1.26976,0.79603 -0.42312,0.27503 -0.83221,0.53466 -1.13994,0.66404 -0.15386,0.0647 -0.2906,0.0953 -0.35916,0.10117 -0.0686,0.006 -0.0508,-0.0129 -0.0327,2.8e-4 0.0181,0.0133 0.0148,0.0343 -2.7e-4,-0.0327 -0.0151,-0.067 -0.0184,-0.19389 -0.003,-0.35998 0.0308,-0.33219 0.11627,-0.79233 0.25118,-1.27846 0.13491,-0.48614 0.30766,-1.00777 0.41317,-1.47619 0.10551,-0.46841 0.19549,-0.86968 0.0546,-1.30956 -0.14093,-0.43988 -0.46876,-0.72033 -0.82685,-1.0404 -0.35809,-0.32006 -0.76123,-0.6548 -1.15356,-0.97222 -0.39233,-0.31743 -0.77097,-0.62274 -0.98911,-0.87542 -0.10908,-0.12634 -0.17207,-0.22949 -0.19881,-0.29289 -0.0267,-0.0634 -0.0263,-0.0864 -0.0333,-0.0652 -0.007,0.0213 0.006,0.0345 0.0655,-5.5e-4 0.0591,-0.035 0.16345,-0.0969 0.32617,-0.13362 0.32543,-0.0734 0.80417,-0.0871 1.30819,-0.10907 0.50403,-0.0219 1.02673,-0.0336 1.50483,-0.078 0.47809,-0.0444 0.89848,-0.10065 1.27329,-0.3706 0.3748,-0.26996 0.54995,-0.64673 0.74369,-1.0862 0.19375,-0.43947 0.36397,-0.94061 0.54462,-1.41182 0.18065,-0.47121 0.37363,-0.89719 0.54653,-1.18275 0.0865,-0.14277 0.17459,-0.25141 0.22662,-0.29643 0.052,-0.045 0.0548,-0.0329 0.0325,-0.033 z"
+ id="path2993"
+ inkscape:connector-curvature="0" />
+ </g>
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="layer14"
+ inkscape:label="mimetypes" />
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="layer15"
+ inkscape:label="emblems"
+ style="display:inline" />
+ <g
+ transform="translate(-522,-176)"
+ inkscape:groupmode="layer"
+ id="g4953"
+ inkscape:label="categories"
+ style="display:inline" />
+</svg>
diff --git a/data/icons/hicolor/scalable/actions/yelp-bookmark-symbolic.svg b/data/icons/hicolor/scalable/actions/yelp-bookmark-remove-symbolic.svg
index c4390334..9d94378b 100644
--- a/data/icons/hicolor/scalable/actions/yelp-bookmark-symbolic.svg
+++ b/data/icons/hicolor/scalable/actions/yelp-bookmark-remove-symbolic.svg
@@ -11,9 +11,9 @@
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg7384"
version="1.1"
- inkscape:version="0.48.0 r9654"
+ inkscape:version="0.48.1 r9760"
height="16"
- sodipodi:docname="user-bookmarks-symbolic.svg"
+ sodipodi:docname="yelp-bookmark-remove-symbolic.svg"
width="16">
<metadata
id="metadata90">
@@ -28,9 +28,9 @@
</rdf:RDF>
</metadata>
<sodipodi:namedview
- inkscape:cy="8.5334717"
+ inkscape:cy="8.3235494"
inkscape:current-layer="layer13"
- inkscape:window-width="1502"
+ inkscape:window-width="1364"
pagecolor="#555753"
showborder="false"
showguides="true"
@@ -40,16 +40,16 @@
inkscape:object-nodes="true"
inkscape:pageshadow="2"
inkscape:guide-bbox="true"
- inkscape:window-x="52"
+ inkscape:window-x="0"
inkscape:snap-bbox="true"
bordercolor="#666666"
id="namedview88"
inkscape:window-maximized="0"
inkscape:snap-global="true"
- inkscape:window-y="25"
+ inkscape:window-y="20"
gridtolerance="10"
inkscape:zoom="45.254834"
- inkscape:window-height="957"
+ inkscape:window-height="715"
borderopacity="1"
guidetolerance="10"
inkscape:cx="9.2503058"
@@ -116,8 +116,7 @@
sodipodi:r1="7.0383992"
sodipodi:arg1="0.95492637"
sodipodi:cx="526.88293"
- class="success"
- style="color:#000000;fill:#fce94f;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="color:#000000;fill:#babdb6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
sodipodi:arg2="1.5829876"
sodipodi:sides="5" />
<path
diff --git a/libyelp/yelp-docbook-document.c b/libyelp/yelp-docbook-document.c
index 2c6b9c13..7b8dc68a 100644
--- a/libyelp/yelp-docbook-document.c
+++ b/libyelp/yelp-docbook-document.c
@@ -956,7 +956,7 @@ docbook_index_chunk (DocbookIndexData *index)
yelp_storage_update (yelp_storage_get_default (),
index->doc_uri, full_uri,
- title, "", "yelp-page",
+ title, "", "yelp-page-symbolic",
body);
if (index->cur->parent->parent == NULL)
yelp_storage_set_root_title (yelp_storage_get_default (),
diff --git a/libyelp/yelp-document.c b/libyelp/yelp-document.c
index e51c1edd..ef7af967 100644
--- a/libyelp/yelp-document.c
+++ b/libyelp/yelp-document.c
@@ -733,7 +733,7 @@ yelp_document_get_page_icon (YelpDocument *document,
g_assert (document != NULL && YELP_IS_DOCUMENT (document));
if (page_id != NULL && g_str_has_prefix (page_id, "search="))
- return g_strdup ("yelp-page-search");
+ return g_strdup ("yelp-page-search-symbolic");
g_mutex_lock (document->priv->mutex);
real = hash_lookup (document->priv->page_ids, page_id);
@@ -745,7 +745,7 @@ yelp_document_get_page_icon (YelpDocument *document,
g_mutex_unlock (document->priv->mutex);
if (ret == NULL)
- ret = g_strdup ("yelp-page");
+ ret = g_strdup ("yelp-page-symbolic");
return ret;
}
diff --git a/libyelp/yelp-location-entry.c b/libyelp/yelp-location-entry.c
index 774af382..f4c1ea02 100644
--- a/libyelp/yelp-location-entry.c
+++ b/libyelp/yelp-location-entry.c
@@ -220,7 +220,6 @@ enum {
COMPLETION_COL_TITLE,
COMPLETION_COL_DESC,
COMPLETION_COL_ICON,
- COMPLETION_COL_PIXBUF,
COMPLETION_COL_PAGE,
COMPLETION_COL_FLAGS
};
@@ -412,7 +411,7 @@ location_entry_constructed (GObject *object)
priv->history = gtk_list_store_new (8,
G_TYPE_STRING, /* title */
G_TYPE_STRING, /* desc */
- G_TYPE_OBJECT, /* icon */
+ G_TYPE_STRING, /* icon */
G_TYPE_STRING, /* uri */
G_TYPE_STRING, /* doc */
G_TYPE_STRING, /* page */
@@ -424,19 +423,16 @@ location_entry_constructed (GObject *object)
object);
g_object_set (object, "model", priv->history, NULL);
if (priv->enable_search) {
- GdkPixbuf *pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "system-search");
gtk_list_store_append (priv->history, &iter);
gtk_list_store_set (priv->history, &iter,
HISTORY_COL_FLAGS, LOCATION_ENTRY_IS_SEPARATOR,
-1);
gtk_list_store_append (priv->history, &iter);
gtk_list_store_set (priv->history, &iter,
- HISTORY_COL_ICON, pixbuf,
+ HISTORY_COL_ICON, "edit-find-symbolic",
HISTORY_COL_TITLE, _("Search..."),
HISTORY_COL_FLAGS, LOCATION_ENTRY_IS_SEARCH,
-1);
- g_object_unref (pixbuf);
}
/* Set up the history drop-down */
@@ -459,7 +455,7 @@ location_entry_constructed (GObject *object)
g_object_set (priv->icon_cell, "yalign", 0.2, NULL);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object),
priv->icon_cell,
- "pixbuf",
+ "icon-name",
HISTORY_COL_ICON,
NULL);
gtk_cell_layout_reorder (GTK_CELL_LAYOUT (object), priv->icon_cell, 0);
@@ -674,15 +670,10 @@ location_entry_start_search (YelpLocationEntry *entry,
if (!priv->enable_search)
return;
if (clear && !priv->search_mode) {
- GtkTreeIter iter;
- gchar *page;
- gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->history), &iter);
- gtk_tree_model_get (GTK_TREE_MODEL (priv->history), &iter,
- HISTORY_COL_PAGE, &page,
- -1);
- if (!(page && g_str_has_prefix (page, "search=")))
+ const gchar *icon = gtk_entry_get_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_PRIMARY);
+ if (!g_str_equal (icon, "folder-saved-search"))
gtk_entry_set_text (GTK_ENTRY (priv->text_entry), "");
- g_free (page);
}
priv->search_mode = TRUE;
location_entry_set_entry (entry, FALSE);
@@ -747,8 +738,8 @@ location_entry_set_completion (YelpLocationEntry *entry,
gtk_cell_layout_reorder (GTK_CELL_LAYOUT (priv->completion), icon_cell, 0);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (priv->completion),
icon_cell,
- "pixbuf",
- COMPLETION_COL_PIXBUF,
+ "icon-name",
+ COMPLETION_COL_ICON,
NULL);
if (priv->bookmarks) {
bookmark_cell = gtk_cell_renderer_pixbuf_new ();
@@ -769,21 +760,15 @@ location_entry_set_entry (YelpLocationEntry *entry, gboolean emit)
GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (entry));
GtkTreePath *path = NULL;
GtkTreeIter iter;
- GdkPixbuf *pixbuf;
+ gchar *icon_name;
if (priv->search_mode) {
- YelpSettings *settings = yelp_settings_get_default ();
- GdkPixbuf *pixbuf;
- pixbuf = yelp_settings_get_icon_pixbuf (settings, "system-search");
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_PRIMARY,
- pixbuf);
- g_object_unref (pixbuf);
- pixbuf = yelp_settings_get_icon_pixbuf (settings, "edit-clear");
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_SECONDARY,
- pixbuf);
- g_object_unref (pixbuf);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_PRIMARY,
+ "edit-find-symbolic");
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ "edit-clear-symbolic");
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (priv->text_entry),
GTK_ENTRY_ICON_SECONDARY,
_("Clear the search text"));
@@ -804,47 +789,38 @@ location_entry_set_entry (YelpLocationEntry *entry, gboolean emit)
gtk_tree_model_get_iter (model, &iter, path);
gtk_tree_model_get (model, &iter,
HISTORY_COL_TITLE, &text,
- HISTORY_COL_ICON, &pixbuf,
+ HISTORY_COL_ICON, &icon_name,
HISTORY_COL_FLAGS, &flags,
HISTORY_COL_DOC, &doc_uri,
HISTORY_COL_PAGE, &page_id,
-1);
if (flags & LOCATION_ENTRY_IS_LOADING) {
- GdkPixbuf *loading = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "image-loading");
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_PRIMARY,
- loading);
- g_object_unref (loading);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_PRIMARY,
+ "image-loading-symbolic");
if (priv->pulse > 0)
g_source_remove (priv->pulse);
priv->pulse = g_timeout_add (80, location_entry_pulse, entry);
}
else {
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_PRIMARY,
- pixbuf);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_PRIMARY,
+ icon_name);
}
- g_object_unref (pixbuf);
if (priv->bookmarks && doc_uri && page_id) {
+ GdkPixbuf *pixbuf;
if (!yelp_bookmarks_is_bookmarked (priv->bookmarks, doc_uri, page_id)) {
- pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "yelp-bookmark-add");
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_SECONDARY,
- pixbuf);
- g_object_unref (pixbuf);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ "yelp-bookmark-add-symbolic");
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (priv->text_entry),
GTK_ENTRY_ICON_SECONDARY,
_("Bookmark this page"));
}
else {
- pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "yelp-bookmark-remove");
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_SECONDARY,
- pixbuf);
- g_object_unref (pixbuf);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ "yelp-bookmark-remove-symbolic");
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (priv->text_entry),
GTK_ENTRY_ICON_SECONDARY,
_("Remove bookmark"));
@@ -1090,13 +1066,13 @@ cell_set_bookmark_icon (GtkCellLayout *layout,
YelpLocationEntryPrivate *priv = GET_PRIV (entry);
if (priv->bookmarks == NULL) {
- g_object_set (cell, "pixbuf", NULL, NULL);
+ g_object_set (cell, "icon-name", NULL, NULL);
return;
}
gtk_tree_model_get (model, iter, HISTORY_COL_FLAGS, &flags, -1);
if (flags & (LOCATION_ENTRY_IS_SEPARATOR | LOCATION_ENTRY_IS_SEARCH)) {
- g_object_set (cell, "pixbuf", NULL, NULL);
+ g_object_set (cell, "icon-name", NULL, NULL);
return;
}
@@ -1105,14 +1081,10 @@ cell_set_bookmark_icon (GtkCellLayout *layout,
HISTORY_COL_PAGE, &page_id,
-1);
if (doc_uri && page_id &&
- yelp_bookmarks_is_bookmarked (priv->bookmarks, doc_uri, page_id)) {
- GdkPixbuf *pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "yelp-bookmark-remove");
- g_object_set (cell, "pixbuf", pixbuf, NULL);
- g_object_unref (pixbuf);
- }
+ yelp_bookmarks_is_bookmarked (priv->bookmarks, doc_uri, page_id))
+ g_object_set (cell, "icon-name", "yelp-bookmark-remove-symbolic", NULL);
else
- g_object_set (cell, "pixbuf", NULL, NULL);
+ g_object_set (cell, "icon-name", NULL, NULL);
g_free (doc_uri);
g_free (page_id);
@@ -1134,15 +1106,10 @@ cell_set_completion_bookmark_icon (GtkCellLayout *layout,
-1);
if (page_id && yelp_bookmarks_is_bookmarked (priv->bookmarks,
- priv->completion_uri, page_id)) {
- GdkPixbuf *pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "yelp-bookmark-remove");
- g_object_set (cell, "pixbuf", pixbuf, NULL);
- g_object_unref (pixbuf);
- }
- else {
- g_object_set (cell, "pixbuf", NULL, NULL);
- }
+ priv->completion_uri, page_id))
+ g_object_set (cell, "icon-name", "yelp-bookmark-remove-symbolic", NULL);
+ else
+ g_object_set (cell, "icon-name", NULL, NULL);
g_free (page_id);
}
@@ -1330,7 +1297,6 @@ view_loaded (YelpView *view,
G_TYPE_STRING, /* title */
G_TYPE_STRING, /* desc */
G_TYPE_STRING, /* icon */
- G_TYPE_OBJECT, /* pixbuf */
G_TYPE_STRING, /* uri */
G_TYPE_INT /* flags */
);
@@ -1344,20 +1310,16 @@ view_loaded (YelpView *view,
for (i = 0; ids[i]; i++) {
GtkTreeIter iter;
gchar *title, *desc, *icon;
- GdkPixbuf *pixbuf;
gtk_list_store_insert (GTK_LIST_STORE (base), &iter, 0);
title = yelp_document_get_page_title (document, ids[i]);
desc = yelp_document_get_page_desc (document, ids[i]);
icon = yelp_document_get_page_icon (document, ids[i]);
- pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (), icon);
gtk_list_store_set (base, &iter,
COMPLETION_COL_TITLE, title,
COMPLETION_COL_DESC, desc,
COMPLETION_COL_ICON, icon,
- COMPLETION_COL_PIXBUF, pixbuf,
COMPLETION_COL_PAGE, ids[i],
-1);
- g_object_unref (pixbuf);
g_free (icon);
g_free (desc);
g_free (title);
@@ -1414,17 +1376,13 @@ view_uri_selected (YelpView *view,
else {
gint num;
GtkTreeIter last;
- GdkPixbuf *pixbuf;
- pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "help-contents");
gtk_list_store_prepend (priv->history, &iter);
gtk_list_store_set (priv->history, &iter,
HISTORY_COL_TITLE, _("Loading"),
- HISTORY_COL_ICON, pixbuf,
+ HISTORY_COL_ICON, "help-contents",
HISTORY_COL_URI, struri,
HISTORY_COL_FLAGS, LOCATION_ENTRY_IS_LOADING,
-1);
- g_object_unref (pixbuf);
/* Limit to 15 entries. There are two extra for the search entry and
* the separator above it.
*/
@@ -1516,20 +1474,16 @@ view_page_icon (YelpView *view,
{
GtkTreeIter first;
gchar *icon;
- GdkPixbuf *pixbuf;
YelpLocationEntryPrivate *priv = GET_PRIV (entry);
g_object_get (view, "page-icon", &icon, NULL);
if (icon == NULL)
return;
- pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (), icon);
-
if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->history), &first))
gtk_list_store_set (priv->history, &first,
- HISTORY_COL_ICON, pixbuf,
+ HISTORY_COL_ICON, icon,
-1);
- g_object_unref (pixbuf);
g_free (icon);
}
@@ -1553,25 +1507,18 @@ bookmarks_changed (YelpBookmarks *bookmarks,
HISTORY_COL_PAGE, &page_id,
-1);
if (this_uri && g_str_equal (this_uri, doc_uri) && page_id) {
- GdkPixbuf *pixbuf;
if (!yelp_bookmarks_is_bookmarked (priv->bookmarks, doc_uri, page_id)) {
- pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "yelp-bookmark-add");
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_SECONDARY,
- pixbuf);
- g_object_unref (pixbuf);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ "yelp-bookmark-add-symbolic");
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (priv->text_entry),
GTK_ENTRY_ICON_SECONDARY,
_("Bookmark this page"));
}
else {
- pixbuf = yelp_settings_get_icon_pixbuf (yelp_settings_get_default (),
- "yelp-bookmark-remove");
- gtk_entry_set_icon_from_pixbuf (GTK_ENTRY (priv->text_entry),
- GTK_ENTRY_ICON_SECONDARY,
- pixbuf);
- g_object_unref (pixbuf);
+ gtk_entry_set_icon_from_icon_name (GTK_ENTRY (priv->text_entry),
+ GTK_ENTRY_ICON_SECONDARY,
+ "yelp-bookmark-remove-symbolic");
gtk_entry_set_icon_tooltip_text (GTK_ENTRY (priv->text_entry),
GTK_ENTRY_ICON_SECONDARY,
_("Remove bookmark"));
diff --git a/libyelp/yelp-mallard-document.c b/libyelp/yelp-mallard-document.c
index 89884a6b..6b21e5d3 100644
--- a/libyelp/yelp-mallard-document.c
+++ b/libyelp/yelp-mallard-document.c
@@ -804,30 +804,30 @@ xml_node_get_icon (xmlNodePtr node)
{
xmlChar *style;
gchar **styles;
- gchar *icon = "yelp-page";
+ gchar *icon = "yelp-page-symbolic";
style = xmlGetProp (node, BAD_CAST "style");
if (style) {
gint i;
styles = g_strsplit (style, " ", -1);
for (i = 0; styles[i] != NULL; i++) {
if (g_str_equal (styles[i], "video")) {
- icon = "yelp-page-video";
+ icon = "yelp-page-video-symbolic";
break;
}
else if (g_str_equal (styles[i], "task")) {
- icon = "yelp-page-task";
+ icon = "yelp-page-task-symbolic";
break;
}
else if (g_str_equal (styles[i], "tip")) {
- icon = "yelp-page-tip";
+ icon = "yelp-page-tip-symbolic";
break;
}
else if (g_str_equal (styles[i], "problem")) {
- icon = "yelp-page-problem";
+ icon = "yelp-page-problem-symbolic";
break;
}
else if (g_str_equal (styles[i], "ui")) {
- icon = "yelp-page-ui";
+ icon = "yelp-page-ui-symbolic";
break;
}
}
diff --git a/libyelp/yelp-settings.c b/libyelp/yelp-settings.c
index 17ce819a..af911af7 100644
--- a/libyelp/yelp-settings.c
+++ b/libyelp/yelp-settings.c
@@ -40,8 +40,6 @@ struct _YelpSettingsPriv {
gchar *icons[YELP_SETTINGS_NUM_ICONS];
gint icon_size;
- GHashTable *pixbufs;
-
GtkSettings *gtk_settings;
GtkIconTheme *gtk_icon_theme;
@@ -229,9 +227,6 @@ yelp_settings_init (YelpSettings *settings)
settings->priv->mutex = g_mutex_new ();
settings->priv->icon_size = 24;
- settings->priv->pixbufs = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, g_object_unref);
-
for (i = 0; i < YELP_SETTINGS_NUM_ICONS; i++)
settings->priv->icons[i] = NULL;
for (i = 0; i < YELP_SETTINGS_NUM_FONTS; i++) {
@@ -248,11 +243,6 @@ yelp_settings_dispose (GObject *object)
{
YelpSettings *settings = YELP_SETTINGS (object);
- if (settings->priv->pixbufs != NULL) {
- g_hash_table_destroy (settings->priv->pixbufs);
- settings->priv->pixbufs;
- }
-
G_OBJECT_CLASS (yelp_settings_parent_class)->dispose (object);
}
@@ -690,20 +680,6 @@ yelp_settings_get_icon_param (YelpSettingsIcon icon)
/******************************************************************************/
-GdkPixbuf *
-yelp_settings_get_icon_pixbuf (YelpSettings *settings,
- const gchar *icon_name)
-{
- GdkPixbuf *pixbuf;
-
- pixbuf = g_hash_table_lookup (settings->priv->pixbufs, icon_name);
- if (pixbuf != NULL)
- return g_object_ref (pixbuf);
-
- return gtk_icon_theme_load_icon (settings->priv->gtk_icon_theme,
- icon_name, 16, 0, NULL);
-}
-
gboolean
yelp_settings_get_show_text_cursor (YelpSettings *settings)
{
@@ -944,12 +920,9 @@ icon_theme_changed (GtkIconTheme *theme,
{
GtkIconInfo *info;
gint i;
- GdkPixbuf *pixbuf;
- GdkRGBA color, base;
g_mutex_lock (settings->priv->mutex);
- /* Set Yelp's note icons */
for (i = 0; i < YELP_SETTINGS_NUM_ICONS; i++) {
if (settings->priv->icons[i] != NULL)
g_free (settings->priv->icons[i]);
@@ -967,94 +940,6 @@ icon_theme_changed (GtkIconTheme *theme,
}
}
- /* Set pixbufs for named icons */
- gdk_rgba_parse (&color, settings->priv->colors[YELP_SETTINGS_COLOR_TEXT_LIGHT]);
- gdk_rgba_parse (&base, settings->priv->colors[YELP_SETTINGS_COLOR_BASE]);
-
- info = gtk_icon_theme_lookup_icon (theme, "edit-clear-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("edit-clear"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "edit-find-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("system-search"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-bookmark-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info,
- &color, &base,
- NULL, NULL, NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-bookmark-add"), pixbuf);
- pixbuf = gtk_icon_info_load_symbolic (info,
- &color, &color,
- NULL, NULL, NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-bookmark-remove"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-page-task-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-task"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-page-tip-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-tip"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-page-video-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-video"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-page-ui-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-ui"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-page-problem-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-problem"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-page-search-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page-search"), pixbuf);
- gtk_icon_info_free (info);
-
- info = gtk_icon_theme_lookup_icon (theme, "yelp-page-symbolic", 16,
- GTK_ICON_LOOKUP_FORCE_SVG);
- pixbuf = gtk_icon_info_load_symbolic (info, &color,
- NULL, NULL, NULL,
- NULL, NULL);
- g_hash_table_replace (settings->priv->pixbufs, g_strdup ("yelp-page"), pixbuf);
- gtk_icon_info_free (info);
-
g_mutex_unlock (settings->priv->mutex);
g_signal_emit (settings, settings_signals[ICONS_CHANGED], 0);
@@ -1065,13 +950,13 @@ yelp_settings_cmp_icons (const gchar *icon1,
const gchar *icon2)
{
static const gchar *icons[] = {
- "yelp-page-search",
- "yelp-page-video",
- "yelp-page-task",
- "yelp-page-tip",
- "yelp-page-problem",
- "yelp-page-ui",
- "yelp-page",
+ "yelp-page-search-symbolic",
+ "yelp-page-video-symbolic",
+ "yelp-page-task-symbolic",
+ "yelp-page-tip-symbolic",
+ "yelp-page-problem-symbolic",
+ "yelp-page-ui-symbolic",
+ "yelp-page-symbolic",
NULL
};
gint i;
diff --git a/libyelp/yelp-settings.h b/libyelp/yelp-settings.h
index c43f10ab..bf6af532 100644
--- a/libyelp/yelp-settings.h
+++ b/libyelp/yelp-settings.h
@@ -24,7 +24,6 @@
#define __YELP_SETTINGS_H__
#include <glib-object.h>
-#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -119,9 +118,6 @@ gchar ** yelp_settings_get_all_params (YelpSettings *sett
gint extra,
gint *end);
-GdkPixbuf * yelp_settings_get_icon_pixbuf (YelpSettings *settings,
- const gchar *icon_name);
-
gboolean yelp_settings_get_show_text_cursor (YelpSettings *settings);
void yelp_settings_set_show_text_cursor (YelpSettings *settings,
gboolean show);
diff --git a/libyelp/yelp-view.c b/libyelp/yelp-view.c
index 92843a3e..79f9b920 100644
--- a/libyelp/yelp-view.c
+++ b/libyelp/yelp-view.c
@@ -504,7 +504,7 @@ yelp_view_get_property (GObject *object,
if (priv->page_icon)
g_value_set_string (value, priv->page_icon);
else
- g_value_set_string (value, "yelp-page");
+ g_value_set_string (value, "yelp-page-symbolic");
break;
case PROP_STATE:
g_value_set_enum (value, priv->state);
diff --git a/src/yelp-window.c b/src/yelp-window.c
index fb299ca7..477c6aa0 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -846,7 +846,7 @@ window_set_bookmarks (YelpWindow *window,
while (g_variant_iter_loop (iter, "(&s&s&s)", &page_id, &icon, &title)) {
YelpMenuEntry *entry = g_new0 (YelpMenuEntry, 1);
entry->page_id = page_id;
- entry->icon = g_strconcat (icon, "-symbolic", NULL);
+ entry->icon = g_strdup (icon);
entry->title = title;
entries = g_slist_insert_sorted (entries, entry, (GCompareFunc) entry_compare);
}