diff options
author | Shaun McCance <shaunm@src.gnome.org> | 2005-01-10 22:02:02 +0000 |
---|---|---|
committer | Shaun McCance <shaunm@src.gnome.org> | 2005-01-10 22:02:02 +0000 |
commit | 806bdc3ceba0a06e9569c2c2ad46cfb8378f522e (patch) | |
tree | 3f4f51d537ca6a3e13bb6f337feadd27301739c3 | |
parent | 45bd6363633bc93281201d7b14ecb233a0a7838c (diff) | |
download | yelp-806bdc3ceba0a06e9569c2c2ad46cfb8378f522e.tar.gz |
- Calling the fromt page Help Topics
* data/toc.xml.in:
* src/yelp-window.c:
- Calling the fromt page Help Topics
* src/yelp-settings.c:
* src/yelp-settings.h:
- Added prev/next page icons
* src/yelp-window.c:
- Did some work on the Find toolbar
* stylesheets/db2html.xsl.in:
- Some navigation bar work
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | data/toc.xml.in | 2 | ||||
-rw-r--r-- | src/yelp-settings.c | 10 | ||||
-rw-r--r-- | src/yelp-settings.h | 2 | ||||
-rw-r--r-- | src/yelp-window.c | 64 | ||||
-rw-r--r-- | stylesheets/db2html.xsl.in | 120 |
6 files changed, 189 insertions, 25 deletions
@@ -1,3 +1,19 @@ +2005-01-10 Shaun McCance <shaunm@gnome.org> + + * data/toc.xml.in: + * src/yelp-window.c: + - Calling the fromt page Help Topics + + * src/yelp-settings.c: + * src/yelp-settings.h: + - Added prev/next page icons + + * src/yelp-window.c: + - Did some work on the Find toolbar + + * stylesheets/db2html.xsl.in: + - Some navigation bar work + 2005-01-09 Shaun McCance <shaunm@gnome.org> * data/yelp.schemas.in: diff --git a/data/toc.xml.in b/data/toc.xml.in index 99d2329a..6ae9897f 100644 --- a/data/toc.xml.in +++ b/data/toc.xml.in @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="toc.xml.in.content/toc.css" type="text/css"?> <toc id="index"> - <_title>Help Contents</_title> + <_title>Help Topics</_title> <toc id="Desktop"> <_title>Desktop</_title> diff --git a/src/yelp-settings.c b/src/yelp-settings.c index 8e7cd7a6..4b420bb5 100644 --- a/src/yelp-settings.c +++ b/src/yelp-settings.c @@ -62,14 +62,16 @@ static const gchar *color_params[YELP_NUM_COLORS] = { "yelp.color.selected0", "yelp.color.selected1", "yelp.color.selected2", - "yelp.color.selected3", + "yelp.color.selected3" }; static const gchar *icon_params[YELP_NUM_ICONS] = { "yelp.icon.blockquote", "yelp.icon.caution", "yelp.icon.important", + "yelp.icon.next", "yelp.icon.note", + "yelp.icon.previous", "yelp.icon.programlisting", "yelp.icon.tip", "yelp.icon.warning" @@ -154,9 +156,15 @@ yelp_settings_init (void) case YELP_ICON_IMPORTANT: icon_names[i] = "yelp-icon-important"; break; + case YELP_ICON_NEXT: + icon_names[i] = "stock_next-page"; + break; case YELP_ICON_NOTE: icon_names[i] = "yelp-icon-note"; break; + case YELP_ICON_PREVIOUS: + icon_names[i] = "stock_previous-page"; + break; case YELP_ICON_PROGRAMLISTING: icon_names[i] = "yelp-watermark-programlisting"; break; diff --git a/src/yelp-settings.h b/src/yelp-settings.h index 864f45d0..4f43245a 100644 --- a/src/yelp-settings.h +++ b/src/yelp-settings.h @@ -68,7 +68,9 @@ typedef enum { YELP_ICON_BLOCKQUOTE = 0, YELP_ICON_CAUTION, YELP_ICON_IMPORTANT, + YELP_ICON_NEXT, YELP_ICON_NOTE, + YELP_ICON_PREVIOUS, YELP_ICON_PROGRAMLISTING, YELP_ICON_TIP, YELP_ICON_WARNING, diff --git a/src/yelp-window.c b/src/yelp-window.c index f8a7dd43..5edd866a 100644 --- a/src/yelp-window.c +++ b/src/yelp-window.c @@ -364,9 +364,9 @@ static GtkActionEntry entries[] = { N_("Show next page in history"), G_CALLBACK (window_go_forward_cb) }, { "GoHome", GTK_STOCK_HOME, - N_("_Home"), - NULL, - N_("Go to home view"), + N_("_Help Topics"), + "<Alt>Home", + N_("Go to the listing of help topics"), G_CALLBACK (window_go_home_cb) }, { "GoPrevious", NULL, N_("_Previous Section"), @@ -976,9 +976,9 @@ window_populate (YelpWindow *window) priv->find_bar = gtk_toolbar_new (); gtk_toolbar_set_style (GTK_TOOLBAR (priv->find_bar), GTK_TOOLBAR_BOTH_HORIZ); window_populate_find (window, priv->find_bar); - gtk_box_pack_start (GTK_BOX (priv->html_pane), - priv->find_bar, - FALSE, FALSE, 0); + gtk_box_pack_end (GTK_BOX (priv->html_pane), + priv->find_bar, + FALSE, FALSE, 0); priv->html_view = yelp_html_new (); g_signal_connect (priv->html_view, @@ -1012,42 +1012,58 @@ window_populate (YelpWindow *window) static void window_populate_find (YelpWindow *window, GtkWidget *find_bar) { + GtkWidget *box; GtkWidget *label; GtkToolItem *item; + GtkWidget *arrow; YelpWindowPriv *priv = window->priv; g_return_if_fail (GTK_IS_TOOLBAR (find_bar)); - label = gtk_label_new_with_mnemonic (_("Fin_d")); - item = gtk_tool_item_new (); - gtk_container_add (GTK_CONTAINER (item), label); - gtk_toolbar_insert (GTK_TOOLBAR (find_bar), item, -1); + box = gtk_hbox_new (FALSE, 0); + label = gtk_label_new_with_mnemonic (_("Find:")); + gtk_box_pack_start (box, label, FALSE, FALSE, 6); priv->find_entry = gtk_entry_new (); g_signal_connect (G_OBJECT (priv->find_entry), "changed", - G_CALLBACK (window_find_entry_changed_cb), window); + G_CALLBACK (window_find_entry_changed_cb), window); + gtk_box_pack_start (box, priv->find_entry, TRUE, TRUE, 0); + item = gtk_tool_item_new (); - gtk_container_add (GTK_CONTAINER (item), priv->find_entry); + gtk_container_add (GTK_CONTAINER (item), box); gtk_toolbar_insert (GTK_TOOLBAR (find_bar), item, -1); gtk_label_set_mnemonic_widget (GTK_LABEL (label), priv->find_entry); - priv->find_next = gtk_tool_button_new_from_stock (GTK_STOCK_FIND); - gtk_tool_item_set_is_important (item, TRUE); + box = gtk_hbox_new (FALSE, 0); + arrow = gtk_arrow_new (GTK_ARROW_RIGHT, GTK_SHADOW_NONE); + label = gtk_label_new_with_mnemonic (_("Find _Next")); + gtk_box_pack_start (GTK_BOX (box), arrow, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0); + priv->find_next = gtk_tool_button_new (box, NULL); g_signal_connect (priv->find_next, "clicked", G_CALLBACK (window_find_clicked_cb), window); gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->find_next, -1); - priv->find_prev = gtk_tool_button_new_from_stock (GTK_STOCK_FIND); - gtk_tool_item_set_is_important (item, TRUE); + box = gtk_hbox_new (FALSE, 0); + arrow = gtk_arrow_new (GTK_ARROW_LEFT, GTK_SHADOW_NONE); + label = gtk_label_new_with_mnemonic (_("Find _Previous")); + gtk_box_pack_start (GTK_BOX (box), arrow, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (box), label, TRUE, TRUE, 0); + priv->find_prev = gtk_tool_button_new (box, NULL); g_signal_connect (priv->find_prev, "clicked", G_CALLBACK (window_find_clicked_cb), window); gtk_toolbar_insert (GTK_TOOLBAR (find_bar), priv->find_prev, -1); + item = gtk_separator_tool_item_new (); + gtk_tool_item_set_expand (item, TRUE); + gtk_separator_tool_item_set_draw (GTK_SEPARATOR_TOOL_ITEM (item), FALSE); + gtk_toolbar_insert (GTK_TOOLBAR (find_bar), item, -1); + item = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE); gtk_tool_item_set_is_important (item, FALSE); g_signal_connect_swapped (item, @@ -1913,6 +1929,7 @@ window_find_cb (GtkAction *action, YelpWindow *window) gtk_widget_show_all (priv->find_bar); gtk_widget_grab_focus (priv->find_entry); + window_find_entry_changed_cb (priv->find_entry, window); } static void @@ -2273,12 +2290,15 @@ window_find_entry_changed_cb (GtkEditable *editable, text = gtk_editable_get_chars (editable, 0, -1); - if (!window_find_action (window, YELP_WINDOW_FIND_NEXT)) { - gtk_widget_set_sensitive (GTK_WIDGET (priv->find_next), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (priv->find_prev), TRUE); - } else { - window_find_buttons_set_sensitive (window, TRUE); - } + if (text == NULL || text[0] == '\0') + window_find_buttons_set_sensitive (window, FALSE); + else + if (!window_find_action (window, YELP_WINDOW_FIND_NEXT)) { + gtk_widget_set_sensitive (GTK_WIDGET (priv->find_next), FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (priv->find_prev), TRUE); + } else { + window_find_buttons_set_sensitive (window, TRUE); + } g_free (text); } diff --git a/stylesheets/db2html.xsl.in b/stylesheets/db2html.xsl.in index cbd46dc1..13f56b28 100644 --- a/stylesheets/db2html.xsl.in +++ b/stylesheets/db2html.xsl.in @@ -10,7 +10,9 @@ <xsl:param name="yelp.icon.blockquote"/> <xsl:param name="yelp.icon.caution"/> <xsl:param name="yelp.icon.important"/> +<xsl:param name="yelp.icon.next"/> <xsl:param name="yelp.icon.note"/> +<xsl:param name="yelp.icon.previous"/> <xsl:param name="yelp.icon.programlisting"/> <xsl:param name="yelp.icon.tip"/> <xsl:param name="yelp.icon.warning"/> @@ -115,7 +117,9 @@ h7 span[class~="title"] { border-bottom: none; } div[class~="admonition"] { color: </xsl:text> - <xsl:value-of select="$yelp.color.base3"/><xsl:text>; } + <xsl:value-of select="$yelp.color.base3"/><xsl:text>; + -moz-border-radius-topleft: 12px; + } div[class~="programlisting"] { background-image: url(</xsl:text> <xsl:value-of select="$yelp.icon.programlisting"/><xsl:text>); @@ -146,7 +150,121 @@ background-image: url("</xsl:text> <xsl:value-of select="$yelp.icon.warning"/><xsl:text>"); } + + div[class~="navbar"] { + margin-top: 2em; + border: solid 1px </xsl:text> + <xsl:value-of select="$yelp.color.selected0"/><xsl:text>; + -moz-border-radius: 6px; + background-color: </xsl:text> + <xsl:value-of select="$yelp.color.base0"/><xsl:text>; + padding: 6px; + display: table; + width: 98%; + } + div[class~="navbar"] a { text-decoration: none; } + div[class~="navbar"] a:hover { text-decoration: underline; } + div[class~="navbar"] img { border: none; vertical-align: middle; } + span[class~="navbar-previous"] { display: table-cell; } + span[class~="navbar-next"] { display: table-cell; text-align: right; } + img[class~="navbar-previous"] { padding-right: 0.5em; } + img[class~="navbar-next"] { padding-left: 0.5em; } </xsl:text> </xsl:template> +<xsl:template name="db2html.division.navbar"> + <xsl:param name="node"/> + <xsl:param name="info"/> + <xsl:param name="depth_of_chunk"> + <xsl:call-template name="db.chunk.depth-of-chunk"> + <xsl:with-param name="node" select="$node"/> + </xsl:call-template> + </xsl:param> + <xsl:param name="prev_id"> + <xsl:choose> + <xsl:when test="$depth_of_chunk = 0"> + <xsl:if test="$info"> + <xsl:value-of select="$db.chunk.info_basename"/> + </xsl:if> + </xsl:when> + <xsl:otherwise> + <xsl:call-template name="db.chunk.chunk-id.axis"> + <xsl:with-param name="node" select="$node"/> + <xsl:with-param name="axis" select="'previous'"/> + <xsl:with-param name="depth_in_chunk" select="0"/> + <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </xsl:param> + <xsl:param name="next_id"> + <xsl:call-template name="db.chunk.chunk-id.axis"> + <xsl:with-param name="node" select="$node"/> + <xsl:with-param name="axis" select="'next'"/> + <xsl:with-param name="depth_in_chunk" select="0"/> + <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/> + </xsl:call-template> + </xsl:param> + <xsl:param name="prev_node" select="key('idkey', $prev_id)"/> + <xsl:param name="next_node" select="key('idkey', $next_id)"/> + <div class="navbar"> + <xsl:if test="$depth_of_chunk = 0 or $prev_node"> + <span class="navbar-previous"> + <a class="navbar-previous"> + <xsl:attribute name="href"> + <xsl:value-of select="concat('#', $prev_id)"/> + </xsl:attribute> + <xsl:choose> + <xsl:when test="$depth_of_chunk = 0"> + <xsl:variable name="label"> + <xsl:call-template name="db.label"> + <xsl:with-param name="node" select="$info"/> + </xsl:call-template> + </xsl:variable> + <xsl:attribute name="title"> + <xsl:value-of select="normalize-space($label)"/> + </xsl:attribute> + <img src="{$yelp.icon.previous}" class="navbar-previous"/> + <xsl:value-of select="$label"/> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="title"> + <xsl:call-template name="db.xref.tooltip"> + <xsl:with-param name="linkend" select="$prev_id"/> + <xsl:with-param name="target" select="$prev_node"/> + </xsl:call-template> + </xsl:attribute> + <img src="{$yelp.icon.previous}" class="navbar-previous"/> + <xsl:call-template name="db.label"> + <xsl:with-param name="node" select="$prev_node"/> + <xsl:with-param name="role" select="'title'"/> + </xsl:call-template> + </xsl:otherwise> + </xsl:choose> + </a> + </span> + </xsl:if> + <xsl:if test="$next_node"> + <span class="navbar-next"> + <a class="navbar-next"> + <xsl:attribute name="href"> + <xsl:value-of select="concat('#', $next_id)"/> + </xsl:attribute> + <xsl:attribute name="title"> + <xsl:call-template name="db.xref.tooltip"> + <xsl:with-param name="linkend" select="$next_id"/> + <xsl:with-param name="target" select="$next_node"/> + </xsl:call-template> + </xsl:attribute> + <xsl:call-template name="db.label"> + <xsl:with-param name="node" select="$next_node"/> + <xsl:with-param name="role" select="'title'"/> + </xsl:call-template> + <img src="{$yelp.icon.next}" class="navbar-next"/> + </a> + </span> + </xsl:if> + </div> +</xsl:template> + </xsl:stylesheet> |