widget: Remove state-flags leftovers

This commit is contained in:
Timm Bäder
2016-11-01 20:28:28 +01:00
parent 6dddf0447e
commit 773c16076b
5 changed files with 10 additions and 71 deletions

View File

@@ -140,8 +140,8 @@ static void gtk_button_update_state (GtkButton *button);
static void gtk_button_finish_activate (GtkButton *button,
gboolean do_it);
static void gtk_button_state_changed (GtkWidget *widget,
GtkStateType previous_state);
static void gtk_button_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state);
static void gtk_button_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_button_do_release (GtkButton *button,
@@ -229,7 +229,7 @@ gtk_button_class_init (GtkButtonClass *klass)
widget_class->key_release_event = gtk_button_key_release;
widget_class->enter_notify_event = gtk_button_enter_notify;
widget_class->leave_notify_event = gtk_button_leave_notify;
widget_class->state_changed = gtk_button_state_changed;
widget_class->state_flags_changed = gtk_button_state_flags_changed;
widget_class->grab_notify = gtk_button_grab_notify;
container_class->add = gtk_button_add;
@@ -1290,8 +1290,8 @@ gtk_button_screen_changed (GtkWidget *widget,
}
static void
gtk_button_state_changed (GtkWidget *widget,
GtkStateType previous_state)
gtk_button_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state)
{
GtkButton *button = GTK_BUTTON (widget);

View File

@@ -326,9 +326,6 @@ gtk_cell_renderer_spinner_get_size (GtkCellRenderer *cellr,
static void
gtk_paint_spinner (GtkStyleContext *context,
cairo_t *cr,
GtkStateType state_type,
GtkWidget *widget,
const gchar *detail,
guint step,
gint x,
gint y,
@@ -400,7 +397,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
{
GtkCellRendererSpinner *cell = GTK_CELL_RENDERER_SPINNER (cellr);
GtkCellRendererSpinnerPrivate *priv = cell->priv;
GtkStateType state;
GdkRectangle pix_rect;
GdkRectangle draw_rect;
gint xpad, ypad;
@@ -424,25 +420,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
if (!gdk_rectangle_intersect (cell_area, &pix_rect, &draw_rect))
return;
state = GTK_STATE_NORMAL;
if ((gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_INSENSITIVE) ||
!gtk_cell_renderer_get_sensitive (cellr))
{
state = GTK_STATE_INSENSITIVE;
}
else
{
if ((flags & GTK_CELL_RENDERER_SELECTED) != 0)
{
if (gtk_widget_has_focus (widget))
state = GTK_STATE_SELECTED;
else
state = GTK_STATE_ACTIVE;
}
else
state = GTK_STATE_PRELIGHT;
}
cairo_save (cr);
gdk_cairo_rectangle (cr, cell_area);
@@ -450,9 +427,6 @@ gtk_cell_renderer_spinner_render (GtkCellRenderer *cellr,
gtk_paint_spinner (gtk_widget_get_style_context (widget),
cr,
state,
widget,
"cell",
priv->pulse,
draw_rect.x, draw_rect.y,
draw_rect.width, draw_rect.height);

View File

@@ -481,39 +481,6 @@ typedef enum
/* Widget states */
/**
* GtkStateType:
* @GTK_STATE_NORMAL: State during normal operation.
* @GTK_STATE_ACTIVE: State of a currently active widget, such as a depressed button.
* @GTK_STATE_PRELIGHT: State indicating that the mouse pointer is over
* the widget and the widget will respond to mouse clicks.
* @GTK_STATE_SELECTED: State of a selected item, such the selected row in a list.
* @GTK_STATE_INSENSITIVE: State indicating that the widget is
* unresponsive to user actions.
* @GTK_STATE_INCONSISTENT: The widget is inconsistent, such as checkbuttons
* or radiobuttons that arent either set to %TRUE nor %FALSE,
* or buttons requiring the user attention.
* @GTK_STATE_FOCUSED: The widget has the keyboard focus.
*
* This type indicates the current state of a widget; the state determines how
* the widget is drawn. The #GtkStateType enumeration is also used to
* identify different colors in a #GtkStyle for drawing, so states can be
* used for subparts of a widget as well as entire widgets.
*
* Deprecated: 3.14: All APIs that are using this enumeration have been deprecated
* in favor of alternatives using #GtkStateFlags.
*/
typedef enum
{
GTK_STATE_NORMAL,
GTK_STATE_ACTIVE,
GTK_STATE_PRELIGHT,
GTK_STATE_SELECTED,
GTK_STATE_INSENSITIVE,
GTK_STATE_INCONSISTENT,
GTK_STATE_FOCUSED
} GtkStateType;
/**
* GtkToolbarStyle:
* @GTK_TOOLBAR_ICONS: Buttons display only icons in the toolbar.

View File

@@ -155,8 +155,8 @@ static gboolean gtk_path_bar_slider_button_release(GtkWidget *widget,
GtkPathBar *path_bar);
static void gtk_path_bar_grab_notify (GtkWidget *widget,
gboolean was_grabbed);
static void gtk_path_bar_state_changed (GtkWidget *widget,
GtkStateType previous_state);
static void gtk_path_bar_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state);
static void gtk_path_bar_style_updated (GtkWidget *widget);
static void gtk_path_bar_screen_changed (GtkWidget *widget,
GdkScreen *previous_screen);
@@ -231,7 +231,7 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
widget_class->style_updated = gtk_path_bar_style_updated;
widget_class->screen_changed = gtk_path_bar_screen_changed;
widget_class->grab_notify = gtk_path_bar_grab_notify;
widget_class->state_changed = gtk_path_bar_state_changed;
widget_class->state_flags_changed = gtk_path_bar_state_flags_changed;
widget_class->scroll_event = gtk_path_bar_scroll;
container_class->add = gtk_path_bar_add;
@@ -1099,8 +1099,8 @@ gtk_path_bar_grab_notify (GtkWidget *widget,
}
static void
gtk_path_bar_state_changed (GtkWidget *widget,
GtkStateType previous_state)
gtk_path_bar_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_state)
{
if (!gtk_widget_is_sensitive (widget))
gtk_path_bar_stop_scrolling (GTK_PATH_BAR (widget));

View File

@@ -342,8 +342,6 @@ struct _GtkWidgetClass
void (* unrealize) (GtkWidget *widget);
void (* size_allocate) (GtkWidget *widget,
GtkAllocation *allocation);
void (* state_changed) (GtkWidget *widget,
GtkStateType previous_state);
void (* state_flags_changed) (GtkWidget *widget,
GtkStateFlags previous_state_flags);
void (* parent_set) (GtkWidget *widget,