summaryrefslogtreecommitdiff
path: root/libgd
diff options
context:
space:
mode:
authorDebarshi Ray <debarshir@gnome.org>2017-04-07 18:34:08 +0200
committerDebarshi Ray <debarshir@gnome.org>2017-04-25 11:13:23 +0200
commitcc90107531640bcba6c3c58e5cf6aec94d498763 (patch)
tree1de8d70bb8504b0c7875dd1b9ab5d4b21b714392 /libgd
parenta4928d0f5e7aebe7d0670fb65d5b6c1bcbe5dd60 (diff)
downloadlibgd-cc90107531640bcba6c3c58e5cf6aec94d498763.tar.gz
tagged-entry: Use the entry-tag CSS style class from Adwaita
The dark and light variants of the CSS for GdTaggedEntryTag were still scattered across applications and libgd as the photos-entry-tag and documents-entry-tag style classes. It has been decided to consolidate all that in Adwaita, like we do for the other libgd style classes, as the "entry-tag" style class. https://bugzilla.gnome.org/show_bug.cgi?id=781671
Diffstat (limited to 'libgd')
-rw-r--r--libgd/gd-tagged-entry-default.css34
-rw-r--r--libgd/gd-tagged-entry.c23
-rw-r--r--libgd/gd-tagged-entry.gresource.xml6
-rw-r--r--libgd/meson.build6
4 files changed, 1 insertions, 68 deletions
diff --git a/libgd/gd-tagged-entry-default.css b/libgd/gd-tagged-entry-default.css
deleted file mode 100644
index f11fb80..0000000
--- a/libgd/gd-tagged-entry-default.css
+++ /dev/null
@@ -1,34 +0,0 @@
-@define-color entry_tag_bg #3465a4;
-@define-color entry_tag_fg #ffffff;
-
-.documents-entry-tag {
- background-image: none;
- background-color: @entry_tag_bg;
- color: @entry_tag_fg;
-
- border-radius: 4px;
- border-width: 0;
-
- margin: 2px;
- padding: 4px;
-}
-
-.documents-entry-tag:hover {
- background-color: shade(@entry_tag_bg, 1.10);
- color: @entry_tag_fg;
-}
-
-.documents-entry-tag.button,
-.documents-entry-tag.button:hover,
-.documents-entry-tag.button:active,
-.documents-entry-tag.button:active:hover {
- background-color: transparent;
- background-image: none;
- box-shadow: none;
- border-image: none;
- border-width: 0;
-}
-
-.documents-entry-tag.button:hover {
- color: shade(@entry_tag_bg, 2.10);
-}
diff --git a/libgd/gd-tagged-entry.c b/libgd/gd-tagged-entry.c
index 7dd92f4..380962c 100644
--- a/libgd/gd-tagged-entry.c
+++ b/libgd/gd-tagged-entry.c
@@ -23,7 +23,6 @@
#include "gd-tagged-entry.h"
#include <math.h>
-#include <libgd/gd-tagged-entry-resources.h>
#define BUTTON_INTERNAL_SPACING 6
@@ -913,24 +912,6 @@ gd_tagged_entry_set_property (GObject *object,
}
static void
-gd_tagged_entry_add_default_style (void)
-{
- GtkCssProvider *provider;
- GResource *do_not_optimize_away_get_resource G_GNUC_UNUSED;
-
- provider = gtk_css_provider_new ();
- do_not_optimize_away_get_resource = gd_tagged_entry_get_resource ();
- gtk_css_provider_load_from_resource
- (provider, "/org/gnome/libgd/tagged-entry/default.css");
-
- gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_THEME);
-
- g_object_unref (provider);
-}
-
-static void
gd_tagged_entry_class_init (GdTaggedEntryClass *klass)
{
GtkWidgetClass *wclass = GTK_WIDGET_CLASS (klass);
@@ -976,8 +957,6 @@ gd_tagged_entry_class_init (GdTaggedEntryClass *klass)
"Whether the close button should be shown in tags.", TRUE,
G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS);
- gd_tagged_entry_add_default_style ();
-
g_type_class_add_private (klass, sizeof (GdTaggedEntryPrivate));
g_object_class_install_properties (oclass, NUM_PROPERTIES, properties);
}
@@ -1077,7 +1056,7 @@ gd_tagged_entry_tag_class_init (GdTaggedEntryTagClass *klass)
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
tag_properties[PROP_TAG_STYLE] =
g_param_spec_string ("style", "Style",
- "Style of the tag.", "documents-entry-tag",
+ "Style of the tag.", "entry-tag",
G_PARAM_CONSTRUCT | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_type_class_add_private (klass, sizeof (GdTaggedEntryTagPrivate));
diff --git a/libgd/gd-tagged-entry.gresource.xml b/libgd/gd-tagged-entry.gresource.xml
deleted file mode 100644
index 10b530c..0000000
--- a/libgd/gd-tagged-entry.gresource.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<gresources>
- <gresource prefix="/org/gnome/libgd/tagged-entry">
- <file alias="default.css">gd-tagged-entry-default.css</file>
- </gresource>
-</gresources>
diff --git a/libgd/meson.build b/libgd/meson.build
index a050b17..abe8985 100644
--- a/libgd/meson.build
+++ b/libgd/meson.build
@@ -105,13 +105,7 @@ if get_option('with-margin-container')
endif
if get_option('with-tagged-entry')
- gdres = gnome.compile_resources(
- 'gd-tagged-entry-resources',
- 'gd-tagged-entry.gresource.xml'
- )
- built_sources += gdres[1]
sources += [
- gdres,
'gd-tagged-entry.c',
'gd-tagged-entry.h',
]