aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Damian <dandamian@gmx.net>2003-03-10 03:32:41 +0800
committerDan Damian <dand@src.gnome.org>2003-03-10 03:32:41 +0800
commit64f7879af2f0d3e234926d03ae1f1da711a89329 (patch)
tree33e3862dcd9cb045d755b4bd9bf5b08138dbcda0 /lib
parent2f46d7cd79bda7c11395223411cfe4e28c6111d6 (diff)
downloadgsoc2013-epiphany-64f7879af2f0d3e234926d03ae1f1da711a89329.tar
gsoc2013-epiphany-64f7879af2f0d3e234926d03ae1f1da711a89329.tar.gz
gsoc2013-epiphany-64f7879af2f0d3e234926d03ae1f1da711a89329.tar.bz2
gsoc2013-epiphany-64f7879af2f0d3e234926d03ae1f1da711a89329.tar.lz
gsoc2013-epiphany-64f7879af2f0d3e234926d03ae1f1da711a89329.tar.xz
gsoc2013-epiphany-64f7879af2f0d3e234926d03ae1f1da711a89329.tar.zst
gsoc2013-epiphany-64f7879af2f0d3e234926d03ae1f1da711a89329.zip
Use default widget color for smart bookmarks background. Fixes #107902.
2003-03-09 Dan Damian <dandamian@gmx.net> * lib/widgets/ephy-autocompletion-window.c: (ephy_autocompletion_window_init_widgets): Use default widget color for smart bookmarks background. Fixes #107902. * lib/ephy-gui.h: * lib/ephy-gui.c (shift_color_component), (ephy_gui_rgb_shift_color), (rgb16_to_rgb), (ephy_gui_gdk_color_to_rgb), (ephy_gui_rgb_to_color): Removed unused functions.
Diffstat (limited to 'lib')
-rw-r--r--lib/ephy-gui.c90
-rw-r--r--lib/ephy-gui.h8
-rw-r--r--lib/widgets/ephy-autocompletion-window.c7
3 files changed, 3 insertions, 102 deletions
diff --git a/lib/ephy-gui.c b/lib/ephy-gui.c
index 01500e1e6..ead789762 100644
--- a/lib/ephy-gui.c
+++ b/lib/ephy-gui.c
@@ -146,93 +146,3 @@ ephy_gui_confirm_overwrite_file (GtkWidget *parent, const char *filename)
return res;
}
-
-static guint32
-shift_color_component (guchar component, float shift_by)
-{
- guint32 result;
- if (shift_by > 1.0) {
- result = component * (2 - shift_by);
- } else {
- result = 0xff - shift_by * (0xff - component);
- }
-
- return result & 0xff;
-}
-
-/**
- * ephy_gui_rgb_shift_color
- * @color: A color.
- * @shift_by: darken or lighten factor.
- * Returns: An darkened or lightened rgb value.
- *
- * Darkens (@shift_by > 1) or lightens (@shift_by < 1)
- * @color.
- */
-guint32
-ephy_gui_rgb_shift_color (guint32 color, float shift_by)
-{
- guint32 result;
-
- /* shift red by shift_by */
- result = shift_color_component((color & 0x00ff0000) >> 16, shift_by);
- result <<= 8;
- /* shift green by shift_by */
- result |= shift_color_component((color & 0x0000ff00) >> 8, shift_by);
- result <<= 8;
- /* shift blue by shift_by */
- result |= shift_color_component((color & 0x000000ff), shift_by);
-
- /* alpha doesn't change */
- result |= (0xff000000 & color);
-
- return result;
-}
-
-static guint32
-rgb16_to_rgb (gushort r, gushort g, gushort b)
-{
- guint32 result;
-
- result = (0xff0000 | (r & 0xff00));
- result <<= 8;
- result |= ((g & 0xff00) | (b >> 8));
-
- return result;
-}
-
-/**
- * ephy_gui_gdk_color_to_rgb
- * @color: A GdkColor style color.
- * Returns: An rgb value.
- *
- * Converts from a GdkColor stlye color to a gdk_rgb one.
- * Alpha gets set to fully opaque
- */
-guint32
-ephy_gui_gdk_color_to_rgb (const GdkColor *color)
-{
- return rgb16_to_rgb (color->red, color->green, color->blue);
-}
-
-/**
- * ephy_gui_rgb_to_color
- * @color: a gdk_rgb style value.
- *
- * Converts from a gdk_rgb value style to a GdkColor one.
- * The gdk_rgb color alpha channel is ignored.
- *
- * Return value: A GdkColor structure version of the given RGB color.
- */
-GdkColor
-ephy_gui_gdk_rgb_to_color (guint32 color)
-{
- GdkColor result;
-
- result.red = ((color >> 16) & 0xFF) * 0x101;
- result.green = ((color >> 8) & 0xFF) * 0x101;
- result.blue = (color & 0xff) * 0x101;
- result.pixel = 0;
-
- return result;
-}
diff --git a/lib/ephy-gui.h b/lib/ephy-gui.h
index 75fc0164b..903f6e5bb 100644
--- a/lib/ephy-gui.h
+++ b/lib/ephy-gui.h
@@ -40,14 +40,6 @@ void ephy_gui_gtk_radio_button_set (GtkRadioButton *radio_button,
gboolean ephy_gui_confirm_overwrite_file (GtkWidget *parent,
const char *filename);
-
-guint32 ephy_gui_rgb_shift_color (guint32 color,
- float shift_by);
-
-guint32 ephy_gui_gdk_color_to_rgb (const GdkColor *color);
-
-GdkColor ephy_gui_gdk_rgb_to_color (guint32 color);
-
G_END_DECLS
#endif
diff --git a/lib/widgets/ephy-autocompletion-window.c b/lib/widgets/ephy-autocompletion-window.c
index bd3019632..d3c73b493 100644
--- a/lib/widgets/ephy-autocompletion-window.c
+++ b/lib/widgets/ephy-autocompletion-window.c
@@ -206,7 +206,7 @@ ephy_autocompletion_window_init_widgets (EphyAutocompletionWindow *aw)
GtkWidget *frame;
GtkWidget *vbox;
GdkColor *bg_color;
- guint32 base, dark;
+ GtkStyle *style;
GValue v = { 0 };
p->window = gtk_window_new (GTK_WINDOW_POPUP);
@@ -257,9 +257,8 @@ ephy_autocompletion_window_init_widgets (EphyAutocompletionWindow *aw)
g_value_init (&v, GDK_TYPE_COLOR);
g_object_get_property (G_OBJECT (renderer), "cell_background_gdk", &v);
bg_color = g_value_peek_pointer (&v);
- base = ephy_gui_gdk_color_to_rgb (bg_color);
- dark = ephy_gui_rgb_shift_color (base, 0.15);
- *bg_color = ephy_gui_gdk_rgb_to_color (dark);
+ style = gtk_widget_get_style (p->window);
+ *bg_color = style->bg[GTK_STATE_NORMAL];
g_object_set_property (G_OBJECT (renderer), "cell_background_gdk", &v);
p->action_col1 = gtk_tree_view_column_new ();