[epiphany] Revert "Move bookmark star to bottom bar in mobile mode"
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] Revert "Move bookmark star to bottom bar in mobile mode"
- Date: Tue, 29 Sep 2020 15:51:41 +0000 (UTC)
commit 7eea3d9f0acc5de71979c4cf0b67ece3956414e3
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Tue Sep 29 10:51:09 2020 -0500
Revert "Move bookmark star to bottom bar in mobile mode"
This reverts commit f79108840b9ff2434032a6412634c966680ea42f.
This introduced a lot of weird bugs. Like a lot. Some of these are
pretty wild. Let's try again later....
lib/ephy-bookmark-states.h | 28 -------
lib/widgets/ephy-location-entry.c | 27 ++-----
lib/widgets/ephy-location-entry.h | 14 ++--
src/bookmarks/ephy-add-bookmark-popover.c | 87 +++++++++-------------
src/bookmarks/ephy-add-bookmark-popover.h | 3 +-
src/ephy-action-bar-end.c | 60 ---------------
src/ephy-action-bar-end.h | 8 --
src/ephy-action-bar.c | 5 --
src/ephy-header-bar.c | 12 +--
src/ephy-window.c | 28 +------
src/ephy-window.h | 4 -
src/resources/ephy-bookmarks-symbolic.svg | 83 +++++++++++++++++++++
src/resources/ephy-library-symbolic.svg | 117 ------------------------------
src/resources/epiphany.gresource.xml | 2 +-
src/resources/gtk/action-bar-end.ui | 22 +-----
15 files changed, 146 insertions(+), 354 deletions(-)
---
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c
index 416575603..4c8ea0a36 100644
--- a/lib/widgets/ephy-location-entry.c
+++ b/lib/widgets/ephy-location-entry.c
@@ -69,7 +69,6 @@ struct _EphyLocationEntry {
gboolean reader_mode_active;
gboolean button_release_is_blocked;
- gboolean mobile_mode;
char *saved_text;
char *jump_tab;
@@ -88,7 +87,6 @@ struct _EphyLocationEntry {
guint original_address : 1;
EphySecurityLevel security_level;
- EphyBookmarkIconState icon_state;
};
static gboolean ephy_location_entry_reset_internal (EphyLocationEntry *,
@@ -1322,8 +1320,8 @@ ephy_location_entry_focus (EphyLocationEntry *entry)
}
void
-ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry *entry,
- EphyBookmarkIconState state)
+ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry *entry,
+ EphyLocationEntryBookmarkIconState state)
{
GtkStyleContext *context;
@@ -1331,18 +1329,13 @@ ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry *entry,
context = gtk_widget_get_style_context (GTK_WIDGET (entry->bookmark));
- entry->icon_state = state;
-
- if (entry->mobile_mode)
- state = EPHY_BOOKMARK_ICON_HIDDEN;
-
switch (state) {
- case EPHY_BOOKMARK_ICON_HIDDEN:
+ case EPHY_LOCATION_ENTRY_BOOKMARK_ICON_HIDDEN:
gtk_widget_set_visible (entry->bookmark_event_box, FALSE);
gtk_style_context_remove_class (context, "starred");
gtk_style_context_remove_class (context, "non-starred");
break;
- case EPHY_BOOKMARK_ICON_EMPTY:
+ case EPHY_LOCATION_ENTRY_BOOKMARK_ICON_EMPTY:
gtk_widget_set_visible (entry->bookmark_event_box, TRUE);
gtk_image_set_from_icon_name (GTK_IMAGE (entry->bookmark),
"non-starred-symbolic",
@@ -1350,7 +1343,7 @@ ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry *entry,
gtk_style_context_remove_class (context, "starred");
gtk_style_context_add_class (context, "non-starred");
break;
- case EPHY_BOOKMARK_ICON_BOOKMARKED:
+ case EPHY_LOCATION_ENTRY_BOOKMARK_ICON_BOOKMARKED:
gtk_widget_set_visible (entry->bookmark_event_box, TRUE);
gtk_image_set_from_icon_name (GTK_IMAGE (entry->bookmark),
"starred-symbolic",
@@ -1504,15 +1497,11 @@ ephy_location_entry_set_progress (EphyLocationEntry *entry,
}
void
-ephy_location_entry_set_mobile_mode (EphyLocationEntry *entry,
- gboolean mobile)
+ephy_location_entry_set_mobile_popdown (EphyLocationEntry *entry,
+ gboolean mobile_popdown)
{
- if (mobile)
+ if (mobile_popdown)
dzl_suggestion_entry_set_position_func (DZL_SUGGESTION_ENTRY (entry->url_entry),
dzl_suggestion_entry_window_position_func, NULL, NULL);
else
dzl_suggestion_entry_set_position_func (DZL_SUGGESTION_ENTRY (entry->url_entry), position_func, NULL,
NULL);
-
-
- entry->mobile_mode = mobile;
- ephy_location_entry_set_bookmark_icon_state (entry, entry->icon_state);
}
diff --git a/lib/widgets/ephy-location-entry.h b/lib/widgets/ephy-location-entry.h
index 96c2de273..fb8074b83 100644
--- a/lib/widgets/ephy-location-entry.h
+++ b/lib/widgets/ephy-location-entry.h
@@ -25,7 +25,6 @@
#include <gtk/gtk.h>
-#include "ephy-bookmark-states.h"
#include "ephy-security-levels.h"
G_BEGIN_DECLS
@@ -34,6 +33,11 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (EphyLocationEntry, ephy_location_entry, EPHY, LOCATION_ENTRY, GtkOverlay)
+typedef enum {
+ EPHY_LOCATION_ENTRY_BOOKMARK_ICON_HIDDEN,
+ EPHY_LOCATION_ENTRY_BOOKMARK_ICON_EMPTY,
+ EPHY_LOCATION_ENTRY_BOOKMARK_ICON_BOOKMARKED
+} EphyLocationEntryBookmarkIconState;
GtkWidget *ephy_location_entry_new (void);
@@ -47,8 +51,8 @@ void ephy_location_entry_undo_reset (EphyLocationEntr
void ephy_location_entry_focus (EphyLocationEntry *entry);
-void ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry *entry,
- EphyBookmarkIconState state);
+void ephy_location_entry_set_bookmark_icon_state (EphyLocationEntry *entry,
+ EphyLocationEntryBookmarkIconState state);
void ephy_location_entry_set_lock_tooltip (EphyLocationEntry *entry,
const char *tooltip);
@@ -76,7 +80,7 @@ void ephy_location_entry_set_progress (EphyLocationEntr
gdouble progress,
gboolean loading);
-void ephy_location_entry_set_mobile_mode (EphyLocationEntry *entry,
- gboolean mobile);
+void ephy_location_entry_set_mobile_popdown (EphyLocationEntry *entry,
+ gboolean mobile_popdown);
G_END_DECLS
diff --git a/src/bookmarks/ephy-add-bookmark-popover.c b/src/bookmarks/ephy-add-bookmark-popover.c
index 3977f486c..1fd476c83 100644
--- a/src/bookmarks/ephy-add-bookmark-popover.c
+++ b/src/bookmarks/ephy-add-bookmark-popover.c
@@ -35,26 +35,17 @@ struct _EphyAddBookmarkPopover {
char *address;
GtkWidget *grid;
- GtkWidget *relative_to;
- GtkWindow *window;
+ EphyHeaderBar *header_bar;
};
G_DEFINE_TYPE (EphyAddBookmarkPopover, ephy_add_bookmark_popover, GTK_TYPE_POPOVER)
enum {
PROP_0,
- PROP_RELATIVE_TO,
- PROP_WINDOW,
+ PROP_HEADER_BAR,
LAST_PROP
};
-enum signalsEnum {
- UPDATE_STATE,
- LAST_SIGNAL
-};
-
-static gint signals[LAST_SIGNAL] = { 0 };
-
static GParamSpec *obj_properties[LAST_PROP];
static void
@@ -66,11 +57,8 @@ ephy_bookmarks_popover_set_property (GObject *object,
EphyAddBookmarkPopover *self = EPHY_ADD_BOOKMARK_POPOVER (object);
switch (prop_id) {
- case PROP_RELATIVE_TO:
- self->relative_to = g_value_get_object (value);
- break;
- case PROP_WINDOW:
- self->window = g_value_get_object (value);
+ case PROP_HEADER_BAR:
+ self->header_bar = g_value_get_object (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -92,10 +80,16 @@ static void
ephy_add_bookmark_popover_constructed (GObject *object)
{
EphyAddBookmarkPopover *self = EPHY_ADD_BOOKMARK_POPOVER (object);
+ GtkWidget *location_entry;
+ GtkWidget *bookmark;
G_OBJECT_CLASS (ephy_add_bookmark_popover_parent_class)->constructed (object);
- gtk_popover_set_relative_to (GTK_POPOVER (self), self->relative_to);
+ location_entry = GTK_WIDGET (ephy_header_bar_get_title_widget (self->header_bar));
+ g_assert (EPHY_IS_LOCATION_ENTRY (location_entry));
+ bookmark = ephy_location_entry_get_bookmark_widget (EPHY_LOCATION_ENTRY (location_entry));
+
+ gtk_popover_set_relative_to (GTK_POPOVER (self), bookmark);
}
static void
@@ -107,34 +101,14 @@ ephy_add_bookmark_popover_class_init (EphyAddBookmarkPopoverClass *klass)
object_class->finalize = ephy_add_bookmark_popover_finalize;
object_class->constructed = ephy_add_bookmark_popover_constructed;
- obj_properties[PROP_RELATIVE_TO] =
- g_param_spec_object ("relative-to",
- "A GtkWidget object",
- "The popover's parent widget",
- GTK_TYPE_WIDGET,
- G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
- obj_properties[PROP_WINDOW] =
- g_param_spec_object ("window",
- "A GtkWidget object",
- "The popover's parent window",
- GTK_TYPE_WIDGET,
+ obj_properties[PROP_HEADER_BAR] =
+ g_param_spec_object ("header-bar",
+ "An EphyHeaderBar object",
+ "The popover's parent EphyHeaderBar",
+ EPHY_TYPE_HEADER_BAR,
G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, LAST_PROP, obj_properties);
-
- /**
- * EphAddBookmarkPopover::update-state:
- * @entry: the object on which the signal is emitted
- *
- * Emitted when the bookmark state changes
- *
- */
- signals[UPDATE_STATE] = g_signal_new ("update-state", G_OBJECT_CLASS_TYPE (klass),
- G_SIGNAL_RUN_FIRST | G_SIGNAL_RUN_LAST,
- 0, NULL, NULL, NULL,
- G_TYPE_NONE,
- 1,
- G_TYPE_INT);
}
static void
@@ -171,12 +145,12 @@ ephy_add_bookmark_popover_init (EphyAddBookmarkPopover *self)
}
GtkWidget *
-ephy_add_bookmark_popover_new (GtkWidget *relative_to,
- GtkWidget *window)
+ephy_add_bookmark_popover_new (EphyHeaderBar *header_bar)
{
+ g_assert (EPHY_IS_HEADER_BAR (header_bar));
+
return g_object_new (EPHY_TYPE_ADD_BOOKMARK_POPOVER,
- "relative-to", relative_to,
- "window", window,
+ "header-bar", header_bar,
NULL);
}
@@ -193,6 +167,8 @@ ephy_add_bookmark_popover_update_bookmarked_status_cb (EphyAddBookmarkPopover *s
EphyBookmark *bookmark,
EphyBookmarksManager *manager)
{
+ GtkWidget *location_entry;
+ EphyWindow *window;
EphyEmbed *embed;
EphyWebView *view;
const char *address;
@@ -201,13 +177,17 @@ ephy_add_bookmark_popover_update_bookmarked_status_cb (EphyAddBookmarkPopover *s
g_assert (EPHY_IS_BOOKMARK (bookmark));
g_assert (EPHY_IS_BOOKMARKS_MANAGER (manager));
- embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (self->window));
+ location_entry = GTK_WIDGET (ephy_header_bar_get_title_widget (self->header_bar));
+ window = ephy_header_bar_get_window (self->header_bar);
+ embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
view = ephy_embed_get_web_view (embed);
address = ephy_web_view_get_address (view);
- if (g_strcmp0 (ephy_bookmark_get_url (bookmark), address) == 0)
- g_signal_emit (self, signals[UPDATE_STATE], 0, EPHY_BOOKMARK_ICON_EMPTY);
+ if (g_strcmp0 (ephy_bookmark_get_url (bookmark), address) == 0) {
+ ephy_location_entry_set_bookmark_icon_state (EPHY_LOCATION_ENTRY (location_entry),
+ EPHY_LOCATION_ENTRY_BOOKMARK_ICON_EMPTY);
+ }
ephy_bookmarks_manager_save (manager,
ephy_bookmarks_manager_save_warn_on_error_cancellable (manager),
@@ -222,11 +202,15 @@ ephy_add_bookmark_popover_show (EphyAddBookmarkPopover *self)
{
EphyBookmarksManager *manager;
EphyBookmark *bookmark;
+ EphyWindow *window;
+ EphyLocationEntry *location_entry;
EphyEmbed *embed;
const char *address;
manager = ephy_shell_get_bookmarks_manager (ephy_shell_get_default ());
- embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (self->window));
+ location_entry = EPHY_LOCATION_ENTRY (ephy_header_bar_get_title_widget (self->header_bar));
+ window = ephy_header_bar_get_window (self->header_bar);
+ embed = ephy_embed_container_get_active_child (EPHY_EMBED_CONTAINER (window));
address = ephy_web_view_get_address (ephy_embed_get_web_view (embed));
@@ -242,7 +226,8 @@ ephy_add_bookmark_popover_show (EphyAddBookmarkPopover *self)
id);
ephy_bookmarks_manager_add_bookmark (manager, new_bookmark);
- g_signal_emit (self, signals[UPDATE_STATE], 0, EPHY_BOOKMARK_ICON_BOOKMARKED);
+ ephy_location_entry_set_bookmark_icon_state (location_entry,
+ EPHY_LOCATION_ENTRY_BOOKMARK_ICON_BOOKMARKED);
bookmark = new_bookmark;
}
diff --git a/src/bookmarks/ephy-add-bookmark-popover.h b/src/bookmarks/ephy-add-bookmark-popover.h
index 3dc5066ca..41d19dee8 100644
--- a/src/bookmarks/ephy-add-bookmark-popover.h
+++ b/src/bookmarks/ephy-add-bookmark-popover.h
@@ -30,8 +30,7 @@ G_BEGIN_DECLS
G_DECLARE_FINAL_TYPE (EphyAddBookmarkPopover, ephy_add_bookmark_popover, EPHY, ADD_BOOKMARK_POPOVER,
GtkPopover)
-GtkWidget *ephy_add_bookmark_popover_new (GtkWidget *relative_to,
- GtkWidget *window);
+GtkWidget *ephy_add_bookmark_popover_new (EphyHeaderBar *header_bar);
void ephy_add_bookmark_popover_show (EphyAddBookmarkPopover *self);
diff --git a/src/ephy-action-bar-end.c b/src/ephy-action-bar-end.c
index 8fee25dec..7775e0ce2 100644
--- a/src/ephy-action-bar-end.c
+++ b/src/ephy-action-bar-end.c
@@ -20,11 +20,9 @@
*/
#include "ephy-action-bar-end.h"
-#include "ephy-add-bookmark-popover.h"
#include "ephy-desktop-utils.h"
#include "ephy-downloads-popover.h"
#include "ephy-downloads-progress-icon.h"
-#include "ephy-location-entry.h"
#include "ephy-shell.h"
#include "ephy-window.h"
@@ -35,8 +33,6 @@
struct _EphyActionBarEnd {
GtkBox parent_instance;
- GtkWidget *bookmark_button;
- GtkWidget *bookmark_image;
GtkWidget *bookmarks_button;
GtkWidget *downloads_revealer;
GtkWidget *downloads_button;
@@ -231,12 +227,6 @@ ephy_action_bar_end_class_init (EphyActionBarEndClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/epiphany/gtk/action-bar-end.ui");
- gtk_widget_class_bind_template_child (widget_class,
- EphyActionBarEnd,
- bookmark_button);
- gtk_widget_class_bind_template_child (widget_class,
- EphyActionBarEnd,
- bookmark_image);
gtk_widget_class_bind_template_child (widget_class,
EphyActionBarEnd,
bookmarks_button);
@@ -254,17 +244,6 @@ ephy_action_bar_end_class_init (EphyActionBarEndClass *klass)
downloads_progress);
}
-static void
-add_bookmark_button_clicked_cb (EphyActionBarEnd *action_bar_end)
-{
- GtkWidget *window = gtk_widget_get_toplevel (GTK_WIDGET (action_bar_end->bookmark_button));
- GtkWidget *popover = ephy_add_bookmark_popover_new (GTK_WIDGET (action_bar_end->bookmark_button), window);
-
- g_signal_connect_object (popover, "update-state", G_CALLBACK (ephy_window_sync_bookmark_state),
action_bar_end, G_CONNECT_SWAPPED);
-
- ephy_add_bookmark_popover_show (EPHY_ADD_BOOKMARK_POPOVER (popover));
-}
-
static void
ephy_action_bar_end_init (EphyActionBarEnd *action_bar_end)
{
@@ -313,10 +292,6 @@ ephy_action_bar_end_init (EphyActionBarEnd *action_bar_end)
g_signal_connect_object (downloads_manager, "show-downloads",
G_CALLBACK (show_downloads_cb),
object, 0);
-
- g_signal_connect_object (action_bar_end->bookmark_button, "clicked",
- G_CALLBACK (add_bookmark_button_clicked_cb), action_bar_end,
- G_CONNECT_SWAPPED);
}
EphyActionBarEnd *
@@ -344,38 +319,3 @@ ephy_action_bar_end_get_downloads_revealer (EphyActionBarEnd *action_bar_end)
{
return action_bar_end->downloads_revealer;
}
-
-void
-ephy_action_bar_end_set_show_bookmark_button (EphyActionBarEnd *action_bar_end,
- gboolean show)
-{
- gtk_widget_set_visible (action_bar_end->bookmark_button, show);
-}
-
-
-void
-ephy_action_bar_end_set_bookmark_icon_state (EphyActionBarEnd *action_bar_end,
- EphyBookmarkIconState state)
-{
- g_assert (EPHY_IS_ACTION_BAR_END (action_bar_end));
-
- switch (state) {
- case EPHY_BOOKMARK_ICON_HIDDEN:
- gtk_widget_set_visible (action_bar_end->bookmark_button, FALSE);
- break;
- case EPHY_BOOKMARK_ICON_EMPTY:
- gtk_widget_set_visible (action_bar_end->bookmark_button, TRUE);
- gtk_image_set_from_icon_name (GTK_IMAGE (action_bar_end->bookmark_image),
- "non-starred-symbolic",
- GTK_ICON_SIZE_BUTTON);
- break;
- case EPHY_BOOKMARK_ICON_BOOKMARKED:
- gtk_widget_set_visible (action_bar_end->bookmark_button, TRUE);
- gtk_image_set_from_icon_name (GTK_IMAGE (action_bar_end->bookmark_image),
- "starred-symbolic",
- GTK_ICON_SIZE_BUTTON);
- break;
- default:
- g_assert_not_reached ();
- }
-}
diff --git a/src/ephy-action-bar-end.h b/src/ephy-action-bar-end.h
index 81bab0b0d..a0d397bc9 100644
--- a/src/ephy-action-bar-end.h
+++ b/src/ephy-action-bar-end.h
@@ -21,8 +21,6 @@
#pragma once
-#include "ephy-bookmark-states.h"
-
#include <gtk/gtk.h>
G_BEGIN_DECLS
@@ -36,10 +34,4 @@ void ephy_action_bar_end_set_show_bookmarks_button (EphyActionBarEn
gboolean show);
GtkWidget *ephy_action_bar_end_get_downloads_revealer (EphyActionBarEnd *action_bar_end);
-void ephy_action_bar_end_set_show_bookmark_button (EphyActionBarEnd *action_bar_end,
- gboolean show);
-
-void ephy_action_bar_end_set_bookmark_icon_state (EphyActionBarEnd *action_bar_end,
- EphyBookmarkIconState state);
-
G_END_DECLS
diff --git a/src/ephy-action-bar.c b/src/ephy-action-bar.c
index a1d89fb56..c28ce6bac 100644
--- a/src/ephy-action-bar.c
+++ b/src/ephy-action-bar.c
@@ -20,8 +20,6 @@
*/
#include "ephy-action-bar.h"
-#include "ephy-add-bookmark-popover.h"
-#include "ephy-location-entry.h"
#include "ephy-pages-button.h"
#include "ephy-pages-popover.h"
#include "ephy-settings.h"
@@ -226,9 +224,6 @@ void
ephy_action_bar_set_adaptive_mode (EphyActionBar *action_bar,
EphyAdaptiveMode adaptive_mode)
{
- ephy_action_bar_end_set_show_bookmark_button (action_bar->action_bar_end,
- adaptive_mode == EPHY_ADAPTIVE_MODE_NARROW);
-
switch (adaptive_mode) {
case EPHY_ADAPTIVE_MODE_NORMAL:
gtk_revealer_set_reveal_child (GTK_REVEALER (action_bar), FALSE);
diff --git a/src/ephy-header-bar.c b/src/ephy-header-bar.c
index c2c9f22bf..a248b0ef9 100644
--- a/src/ephy-header-bar.c
+++ b/src/ephy-header-bar.c
@@ -236,11 +236,8 @@ ephy_header_bar_constructed (GObject *object)
gtk_widget_show (GTK_WIDGET (header_bar->title_widget));
if (EPHY_IS_LOCATION_ENTRY (header_bar->title_widget)) {
- EphyLocationEntry *lentry = EPHY_LOCATION_ENTRY (header_bar->title_widget);
- GtkWidget *popover = ephy_add_bookmark_popover_new (ephy_location_entry_get_bookmark_widget (lentry),
GTK_WIDGET (header_bar->window));
-
- g_signal_connect_object (popover, "update-state", G_CALLBACK (ephy_window_sync_bookmark_state),
header_bar, G_CONNECT_SWAPPED);
- ephy_location_entry_set_add_bookmark_popover (lentry, GTK_POPOVER (popover));
+ ephy_location_entry_set_add_bookmark_popover (EPHY_LOCATION_ENTRY (header_bar->title_widget),
+ GTK_POPOVER (ephy_add_bookmark_popover_new (header_bar)));
g_signal_connect_object (header_bar->title_widget,
"bookmark-clicked",
@@ -420,9 +417,6 @@ void
ephy_header_bar_set_adaptive_mode (EphyHeaderBar *header_bar,
EphyAdaptiveMode adaptive_mode)
{
- ephy_action_bar_end_set_show_bookmark_button (header_bar->action_bar_end,
- adaptive_mode == EPHY_ADAPTIVE_MODE_NARROW);
-
switch (adaptive_mode) {
case EPHY_ADAPTIVE_MODE_NORMAL:
gtk_revealer_set_reveal_child (GTK_REVEALER (header_bar->start_revealer), TRUE);
@@ -439,7 +433,7 @@ ephy_header_bar_set_adaptive_mode (EphyHeaderBar *header_bar,
}
if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) != EPHY_EMBED_SHELL_MODE_APPLICATION)
- ephy_location_entry_set_mobile_mode (EPHY_LOCATION_ENTRY (header_bar->title_widget), adaptive_mode ==
EPHY_ADAPTIVE_MODE_NARROW);
+ ephy_location_entry_set_mobile_popdown (EPHY_LOCATION_ENTRY (header_bar->title_widget), adaptive_mode ==
EPHY_ADAPTIVE_MODE_NARROW);
}
void
diff --git a/src/ephy-window.c b/src/ephy-window.c
index 1711816fe..bf2e3bb4f 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -26,7 +26,6 @@
#include "ephy-action-bar.h"
#include "ephy-action-helper.h"
-#include "ephy-bookmark-states.h"
#include "ephy-bookmarks-manager.h"
#include "ephy-debug.h"
#include "ephy-desktop-utils.h"
@@ -1222,33 +1221,15 @@ sync_tab_is_blank (EphyWebView *view,
ephy_web_view_get_is_blank (view));
}
-void ephy_window_sync_bookmark_state (GtkWidget *widget,
- EphyBookmarkIconState state)
-{
- GtkWidget *toplevel = gtk_widget_get_toplevel (GTK_WIDGET (widget));
- EphyWindow *window = EPHY_WINDOW (toplevel);
- EphyActionBarEnd *action_bar_end = ephy_action_bar_get_action_bar_end (EPHY_ACTION_BAR
(window->action_bar));
- GtkWidget *lentry;
-
- if (action_bar_end)
- ephy_action_bar_end_set_bookmark_icon_state (EPHY_ACTION_BAR_END (action_bar_end), state);
-
- lentry = GTK_WIDGET (ephy_header_bar_get_title_widget (EPHY_HEADER_BAR (window->header_bar)));
-
- if (EPHY_IS_LOCATION_ENTRY (lentry))
- ephy_location_entry_set_bookmark_icon_state (EPHY_LOCATION_ENTRY (lentry), state);
-}
-
static void
sync_tab_bookmarked_status (EphyWebView *view,
GParamSpec *pspec,
EphyWindow *window)
{
- EphyActionBarEnd *action_bar_end = ephy_action_bar_get_action_bar_end (EPHY_ACTION_BAR
(window->action_bar));
EphyBookmarksManager *manager = ephy_shell_get_bookmarks_manager (ephy_shell_get_default ());
EphyEmbedShell *shell = ephy_embed_shell_get_default ();
EphyEmbedShellMode mode;
- EphyBookmarkIconState state;
+ EphyLocationEntryBookmarkIconState state;
GtkWidget *widget;
EphyBookmark *bookmark;
const char *address;
@@ -1265,14 +1246,13 @@ sync_tab_bookmarked_status (EphyWebView *view,
ephy_embed_utils_is_no_show_address (address) ||
mode == EPHY_EMBED_SHELL_MODE_INCOGNITO ||
mode == EPHY_EMBED_SHELL_MODE_AUTOMATION) {
- state = EPHY_BOOKMARK_ICON_HIDDEN;
+ state = EPHY_LOCATION_ENTRY_BOOKMARK_ICON_HIDDEN;
} else {
bookmark = ephy_bookmarks_manager_get_bookmark_by_url (manager, address);
- state = bookmark ? EPHY_BOOKMARK_ICON_BOOKMARKED
- : EPHY_BOOKMARK_ICON_EMPTY;
+ state = bookmark ? EPHY_LOCATION_ENTRY_BOOKMARK_ICON_BOOKMARKED
+ : EPHY_LOCATION_ENTRY_BOOKMARK_ICON_EMPTY;
}
- ephy_action_bar_end_set_bookmark_icon_state (EPHY_ACTION_BAR_END (action_bar_end), state);
ephy_location_entry_set_bookmark_icon_state (EPHY_LOCATION_ENTRY (widget), state);
}
diff --git a/src/ephy-window.h b/src/ephy-window.h
index 6f7a2587d..01c272846 100644
--- a/src/ephy-window.h
+++ b/src/ephy-window.h
@@ -20,7 +20,6 @@
#pragma once
-#include "ephy-bookmark-states.h"
#include "ephy-bookmarks-manager.h"
#include "ephy-embed.h"
#include "ephy-embed-event.h"
@@ -98,7 +97,4 @@ gboolean ephy_window_is_fullscreen (EphyWindow *window);
void ephy_window_get_geometry (EphyWindow *window,
GdkRectangle *rectangle);
-void ephy_window_sync_bookmark_state (GtkWidget *widget,
- EphyBookmarkIconState state);
-
G_END_DECLS
diff --git a/src/resources/ephy-bookmarks-symbolic.svg b/src/resources/ephy-bookmarks-symbolic.svg
new file mode 100644
index 000000000..b174985a6
--- /dev/null
+++ b/src/resources/ephy-bookmarks-symbolic.svg
@@ -0,0 +1,83 @@
+<?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="16.003492"
+ height="16"
+ viewBox="0 0 16.003493 16"
+ id="svg7221"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="ephy-bookmarks-symbolic.svg">
+ <defs
+ id="defs7223" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1"
+ inkscape:cx="8.2824125"
+ inkscape:cy="11.498687"
+ inkscape:document-units="px"
+ inkscape:current-layer="g7201"
+ showgrid="false"
+ units="px"
+ fit-margin-top="0"
+ fit-margin-left="0"
+ fit-margin-right="0"
+ fit-margin-bottom="0"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="2560"
+ inkscape:window-height="1376"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1" />
+ <metadata
+ id="metadata7226">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-366.99825,-524.3622)">
+ <g
+ id="g7201"
+ style="display:inline"
+ transform="translate(25.998054,63.362205)"
+ inkscape:label="bookmarks">
+ <g
+ id="g16974"
+ inkscape:label="bookmarks">
+ <path
+ inkscape:connector-curvature="0"
+ id="path7205"
+ transform="translate(241.0002,217)"
+ d="M 101.96875,244 C 100.87755,244 100,244.87755 100,245.96875 l 0,12.0625 c 0,1.0912
0.87755,1.96875 1.96875,1.96875 L 114,260 c 0.554,0 1,-0.446 1,-1 l 0,-11 c 0,-0.554 -0.446,-1 -1,-1 l -12,0
c -0.554,0 -1,-0.446 -1,-1 0,-0.554 0.446,-1 1,-1 l 12,0 c 0,-0.55856 -0.44144,-1 -1,-1 l -11.03125,0 z m
5.79492,4.92383 c 0.67546,0.003 1.0333,2.39564 1.57813,2.79492 0.54503,0.39943 2.93625,0.0206 3.14258,0.66406
0.20624,0.64321 -1.95855,1.7237 -2.16993,2.36524 -0.21146,0.64179 0.88611,2.79829 0.33789,3.19336
-0.54799,0.39491 -2.24446,-1.32925 -2.91992,-1.33203 -0.67572,-0.003 -2.3865,1.70789 -2.93164,1.30859
-0.54493,-0.39914 0.56936,-2.54619 0.36328,-3.18945 -0.20616,-0.64351 -2.36169,-1.74293 -2.15039,-2.38477
0.21122,-0.64159 2.59839,-0.2439 3.14649,-0.63867 0.54831,-0.39493 0.92779,-2.78387 1.60351,-2.78125 z"
+
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;enable-background:accumulate"
/>
+ </g>
+ <g
+ transform="matrix(0.67537179,0,0,0.67537179,189.36843,-207.21827)"
+ style="display:inline"
+ id="g7207" />
+ </g>
+ </g>
+</svg>
diff --git a/src/resources/epiphany.gresource.xml b/src/resources/epiphany.gresource.xml
index d6b40269f..d65cdc58d 100644
--- a/src/resources/epiphany.gresource.xml
+++ b/src/resources/epiphany.gresource.xml
@@ -44,6 +44,7 @@
</gresource>
<gresource prefix="/org/gnome/Epiphany/icons">
<file compressed="true" alias="scalable/actions/ephy-download-symbolic.svg"
preprocess="xml-stripblanks">ephy-download-symbolic.svg</file>
+ <file compressed="true"
alias="scalable/actions/ephy-bookmarks-symbolic.svg">ephy-bookmarks-symbolic.svg</file>
<file compressed="true"
alias="scalable/actions/ephy-bookmark-tag-symbolic.svg">ephy-bookmark-tag-symbolic.svg</file>
<file compressed="true"
alias="scalable/actions/ephy-missing-favicon-symbolic.svg">ephy-missing-favicon-symbolic.svg</file>
<file compressed="true"
alias="scalable/actions/ephy-reader-mode-symbolic.svg">ephy-reader-mode-symbolic.svg</file>
@@ -51,7 +52,6 @@
<file compressed="true"
alias="scalable/status/ephy-audio-playing-symbolic.svg">ephy-audio-playing-symbolic.svg</file>
<file compressed="true"
alias="scalable/status/ephy-tab-counter-symbolic.svg">ephy-tab-counter-symbolic.svg</file>
<file compressed="true"
alias="scalable/status/ephy-tab-overflow-symbolic.svg">ephy-tab-overflow-symbolic.svg</file>
- <file compressed="true"
alias="scalable/status/ephy-library-symbolic.svg">ephy-library-symbolic.svg</file>
</gresource>
<gresource prefix="/org/gnome/Epiphany">
<file compressed="true">themes/shared.css</file>
diff --git a/src/resources/gtk/action-bar-end.ui b/src/resources/gtk/action-bar-end.ui
index cd56c34ea..6e03dbfc6 100644
--- a/src/resources/gtk/action-bar-end.ui
+++ b/src/resources/gtk/action-bar-end.ui
@@ -1,10 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <object class="GtkImage" id="bookmark_image">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="icon_name">non-starred-symbolic</property>
- </object>
<template class="EphyActionBarEnd" parent="GtkBox">
<property name="spacing">6</property>
<child>
@@ -20,7 +15,7 @@
<child>
<object class="GtkImage" id="bookmarks_image">
<property name="visible">True</property>
- <property name="icon-name">ephy-library-symbolic</property>
+ <property name="icon-name">ephy-bookmarks-symbolic</property>
<property name="icon-size">1</property>
</object>
</child>
@@ -29,21 +24,6 @@
<property name="pack-type">end</property>
</packing>
</child>
- <child>
- <object class="GtkButton" id="bookmark_button">
- <property name="visible">True</property>
- <property name="valign">center</property>
- <!-- Translators: tooltip for the bookmark button -->
- <property name="tooltip_text" translatable="yes">Bookmark page</property>
- <property name="image">bookmark_image</property>
- <style>
- <class name="image-button"/>
- </style>
- </object>
- <packing>
- <property name="pack-type">end</property>
- </packing>
- </child>
<child>
<object class="GtkRevealer" id="downloads_revealer">
<property name="visible">True</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]