changeset 1729:570a03dabdc2

Slight improvement... check the flat flags and adjust the required size and minimum sizes for the widget.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 15 May 2012 06:49:27 +0000
parents aa2bd0d8bf27
children 3828f3faec8c
files win/dw.c
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Tue May 15 06:37:39 2012 +0000
+++ b/win/dw.c	Tue May 15 06:49:27 2012 +0000
@@ -1511,12 +1511,17 @@
                HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0);
                int thiswidth = 20, thisheight = 20, minsize = 24;
 
+               if(imlist)
+                  ImageList_GetIconSize(imlist, &thiswidth, &thisheight);
+                  
                /* If we are flat the size can be smaller */
                if(GetWindowLong(handle, GWL_STYLE) & TBSTYLE_FLAT)
                   minsize = 20;
-                  
-               if(imlist)
-                  ImageList_GetIconSize(imlist, &thiswidth, &thisheight);
+               else
+               {
+                  thiswidth += 4;
+                  thisheight += 4;
+               }
                   
                if(thiswidth < minsize)
                   thiswidth = minsize;
@@ -4662,13 +4667,18 @@
       HIMAGELIST imlist = (HIMAGELIST)SendMessage(handle, TB_GETIMAGELIST, 0, 0);
       int minsize = 24;
       
+      if(imlist)
+         ImageList_GetIconSize(imlist, &thiswidth, &thisheight);
+
       /* If we are flat the size can be smaller */
       if(GetWindowLong(handle, GWL_STYLE) & TBSTYLE_FLAT)
          minsize = 20;
+      else
+      {
+         thiswidth += 4;
+         thisheight += 4;
+      }
          
-      if(imlist)
-         ImageList_GetIconSize(imlist, &thiswidth, &thisheight);
-
       if(thiswidth < minsize)
          thiswidth = minsize;
       if(thisheight < minsize)