X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkcellrenderer.c;h=c941190d0bb4f1ef849b35f2754a65fbd76c9f7d;hb=b2340254109d8599244c875fe7bc5e234f64da08;hp=609c4a2923354c199e084dd6cae79b74f526d1ea;hpb=0470b91add2fc3fc38b77886a39e2d9ffe18b603;p=~andy%2Fgtk diff --git a/gtk/gtkcellrenderer.c b/gtk/gtkcellrenderer.c index 609c4a292..c941190d0 100644 --- a/gtk/gtkcellrenderer.c +++ b/gtk/gtkcellrenderer.c @@ -12,9 +12,7 @@ * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -43,12 +41,12 @@ * elements on a #cairo_t. Typically, one cell renderer is used to * draw many cells on the screen. To this extent, it isn't expected that a * CellRenderer keep any permanent state around. Instead, any state is set - * just prior to use using #GObjects property system. Then, the + * just prior to use using #GObjects property system. Then, the * cell is measured using gtk_cell_renderer_get_size(). Finally, the cell * is rendered in the correct location using gtk_cell_renderer_render(). * * There are a number of rules that must be followed when writing a new - * #GtkCellRenderer. First and formost, its important that a certain set + * #GtkCellRenderer. First and foremost, its important that a certain set * of properties will always yield a cell renderer of the same size, * barring a #GtkStyle change. The #GtkCellRenderer also has a number of * generic properties that are expected to be honored by all children. @@ -62,6 +60,11 @@ * To make a cell renderer activatable or editable, you have to * implement the #GtkCellRendererClass.activate or * #GtkCellRendererClass.start_editing virtual functions, respectively. + * + * Many properties of #GtkCellRenderer and its subclasses have a + * corresponding "set" property, e.g. "cell-background-set" corresponds + * to "cell-background". These "set" properties reflect whether a property + * has been set or not. You should not set them independently. */ @@ -380,13 +383,20 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class) NULL, GTK_PARAM_WRITABLE)); + /** + * GtkCellRenderer:cell-background-gdk: + * + * Cell background as a #GdkColor + * + * Deprecated: 3.4: Use #GtkCellRenderer:cell-background-rgba instead. + */ g_object_class_install_property (object_class, PROP_CELL_BACKGROUND_GDK, g_param_spec_boxed ("cell-background-gdk", P_("Cell background color"), P_("Cell background color as a GdkColor"), GDK_TYPE_COLOR, - GTK_PARAM_READWRITE)); + GTK_PARAM_READWRITE | G_PARAM_DEPRECATED)); /** * GtkCellRenderer:cell-background-rgba: * @@ -415,7 +425,7 @@ gtk_cell_renderer_class_init (GtkCellRendererClass *class) ADD_SET_PROP ("cell-background-set", PROP_CELL_BACKGROUND_SET, P_("Cell background set"), - P_("Whether this tag affects the cell background color")); + P_("Whether the cell background color is set")); g_type_class_add_private (class, sizeof (GtkCellRendererPrivate)); @@ -858,6 +868,8 @@ gtk_cell_renderer_start_editing (GtkCellRenderer *cell, (GdkRectangle *) background_area, (GdkRectangle *) cell_area, flags); + gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (editable)), + GTK_STYLE_CLASS_CELL); g_signal_emit (cell, cell_renderer_signals[EDITING_STARTED], 0, @@ -1742,7 +1754,12 @@ gtk_cell_renderer_get_state (GtkCellRenderer *cell, g_return_val_if_fail (!cell || GTK_IS_CELL_RENDERER (cell), 0); g_return_val_if_fail (!widget || GTK_IS_WIDGET (widget), 0); - if ((widget && !gtk_widget_is_sensitive (widget)) || + if (widget) + state |= gtk_widget_get_state_flags (widget); + + state &= ~(GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED); + + if ((state & GTK_STATE_FLAG_INSENSITIVE) != 0 || (cell && !gtk_cell_renderer_get_sensitive (cell)) || (cell_state & GTK_CELL_RENDERER_INSENSITIVE) != 0) {