- Remove unused code/options from the code. Warn about their usage while

2006-12-13  Benjamin Berg  <benjamin@sipsolutions.net>


	* engines/clearlooks/src/clearlooks_rc_style.c:
	(clearlooks_rc_style_init), (clearlooks_gtk2_rc_parse_dummy),
	(clearlooks_rc_style_parse), (clearlooks_rc_style_merge):
	* engines/clearlooks/src/clearlooks_rc_style.h:
	* engines/clearlooks/src/clearlooks_style.c:
	(clearlooks_style_draw_box), (clearlooks_style_init_from_rc),
	(clearlooks_style_copy):
	* engines/clearlooks/src/clearlooks_style.h:
	* engines/clearlooks/src/clearlooks_types.h:
	- Remove unused code/options from the code. Warn about their usage
	while parsing.


	* themes/Clearlooks/gtk-2.0/gtkrc:
	- Remove options that don't have any effect.
This commit is contained in:
Benjamin Berg 2006-12-13 17:32:49 +00:00 committed by Benjamin Berg
parent 9a8be32166
commit 78fcce907f
5 changed files with 88 additions and 4 deletions

View File

@ -33,7 +33,8 @@ typedef enum
GTK_CELL_RENDERER_INSENSITIVE = 1 << 2,
/* this flag means the cell is in the sort column/row */
GTK_CELL_RENDERER_SORTED = 1 << 3,
GTK_CELL_RENDERER_FOCUSED = 1 << 4
GTK_CELL_RENDERER_FOCUSED = 1 << 4,
GTK_CELL_RENDERER_USE_FG = 1 << 5
} GtkCellRendererState;
typedef enum

View File

@ -1624,6 +1624,7 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell,
gint x_offset;
gint y_offset;
GtkCellRendererTextPrivate *priv;
gboolean use_text;
priv = GTK_CELL_RENDERER_TEXT_GET_PRIVATE (cell);
@ -1675,6 +1676,8 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell,
cairo_destroy (cr);
}
use_text = !(flags & GTK_CELL_RENDERER_USE_FG);
if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
pango_layout_set_width (layout,
(cell_area->width - x_offset - 2 * cell->xpad) * PANGO_SCALE);
@ -1684,7 +1687,7 @@ gtk_cell_renderer_text_render (GtkCellRenderer *cell,
gtk_paint_layout (widget->style,
window,
state,
TRUE,
use_text,
expose_area,
widget,
"cellrenderertext",

View File

@ -54,6 +54,8 @@ struct _GtkCellViewPrivate
GdkColor background;
gboolean background_set;
gboolean use_fg;
};
@ -113,7 +115,8 @@ enum
PROP_BACKGROUND,
PROP_BACKGROUND_GDK,
PROP_BACKGROUND_SET,
PROP_MODEL
PROP_MODEL,
PROP_USE_FG
};
G_DEFINE_TYPE_WITH_CODE (GtkCellView, gtk_cell_view, GTK_TYPE_WIDGET,
@ -165,6 +168,21 @@ gtk_cell_view_class_init (GtkCellViewClass *klass)
GTK_TYPE_TREE_MODEL,
GTK_PARAM_READWRITE));
/**
* GtkCellView:use-fg
*
* If set to %TRUE hint the cell renderer to use foreground colors for text drawing.
*
* since 2.12
*/
g_object_class_install_property (gobject_class,
PROP_USE_FG,
g_param_spec_boolean ("use-fg",
P_("Use foreground color when rendering text"),
P_("If set the cell view will get a hint to use the foreground color when rendering text."),
FALSE,
GTK_PARAM_READWRITE));
#define ADD_SET_PROP(propname, propval, nick, blurb) g_object_class_install_property (gobject_class, propval, g_param_spec_boolean (propname, nick, blurb, FALSE, GTK_PARAM_READWRITE))
ADD_SET_PROP ("background-set", PROP_BACKGROUND_SET,
@ -208,6 +226,9 @@ gtk_cell_view_get_property (GObject *object,
case PROP_BACKGROUND_SET:
g_value_set_boolean (value, view->priv->background_set);
break;
case PROP_USE_FG:
g_value_set_boolean (value, view->priv->use_fg);
break;
case PROP_MODEL:
g_value_set_object (value, view->priv->model);
break;
@ -247,6 +268,9 @@ gtk_cell_view_set_property (GObject *object,
case PROP_BACKGROUND_SET:
view->priv->background_set = g_value_get_boolean (value);
break;
case PROP_USE_FG:
gtk_cell_view_set_use_fg (view, g_value_get_boolean (value));
break;
case PROP_MODEL:
gtk_cell_view_set_model (view, g_value_get_object (value));
break;
@ -428,7 +452,10 @@ gtk_cell_view_expose (GtkWidget *widget,
state = GTK_CELL_RENDERER_PRELIT;
else
state = 0;
if (cellview->priv->use_fg)
state |= GTK_CELL_RENDERER_USE_FG;
/* PACK_START */
for (i = cellview->priv->cell_list; i; i = i->next)
{
@ -1029,6 +1056,52 @@ gtk_cell_view_set_background_color (GtkCellView *cell_view,
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
}
/**
* gtk_cell_view_set_use_fg
* @cell_view: a #GtkCellView
* @use_fg: %TRUE if foreground colors should be used for text
*
* Sets whether to hint the cell renderer that foreground colors should be used when rendering text.
*
* Since: 2.12
*/
void
gtk_cell_view_set_use_fg (GtkCellView *cell_view,
gboolean use_fg)
{
g_return_if_fail (GTK_IS_CELL_VIEW (cell_view));
use_fg = (use_fg != FALSE);
if (use_fg != cell_view->priv->use_fg)
{
cell_view->priv->use_fg = use_fg;
gtk_widget_queue_draw (GTK_WIDGET (cell_view));
g_object_notify (G_OBJECT (cell_view), "use-fg");
}
}
/**
* gtk_cell_view_get_use_fg
* @cell_view: a #GtkCellView
*
* Get whether the #GtkCellView hints the cell renderer that foreground colors
* should be used when rendering text. See gtk_cell_view_set_use_fg().
*
* Returns: The value of the "use-fg" property
*
* Since: 2.12
*/
gboolean
gtk_cell_view_get_use_fg (GtkCellView *cell_view)
{
g_return_val_if_fail (GTK_IS_CELL_VIEW (cell_view), FALSE);
return cell_view->priv->use_fg;
}
/**
* gtk_cell_view_get_cell_renderers:
* @cell_view: a #GtkCellView

View File

@ -67,6 +67,9 @@ gboolean gtk_cell_view_get_size_of_row (GtkCellView *cell_v
void gtk_cell_view_set_background_color (GtkCellView *cell_view,
const GdkColor *color);
void gtk_cell_view_set_use_fg (GtkCellView *cell_view,
gboolean use_fg);
gboolean gtk_cell_view_get_use_fg (GtkCellView *cell_view);
GList *gtk_cell_view_get_cell_renderers (GtkCellView *cell_view);
G_END_DECLS

View File

@ -2569,6 +2569,8 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
if (combo_box->priv->cell_view)
{
gtk_cell_view_set_use_fg (GTK_CELL_VIEW (combo_box->priv->cell_view), TRUE);
combo_box->priv->button = gtk_toggle_button_new ();
gtk_button_set_focus_on_click (GTK_BUTTON (combo_box->priv->button),
combo_box->priv->focus_on_click);
@ -2672,6 +2674,7 @@ gtk_cell_view_menu_item_new (GtkComboBox *combo_box,
GtkRequisition req;
cell_view = gtk_cell_view_new ();
gtk_cell_view_set_use_fg (GTK_CELL_VIEW (cell_view), TRUE);
item = gtk_menu_item_new ();
gtk_container_add (GTK_CONTAINER (item), cell_view);
@ -3377,6 +3380,7 @@ gtk_combo_box_list_setup (GtkComboBox *combo_box)
if (combo_box->priv->cell_view)
{
gtk_cell_view_set_use_fg (GTK_CELL_VIEW (combo_box->priv->cell_view), FALSE);
gtk_cell_view_set_background_color (GTK_CELL_VIEW (combo_box->priv->cell_view),
&GTK_WIDGET (combo_box)->style->base[GTK_WIDGET_STATE (combo_box)]);