diff options
| author | gustav_b <gustav_b@users.sourceforge.net> | 2007-09-10 21:20:06 +0000 |
|---|---|---|
| committer | gustav_b <gustav_b@users.sourceforge.net> | 2007-09-10 21:20:06 +0000 |
| commit | 3ffe9a61d1340f0c20034518510fd5c9a71b0142 (patch) | |
| tree | 95b94b0fe7fdc9b44b39f567c67ff5c74435d20c /src/libgdl | |
| parent | tweaking tweaks (diff) | |
| download | inkscape-3ffe9a61d1340f0c20034518510fd5c9a71b0142.tar.gz inkscape-3ffe9a61d1340f0c20034518510fd5c9a71b0142.zip | |
Allow GdlDockItems to take focus, and grab focus on present. Various
cleanups.
(bzr r3718)
Diffstat (limited to 'src/libgdl')
| -rw-r--r-- | src/libgdl/gdl-dock-item-grip.c | 14 | ||||
| -rw-r--r-- | src/libgdl/gdl-dock-item.c | 1 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/libgdl/gdl-dock-item-grip.c b/src/libgdl/gdl-dock-item-grip.c index 7465aefb2..d1ba2372c 100644 --- a/src/libgdl/gdl-dock-item-grip.c +++ b/src/libgdl/gdl-dock-item-grip.c @@ -130,6 +130,7 @@ gdl_dock_item_grip_expose (GtkWidget *widget, GdlDockItemGrip *grip; GdkRectangle title_area; GdkRectangle expose_area; + GtkStyle *bg_style; gint layout_width; gint layout_height; gint text_x; @@ -138,13 +139,12 @@ gdl_dock_item_grip_expose (GtkWidget *widget, grip = GDL_DOCK_ITEM_GRIP (widget); gdl_dock_item_grip_get_title_area (grip, &title_area); - /* draw darker a background */ - gdk_draw_rectangle (GDK_DRAWABLE (widget->window), - gtk_widget_get_style (widget)->dark_gc[widget->state], - TRUE, - 1, 0, - widget->allocation.width - 1, - widget->allocation.height); + /* draw background, highlight it if the dock item has focus */ + bg_style = (GTK_WIDGET_HAS_FOCUS (GTK_WIDGET (grip->item)) ? + gtk_widget_get_style (widget)->mid_gc[widget->state] : + gtk_widget_get_style (widget)->dark_gc[widget->state]); + gdk_draw_rectangle (GDK_DRAWABLE (widget->window), bg_style, TRUE, + 1, 0, widget->allocation.width - 1, widget->allocation.height); if (grip->_priv->icon_pixbuf) { GdkRectangle pixbuf_rect; diff --git a/src/libgdl/gdl-dock-item.c b/src/libgdl/gdl-dock-item.c index d9f805ffe..87fbb41a0 100644 --- a/src/libgdl/gdl-dock-item.c +++ b/src/libgdl/gdl-dock-item.c @@ -355,6 +355,7 @@ static void gdl_dock_item_instance_init (GdlDockItem *item) { GTK_WIDGET_UNSET_FLAGS (GTK_WIDGET (item), GTK_NO_WINDOW); + GTK_WIDGET_SET_FLAGS (GTK_WIDGET (item), GTK_CAN_FOCUS); item->child = NULL; |
