Commit bacd06ce authored by Germán Poo-Caamaño's avatar Germán Poo-Caamaño

toolbar: Provide a visual cue when find is unsupported

When document type does not support 'find', Evince disables the
find feature. Previously, we added a tooltip explaining the reason.
However, a straightforward visual cue is more desirable, especially
for touchpad users.

Aside the tooltip, we now also provide an icon that mimic other
icons in GNOME when a service is unavailable, that is, an 'x' on
the icon for mute or wifi.

Fixes #105
parent d3014d8c
......@@ -60,6 +60,7 @@ icons += [['48x48', actions, [], [ev_namespace + '.png']]]
icons += [['256x256', [], [], [ev_namespace + '.png']]]
actions = [
'find-unsupported-symbolic.svg',
'object-rotate-left.svg',
'object-rotate-right.svg',
'outline-symbolic.svg',
......
......@@ -5,6 +5,7 @@ context = actions
iconsdir = $(themedir)/$(size)/$(context)
icons_DATA = \
find-unsupported-symbolic.svg \
object-rotate-left.svg \
object-rotate-right.svg \
outline-symbolic.svg \
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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="16"
height="16"
version="1.1"
id="svg8"
sodipodi:docname="find-unsupported-symbolic.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)">
<metadata
id="metadata14">
<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 />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1920"
inkscape:window-height="1016"
id="namedview10"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
inkscape:zoom="55.879524"
inkscape:cx="5.4683307"
inkscape:cy="6.7834428"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg8">
<sodipodi:guide
position="-6.3050847,14.983051"
orientation="0,1"
id="guide4550"
inkscape:locked="false" />
<sodipodi:guide
position="15.050847,27.661017"
orientation="1,0"
id="guide4552"
inkscape:locked="false" />
<sodipodi:guide
position="3.0508475,1.0169492"
orientation="0,1"
id="guide4554"
inkscape:locked="false" />
<sodipodi:guide
position="1.0169492,12.474576"
orientation="1,0"
id="guide4556"
inkscape:locked="false" />
<sodipodi:guide
position="9.0847458,6.5084746"
orientation="0,1"
id="guide4558"
inkscape:locked="false" />
<sodipodi:guide
position="9.8983051,2.7118644"
orientation="1,0"
id="guide4560"
inkscape:locked="false" />
<sodipodi:guide
position="-0.93640564,6.023366"
orientation="0,1"
id="guide4620"
inkscape:locked="false" />
<sodipodi:guide
position="5.9980578,7.6684029"
orientation="1,0"
id="guide4622"
inkscape:locked="false" />
<sodipodi:guide
position="6.4789147,16.399753"
orientation="1,0"
id="guide4624"
inkscape:locked="false" />
</sodipodi:namedview>
<g
id="g5249">
<path
id="path2"
d="M 6.5078125 1 C 3.4798125 1 1.0019531 3.474 1.0019531 6.5 C 1.0019531 7.5987879 1.3314234 8.623174 1.8925781 9.484375 L 4.6738281 9.484375 A 3.488 3.488 0 0 1 3.0019531 6.5 C 3.0019531 4.556 4.5588125 3 6.5078125 3 A 3.488 3.488 0 0 1 10.013672 6.5 C 10.013672 8.444 8.4558125 10 6.5078125 10 A 3.488 3.488 0 0 1 6.4609375 9.9980469 L 6.4609375 11.998047 C 6.4767243 11.998182 6.4919955 12 6.5078125 12 C 9.5358125 12 12.013672 9.526 12.013672 6.5 C 12.013672 3.474 9.5358125 1 6.5078125 1 z "
style="font-weight:400;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;overflow:visible;isolation:auto;mix-blend-mode:normal;fill:#474747;fill-opacity:1" />
<path
d="m 10,8.99 a 1,1 0 0 0 -0.696,1.717 l 4.004,4 a 1,1 0 1 0 1.414,-1.414 l -4.003,-4 A 1,1 0 0 0 9.999,8.99 Z"
overflow="visible"
style="font-weight:400;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;text-transform:none;text-orientation:mixed;white-space:normal;shape-padding:0;overflow:visible;isolation:auto;mix-blend-mode:normal;fill:#474747;fill-opacity:1"
id="path4"
inkscape:connector-curvature="0" />
<path
sodipodi:nodetypes="ccccccccccccccccc"
d="M 0.99805783,9.976634 H 2.3730578 l 1.125,1.093999 1.094,-1.093999 h 1.406 v 1.468999 l -1.094,1.062 1.094,1.063 v 1.406 h -1.438 l -1.062,-1.063 -1.063,1.063 H 0.99805783 v -1.406 l 1.06199997,-1.063 -1.06199997,-1.061 z"
overflow="visible"
id="path2-3"
inkscape:connector-curvature="0"
style="color:#bebebe;display:inline;overflow:visible;fill:#474747" />
</g>
</svg>
......@@ -34,6 +34,7 @@ typedef struct {
/* Evince stock icons */
static const EvStockIcon stock_icons [] = {
{ EV_STOCK_FIND_UNSUPPORTED, "find-unsupported-symbolic" },
{ EV_STOCK_ZOOM, "zoom" },
{ EV_STOCK_ZOOM_PAGE, "zoom-fit-height" },
{ EV_STOCK_ZOOM_WIDTH, "zoom-fit-width" },
......
......@@ -33,6 +33,7 @@
G_BEGIN_DECLS
/* Evince stock icons */
#define EV_STOCK_FIND_UNSUPPORTED "find-unsupported-symbolic"
#define EV_STOCK_ZOOM "zoom"
#define EV_STOCK_ZOOM_PAGE "zoom-fit-height"
#define EV_STOCK_ZOOM_WIDTH "zoom-fit-width"
......
......@@ -160,12 +160,21 @@ ev_toolbar_find_button_sensitive_changed (GtkWidget *find_button,
GParamSpec *pspec,
EvToolbar *ev_toolbar)
{
if (gtk_widget_is_sensitive (find_button))
GtkWidget *image;
if (gtk_widget_is_sensitive (find_button)) {
gtk_widget_set_tooltip_text (find_button,
_("Find a word or phrase in the document"));
else
image = gtk_image_new_from_icon_name ("edit-find-symbolic",
GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (find_button), image);
} else {
gtk_widget_set_tooltip_text (find_button,
_("Search not available for this document"));
image = gtk_image_new_from_icon_name (EV_STOCK_FIND_UNSUPPORTED,
GTK_ICON_SIZE_MENU);
gtk_button_set_image (GTK_BUTTON (find_button), image);
}
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment