diff options
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | embed/mozilla/EphyFind.cpp | 10 | ||||
-rw-r--r-- | src/ephy-find-toolbar.c | 6 | ||||
-rw-r--r-- | src/ephy-window.c | 11 |
4 files changed, 32 insertions, 10 deletions
@@ -1,5 +1,20 @@ 2005-12-07 Christian Persch <chpe@cvs.gnome.org> + * embed/mozilla/EphyFind.cpp: + + Minor code cleanup. + + * src/ephy-find-toolbar.c: (entry_key_press_event_cb), + (ephy_find_toolbar_close): + + Also check for GDK_ISO_Enter. + + * src/ephy-window.c: (sync_tab_address): + + Close the find toolbar when loading a new page. + +2005-12-07 Christian Persch <chpe@cvs.gnome.org> + * embed/ephy-embed.c: (ephy_embed_scroll), (ephy_embed_page_scroll), (ephy_embed_scroll_pixels): * embed/ephy-embed.h: diff --git a/embed/mozilla/EphyFind.cpp b/embed/mozilla/EphyFind.cpp index 1eab78c34..c1625cc8c 100644 --- a/embed/mozilla/EphyFind.cpp +++ b/embed/mozilla/EphyFind.cpp @@ -160,7 +160,7 @@ void EphyFind::SetSelectionAttention (PRBool aAttention) { #ifdef HAVE_TYPEAHEADFIND - if (aAttention && mAttention) return; + if (aAttention == mAttention) return; mAttention = aAttention; @@ -187,12 +187,10 @@ EphyFind::SetSelectionAttention (PRBool aAttention) PRBool hasMore = PR_FALSE; while (NS_SUCCEEDED (enumerator->HasMoreElements (&hasMore)) && hasMore) { nsCOMPtr<nsISupports> element; - nsCOMPtr<nsISelectionDisplay> sd; - enumerator->GetNext (getter_AddRefs (element)); if (!element) continue; - sd = do_GetInterface (element); + nsCOMPtr<nsISelectionDisplay> sd (do_GetInterface (element)); if (!sd) continue; nsCOMPtr<nsISelectionController> controller (do_QueryInterface (sd)); @@ -270,7 +268,7 @@ EphyFind::ActivateLink (GdkModifierType aMask) nsCOMPtr<nsIDOMElement> link; #if defined(HAVE_TYPEAHEADFIND) && defined(HAVE_GECKO_1_8) rv = mFinder->GetFoundLink (getter_AddRefs (link)); - NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && link, FALSE); + if (NS_FAILED (rv) || !link) return FALSE; #else nsCOMPtr<nsIWebBrowserFocus> focus (do_QueryInterface (mWebBrowser)); NS_ENSURE_TRUE (focus, FALSE); @@ -279,6 +277,7 @@ EphyFind::ActivateLink (GdkModifierType aMask) NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && link, FALSE); /* ensure this is really a link so we don't accidentally submit if we're on a button or so! */ + /* FIXME: does that work with xlink links? */ nsCOMPtr<nsIDOMHTMLAnchorElement> anchor (do_QueryInterface (link)); if (!anchor) return FALSE; #endif /* HAVE_TYPEAHEADFIND && HAVE_GECKO_1_8 */ @@ -311,6 +310,7 @@ EphyFind::ActivateLink (GdkModifierType aMask) (aMask & GDK_CONTROL_MASK) != 0, (aMask & GDK_MOD1_MASK) != 0 /* Alt */, (aMask & GDK_SHIFT_MASK) != 0, + /* FIXME when we upgrade to gtk 2.10 */ PR_FALSE /* Meta */, nsIDOMKeyEvent::DOM_VK_RETURN, 0); diff --git a/src/ephy-find-toolbar.c b/src/ephy-find-toolbar.c index f1632bfe8..d20aa8a2c 100644 --- a/src/ephy-find-toolbar.c +++ b/src/ephy-find-toolbar.c @@ -278,7 +278,9 @@ entry_key_press_event_cb (GtkEntry *entry, } } else if ((event->state & mask) == GDK_CONTROL_MASK && - (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter)) + (event->keyval == GDK_Return || + event->keyval == GDK_KP_Enter || + event->keyval == GDK_ISO_Enter)) { handled = ephy_embed_find_activate_link (get_find (toolbar), event->state); } @@ -690,7 +692,7 @@ ephy_find_toolbar_close (EphyFindToolbar *toolbar) gtk_widget_hide (GTK_WIDGET (toolbar)); - if (priv->embed == NULL) return; + if (priv->embed == NULL || priv->find == NULL) return; ephy_embed_find_set_selection (get_find (toolbar), FALSE); } diff --git a/src/ephy-window.c b/src/ephy-window.c index 6f64ff023..87cb491f8 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -1300,13 +1300,18 @@ setup_ui_manager (EphyWindow *window) } static void -sync_tab_address (EphyTab *tab, GParamSpec *pspec, EphyWindow *window) +sync_tab_address (EphyTab *tab, + GParamSpec *pspec, + EphyWindow *window) { - if (window->priv->closing) return; + EphyWindowPrivate *priv = window->priv; + + if (priv->closing) return; - ephy_toolbar_set_location (window->priv->toolbar, + ephy_toolbar_set_location (priv->toolbar, ephy_tab_get_address (tab), ephy_tab_get_typed_address (tab)); + ephy_find_toolbar_request_close (priv->find_toolbar); } static void |