[gnome-disk-utility/udisks2-port] GduVolumeGrid: check if pointer inside before adjusting width/height
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] GduVolumeGrid: check if pointer inside before adjusting width/height
- Date: Thu, 24 Nov 2011 14:56:56 +0000 (UTC)
commit 7fb22a9b8f084c45521698434831b787d1de0f13
Author: David Zeuthen <davidz redhat com>
Date: Thu Nov 24 09:56:20 2011 -0500
GduVolumeGrid: check if pointer inside before adjusting width/height
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gduvolumegrid.c | 33 +++++++++++++++++----------------
1 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/src/palimpsest/gduvolumegrid.c b/src/palimpsest/gduvolumegrid.c
index 2079aa8..dc66470 100644
--- a/src/palimpsest/gduvolumegrid.c
+++ b/src/palimpsest/gduvolumegrid.c
@@ -859,6 +859,23 @@ render_element (GduVolumeGrid *grid,
context = gtk_widget_get_style_context (GTK_WIDGET (grid));
gtk_style_context_save (context);
+
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_NOTEBOOK);
+ gtk_style_context_add_class (context, "gnome-disk-utility-grid");
+ state = gtk_widget_get_state_flags (GTK_WIDGET (grid));
+ if (grid->pointer_inside)
+ {
+ gint px, py;
+ gtk_widget_get_pointer (GTK_WIDGET (grid), &px, &py);
+ if (px >= x && px < x + w && py >= y && py < y + h)
+ state |= GTK_STATE_FLAG_PRELIGHT;
+ }
+ if (is_selected)
+ state |= GTK_STATE_FLAG_SELECTED;
+ if (is_grid_focused)
+ state |= GTK_STATE_FLAG_FOCUSED;
+ gtk_style_context_set_state (context, state);
+
sides = GTK_JUNCTION_NONE;
if (!(element->edge_flags & GRID_EDGE_TOP))
{
@@ -880,22 +897,6 @@ render_element (GduVolumeGrid *grid,
}
gtk_style_context_set_junction_sides (context, sides);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_NOTEBOOK);
- gtk_style_context_add_class (context, "gnome-disk-utility-grid");
- state = gtk_widget_get_state_flags (GTK_WIDGET (grid));
- if (grid->pointer_inside)
- {
- gint px, py;
- gtk_widget_get_pointer (GTK_WIDGET (grid), &px, &py);
- if (px >= x && px < x + w && py >= y && py < y + h)
- state |= GTK_STATE_FLAG_PRELIGHT;
- }
- if (is_selected)
- state |= GTK_STATE_FLAG_SELECTED;
- if (is_grid_focused)
- state |= GTK_STATE_FLAG_FOCUSED;
- gtk_style_context_set_state (context, state);
-
gtk_render_background (context, cr, x, y, w, h);
gtk_render_frame (context, cr, x, y, w, h);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]