Skip to content

Commit

Permalink
[eel] remove functions to set widget backgrounds
Browse files Browse the repository at this point in the history
Now that we've removed eel_gtk_widget_set_background_color
calls in eel-debug-drawing.c and test-eel-image-table.c,
both it and _set_foreground_color are unused.

Original commit:
http://git.gnome.org/browse/nautilus/commit/?id=57b66862a53298468755e12ca3712569274f0a32
  • Loading branch information
Jasmine Hassan committed Nov 16, 2012
1 parent 5b952b5 commit 654e3c4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 47 deletions.
2 changes: 0 additions & 2 deletions eel/eel-debug-drawing.c
Expand Up @@ -362,8 +362,6 @@ eel_debug_show_pixbuf (GdkPixbuf *pixbuf)

gtk_box_pack_start (GTK_BOX (vbox), debug_image, TRUE, TRUE, 0);

eel_gtk_widget_set_background_color (debug_window, "white");

eel_debug_call_at_shutdown (destroy_debug_window);

gtk_widget_show (debug_image);
Expand Down
32 changes: 0 additions & 32 deletions eel/eel-gtk-extensions.c
Expand Up @@ -508,38 +508,6 @@ eel_gtk_label_make_bold (GtkLabel *label)
pango_font_description_free (font_desc);
}

void
eel_gtk_widget_set_background_color (GtkWidget *widget,
const char *color_spec)
{
GdkColor color;

g_return_if_fail (GTK_IS_WIDGET (widget));

eel_gdk_color_parse_with_white_default (color_spec, &color);

gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &color);
gtk_widget_modify_base (widget, GTK_STATE_NORMAL, &color);
gtk_widget_modify_bg (widget, GTK_STATE_ACTIVE, &color);
gtk_widget_modify_base (widget, GTK_STATE_ACTIVE, &color);
}

void
eel_gtk_widget_set_foreground_color (GtkWidget *widget,
const char *color_spec)
{
GdkColor color;

g_return_if_fail (GTK_IS_WIDGET (widget));

eel_gdk_color_parse_with_white_default (color_spec, &color);

gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, &color);
gtk_widget_modify_text (widget, GTK_STATE_NORMAL, &color);
gtk_widget_modify_fg (widget, GTK_STATE_ACTIVE, &color);
gtk_widget_modify_text (widget, GTK_STATE_ACTIVE, &color);
}

static gboolean
tree_view_button_press_callback (GtkWidget *tree_view,
GdkEventButton *event,
Expand Down
4 changes: 0 additions & 4 deletions eel/eel-gtk-extensions.h
Expand Up @@ -54,10 +54,6 @@ void eel_gtk_signal_connect_while_realized (GtkObject
/* GtkWidget */
void eel_gtk_widget_set_shown (GtkWidget *widget,
gboolean shown);
void eel_gtk_widget_set_background_color (GtkWidget *widget,
const char *color_spec);
void eel_gtk_widget_set_foreground_color (GtkWidget *widget,
const char *color_spec);

/* GtkWindow */
void eel_gtk_window_set_initial_geometry (GtkWindow *window,
Expand Down
16 changes: 7 additions & 9 deletions test/test-eel-image-table.c
Expand Up @@ -63,7 +63,7 @@ labeled_image_new (const char *text,
{
GtkWidget *image;
GdkPixbuf *pixbuf = NULL;

if (icon_name) {
float sizes[] = { 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0 };
Expand Down Expand Up @@ -194,7 +194,7 @@ image_table_size_allocate (GtkWidget *image_table,
gtk_widget_get_allocation (GTK_WIDGET (image_table), &w_allocation);
if (0) gtk_widget_size_allocate (GTK_WIDGET (image_table),
&w_allocation);

g_print ("%s(%d)\n", G_STRFUNC, recursion_count);

recursion_count--;
Expand Down Expand Up @@ -264,8 +264,6 @@ image_table_new_scrolled (void)
G_CALLBACK (image_table_child_clicked_callback),
NULL);

eel_gtk_widget_set_background_color (viewport, BG_COLOR_SPEC);

for (i = 0; i < 100; i++) {
char *text;
GtkWidget *image;
Expand All @@ -283,22 +281,22 @@ image_table_new_scrolled (void)
gtk_widget_show (viewport);
gtk_widget_show (scrolled);
gtk_widget_show (image_table);

return window;
}

int
int
main (int argc, char* argv[])
{
GtkWidget *window = NULL;

test_init (&argc, &argv);

window = image_table_new_scrolled ();

gtk_widget_show (window);

gtk_main ();

return 0;
}

0 comments on commit 654e3c4

Please sign in to comment.