]> git.saurik.com Git - wxWidgets.git/blobdiff - src/ribbon/art_msw.cpp
Enhance wxRibbonToolBar functionality to wxRibbonButtonBar level.
[wxWidgets.git] / src / ribbon / art_msw.cpp
index f10d562083f2167f83fcd9e10f3252919bc2e7f3..312148f1c667bc730d57b078ed9c8b0414c0da68 100644 (file)
@@ -2262,6 +2262,12 @@ void wxRibbonMSWArtProvider::DrawTool(
                 wxRibbonButtonKind kind,
                 long state)
 {
+    if(kind == wxRIBBON_BUTTON_TOGGLE)
+    {
+        if(state & wxRIBBON_TOOLBAR_TOOL_TOGGLED)
+            state ^= wxRIBBON_TOOLBAR_TOOL_ACTIVE_MASK;
+    }
+
     wxRect bg_rect(rect);
     bg_rect.Deflate(1);
     if((state & wxRIBBON_TOOLBAR_TOOL_LAST) == 0)
@@ -2332,7 +2338,7 @@ void wxRibbonMSWArtProvider::DrawTool(
 
     // Foreground
     int avail_width = bg_rect.GetWidth();
-    if(kind != wxRIBBON_BUTTON_NORMAL)
+    if(kind & wxRIBBON_BUTTON_DROPDOWN)
     {
         avail_width -= 8;
         if(is_split_hybrid)
@@ -2782,7 +2788,7 @@ wxSize wxRibbonMSWArtProvider::GetToolSize(
     size.IncBy(7, 6);
     if(is_last)
         size.IncBy(1, 0);
-    if(kind != wxRIBBON_BUTTON_NORMAL)
+    if(kind & wxRIBBON_BUTTON_DROPDOWN)
     {
         size.IncBy(8, 0);
         if(dropdown_region)