]> git.saurik.com Git - wxWidgets.git/commitdiff
Support hover over effect for DrawHeaderButton for GTK+
authorRobert Roebling <robert@roebling.de>
Sat, 20 Oct 2007 10:20:29 +0000 (10:20 +0000)
committerRobert Roebling <robert@roebling.de>
Sat, 20 Oct 2007 10:20:29 +0000 (10:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/renderer.cpp

index 5be8e518065a023d006c2c96cfbdb9af769c2d37..9ce50741380d619ab70f08c0a65e511c5423fc97 100644 (file)
@@ -235,11 +235,20 @@ wxRendererGTK::DrawHeaderButton(wxWindow *win,
     if (win->GetLayoutDirection() == wxLayout_RightToLeft)
         x_diff = rect.width;
 
     if (win->GetLayoutDirection() == wxLayout_RightToLeft)
         x_diff = rect.width;
 
+    GtkStateType state = GTK_STATE_NORMAL;
+    if (flags & wxCONTROL_DISABLED)
+        state = GTK_STATE_INSENSITIVE;
+    else
+    {
+        if (flags & wxCONTROL_CURRENT)
+            state = GTK_STATE_PRELIGHT;
+    }
+
     gtk_paint_box
     (
         button->style,
         gdk_window,
     gtk_paint_box
     (
         button->style,
         gdk_window,
-        flags & wxCONTROL_DISABLED ? GTK_STATE_INSENSITIVE : GTK_STATE_NORMAL,
+        state,
         GTK_SHADOW_OUT,
         NULL,
         button,
         GTK_SHADOW_OUT,
         NULL,
         button,