[epiphany/wip/bookmarks: 1/4] bookmarks-popover: Use new icons for tags. Use special icon for Favorite tag.
- From: Iulian Radu <iulianradu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/bookmarks: 1/4] bookmarks-popover: Use new icons for tags. Use special icon for Favorite tag.
- Date: Mon, 8 Aug 2016 14:03:08 +0000 (UTC)
commit 5a036511c5d3f3346992430eada8eddd62c8eac7
Author: Iulian Radu <iulian radu67 gmail com>
Date: Tue Aug 2 22:48:06 2016 +0300
bookmarks-popover: Use new icons for tags. Use special icon for Favorite
tag.
src/Makefile.am | 2 +
src/ephy-bookmark-properties-grid.c | 41 +++++++++----
src/ephy-bookmarks-manager.c | 4 +
src/ephy-bookmarks-popover.c | 8 ++-
src/ephy-window.c | 3 +-
src/epiphany.gresource.xml | 2 +
src/resources/epiphany.css | 1 -
src/resources/epiphany.scss | 1 -
src/resources/icons/ephy-bookmark-tag.svg | 95 +++++++++++++++++++++++++++++
src/resources/icons/ephy-bookmarks.svg | 90 +++++++++++++++++++++++++++
10 files changed, 231 insertions(+), 16 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 7af8664..fb22b2d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -136,6 +136,8 @@ RESOURCE_FILES = \
resources/shortcuts-dialog.ui \
resources/icons/ephy-bookmark-empty.svg \
resources/icons/ephy-bookmark-full.svg \
+ resources/icons/ephy-bookmark-tag.svg \
+ resources/icons/ephy-bookmarks.svg \
resources/gtk/bookmark-properties-grid.ui \
resources/gtk/bookmark-row.ui \
resources/gtk/bookmarks-popover.ui \
diff --git a/src/ephy-bookmark-properties-grid.c b/src/ephy-bookmark-properties-grid.c
index ba76b77..f6976cb 100644
--- a/src/ephy-bookmark-properties-grid.c
+++ b/src/ephy-bookmark-properties-grid.c
@@ -139,27 +139,44 @@ ephy_bookmark_properties_grid_create_tag_widget (EphyBookmarkPropertiesGrid *sel
GtkWidget *widget;
GtkWidget *box;
GtkWidget *label;
- GtkWidget *button;
GtkStyleContext *context;
+ gboolean default_tag;
+
+ default_tag = (g_strcmp0 (tag, "Favorites") == 0);
widget = gtk_flow_box_child_new ();
+ gtk_widget_set_can_focus (widget, FALSE);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ if (default_tag) {
+ GtkWidget *image;
+
+ image = gtk_image_new_from_icon_name ("user-bookmarks-symbolic",
+ GTK_ICON_SIZE_BUTTON);
+ gtk_widget_set_margin_bottom (image, 8);
+ gtk_widget_set_margin_top (image, 8);
+ gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);
+ }
+
label = gtk_label_new (tag);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
- button = gtk_button_new ();
- gtk_button_set_image (GTK_BUTTON (button),
- gtk_image_new_from_icon_name ("window-close-symbolic",
- GTK_ICON_SIZE_MENU));
- gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
- gtk_widget_set_can_focus (button, FALSE);
- gtk_box_pack_end (GTK_BOX (box), button, FALSE, FALSE, 0);
- g_signal_connect_object (button, "clicked",
- G_CALLBACK (ephy_bookmark_properties_grid_tag_widget_button_clicked_cb),
- self,
- G_CONNECT_SWAPPED);
+ if (!default_tag) {
+ GtkWidget *button;
+
+ button = gtk_button_new ();
+ gtk_button_set_image (GTK_BUTTON (button),
+ gtk_image_new_from_icon_name ("window-close-symbolic",
+ GTK_ICON_SIZE_MENU));
+ gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
+ gtk_widget_set_can_focus (button, FALSE);
+ gtk_box_pack_end (GTK_BOX (box), button, FALSE, FALSE, 0);
+ g_signal_connect_object (button, "clicked",
+ G_CALLBACK (ephy_bookmark_properties_grid_tag_widget_button_clicked_cb),
+ self,
+ G_CONNECT_SWAPPED);
+ }
g_object_set_data (G_OBJECT (box), "label", label);
diff --git a/src/ephy-bookmarks-manager.c b/src/ephy-bookmarks-manager.c
index 51489d1..ccf9fef 100644
--- a/src/ephy-bookmarks-manager.c
+++ b/src/ephy-bookmarks-manager.c
@@ -150,6 +150,10 @@ ephy_bookmarks_manager_init (EphyBookmarksManager *self)
NULL);
self->tags = g_sequence_new (g_free);
+ g_sequence_insert_sorted (self->tags,
+ g_strdup ("Favorites"),
+ (GCompareDataFunc)ephy_bookmark_tags_compare,
+ NULL);
/* Create DB file if it doesn't already exists */
if (!g_file_test (self->gvdb_filename, G_FILE_TEST_EXISTS))
diff --git a/src/ephy-bookmarks-popover.c b/src/ephy-bookmarks-popover.c
index b86b308..3ec2f47 100644
--- a/src/ephy-bookmarks-popover.c
+++ b/src/ephy-bookmarks-popover.c
@@ -187,7 +187,10 @@ create_tag_row (const char *tag)
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_set_halign (box, GTK_ALIGN_START);
- image = gtk_image_new_from_icon_name ("user-bookmarks-symbolic", GTK_ICON_SIZE_MENU);
+ if (g_strcmp0 (tag, "Favorites") == 0)
+ image = gtk_image_new_from_icon_name ("user-bookmarks-symbolic", GTK_ICON_SIZE_MENU);
+ else
+ image = gtk_image_new_from_icon_name ("ephy-bookmark-tag", GTK_ICON_SIZE_MENU);
gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 6);
label = gtk_label_new (tag);
@@ -271,6 +274,9 @@ ephy_bookmarks_popover_init (EphyBookmarksPopover *self)
gtk_widget_init_template (GTK_WIDGET (self));
+ gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (),
+ "/org/gnome/epiphany/icons/");
+
group = g_simple_action_group_new ();
g_action_map_add_action_entries (G_ACTION_MAP (group), entries,
G_N_ELEMENTS (entries), self);
diff --git a/src/ephy-window.c b/src/ephy-window.c
index a637876..6e77bd3 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -1159,10 +1159,11 @@ sync_tab_bookmarked_status (EphyWebView *view,
entry = ephy_toolbar_get_location_entry (EPHY_TOOLBAR (window->toolbar));
address = ephy_web_view_get_address (view);
- if (address)
+ if (address) {
bookmark = ephy_bookmarks_manager_get_bookmark_by_url (manager, address);
ephy_location_entry_set_bookmarked_status (EPHY_LOCATION_ENTRY (entry),
bookmark != NULL);
+ }
}
static void
diff --git a/src/epiphany.gresource.xml b/src/epiphany.gresource.xml
index 566c435..c90db7b 100644
--- a/src/epiphany.gresource.xml
+++ b/src/epiphany.gresource.xml
@@ -14,6 +14,8 @@
<file preprocess="xml-stripblanks" compressed="true">shortcuts-dialog.ui</file>
<file preprocess="xml-stripblanks" compressed="true">icons/ephy-bookmark-empty.svg</file>
<file preprocess="xml-stripblanks" compressed="true">icons/ephy-bookmark-full.svg</file>
+ <file preprocess="xml-stripblanks" compressed="true">icons/ephy-bookmark-tag.svg</file>
+ <file preprocess="xml-stripblanks" compressed="true">icons/ephy-bookmarks.svg</file>
<file preprocess="xml-stripblanks" compressed="true">gtk/bookmark-properties-grid.ui</file>
<file preprocess="xml-stripblanks" compressed="true">gtk/bookmark-row.ui</file>
<file preprocess="xml-stripblanks" compressed="true">gtk/bookmarks-popover.ui</file>
diff --git a/src/resources/epiphany.css b/src/resources/epiphany.css
index 75f8dd1..013b1a8 100644
--- a/src/resources/epiphany.css
+++ b/src/resources/epiphany.css
@@ -134,7 +134,6 @@ button.active-menu {
.bookmark-tag-widget {
padding-left: 8px;
- padding-right: 8px;
background-color: #cfcfcd; }
.bookmark-tag-widget label {
padding-left: 8px;
diff --git a/src/resources/epiphany.scss b/src/resources/epiphany.scss
index 2564833..c98b793 100644
--- a/src/resources/epiphany.scss
+++ b/src/resources/epiphany.scss
@@ -127,7 +127,6 @@ $edge_color: lighten($incognito_color, 13%);
$close_button_fg_color: lighten($fg_color, 10%);
.bookmark-tag-widget {
padding-left: 8px;
- padding-right: 8px;
background-color: darken($bg_color, 10%);
label {
diff --git a/src/resources/icons/ephy-bookmark-tag.svg b/src/resources/icons/ephy-bookmark-tag.svg
new file mode 100644
index 0000000..5b661a5
--- /dev/null
+++ b/src/resources/icons/ephy-bookmark-tag.svg
@@ -0,0 +1,95 @@
+<?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="tag.svg">
+ <defs
+ id="defs7223" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="22.832423"
+ inkscape:cy="-5.8872186"
+ inkscape:document-units="px"
+ inkscape:current-layer="g7890"
+ 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="1920"
+ inkscape:window-height="1016"
+ inkscape:window-x="0"
+ inkscape:window-y="27"
+ inkscape:window-maximized="1"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-midpoints="false"
+ inkscape:snap-nodes="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid7856" />
+ </sodipodi:namedview>
+ <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></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="g7884">
+ <g
+ id="g7890">
+ <g
+ id="g7894"
+ inkscape:label="tag">
+ <rect
+
style="opacity:1;fill:#eaeaea;fill-opacity:0;stroke:#910f0f;stroke-width:0;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+ id="rect7821"
+ width="15.99999"
+ height="15.99999"
+ x="366.99826"
+ y="524.36218" />
+ <path
+ sodipodi:nodetypes="ccccsccccccccc"
+
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#bebebe;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:4,
4;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="m 374.15994,526.74583 -4.68029,0.26893 -0.23767,4.71155 6.26952,6.26954 c 0.39176,0.3917
1.02232,0.39173 1.41406,-10e-6 l 3.53516,-3.53515 c 0.39174,-0.39176 0.39177,-1.02233 2e-5,-1.41407 z m
-1.90055,1.83578 c 0.31165,0.004 0.60946,0.12944 0.83008,0.34963 0.4679,0.46747 0.46792,1.22586 0,1.69334
-0.46748,0.46791 -1.22587,0.46791 -1.69336,10e-6 -0.46789,-0.46749 -0.46789,-1.22588 0,-1.69337
0.22879,-0.22827 0.5401,-0.35444 0.86328,-0.34961 z"
+ id="path7888"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/src/resources/icons/ephy-bookmarks.svg b/src/resources/icons/ephy-bookmarks.svg
new file mode 100644
index 0000000..3ced9ee
--- /dev/null
+++ b/src/resources/icons/ephy-bookmarks.svg
@@ -0,0 +1,90 @@
+<?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="bookmarks.svg">
+ <defs
+ id="defs7223" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16"
+ inkscape:cx="19.359209"
+ inkscape:cy="7.9507135"
+ 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="1920"
+ inkscape:window-height="1016"
+ 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">
+ <rect
+ y="461"
+ x="341.00369"
+ height="16"
+ width="16"
+ id="rect7203"
+
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:1;marker:none;enable-background:new"
/>
+ <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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]