]> git.saurik.com Git - wxWidgets.git/commitdiff
Trying to get default button placement and size right.
authorRobert Roebling <robert@roebling.de>
Fri, 4 Mar 2005 19:14:24 +0000 (19:14 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 4 Mar 2005 19:14:24 +0000 (19:14 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp
src/gtk1/window.cpp

index dbc991b9b21a00ef8195976cf49a809829ebfde7..969e4b655f125158df3a25397b118599825a6305 100644 (file)
@@ -3102,22 +3102,49 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
         if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
         if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;
 
         if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
         if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;
 
-        int border = 0;
+        int left_border = 0;
+        int right_border = 0;
+        int top_border = 0;
         int bottom_border = 0;
 
         int bottom_border = 0;
 
-#ifndef __WXGTK20__
+        /* the default button has a border around it */
         if (GTK_WIDGET_CAN_DEFAULT(m_widget))
         {
         if (GTK_WIDGET_CAN_DEFAULT(m_widget))
         {
-            /* the default button has a border around it */
-            border = 6;
+#ifdef __WXGTK20__
+#if 0
+            GtkBorder *default_border;
+            gtk_widget_style_get( m_widget, "default_border", &default_border, NULL );
+            if (default_border)
+            {
+                left_border += default_border->left;
+                right_border += default_border->right;
+                top_border += default_border->top;
+                bottom_border += default_border->bottom;
+                g_free( default_border );
+                
+            }
+#endif
+            GtkBorder *default_outside_border;
+            {
+                gtk_widget_style_get( m_widget, "default_outside_border", &default_outside_border, NULL );
+                left_border += default_outside_border->left;
+                right_border += default_outside_border->right;
+                top_border += default_outside_border->top;
+                bottom_border += default_outside_border->bottom;
+                g_free( default_outside_border );
+            }
+#else
+            left_border = 6;
+            right_border = 6;
+            top_border = 6;
             bottom_border = 5;
             bottom_border = 5;
-        }
 #endif
 #endif
+        }
 
 
-        DoMoveWindow( m_x-border,
-                      m_y-border,
-                      m_width+2*border,
-                      m_height+border+bottom_border );
+        DoMoveWindow( m_x-top_border,
+                      m_y-left_border,
+                      m_width+left_border+right_border,
+                      m_height+top_border+bottom_border );
     }
 
     if (m_hasScrolling)
     }
 
     if (m_hasScrolling)
index dbc991b9b21a00ef8195976cf49a809829ebfde7..969e4b655f125158df3a25397b118599825a6305 100644 (file)
@@ -3102,22 +3102,49 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
         if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
         if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;
 
         if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
         if ((maxHeight != -1) && (m_height > maxHeight)) m_height = maxHeight;
 
-        int border = 0;
+        int left_border = 0;
+        int right_border = 0;
+        int top_border = 0;
         int bottom_border = 0;
 
         int bottom_border = 0;
 
-#ifndef __WXGTK20__
+        /* the default button has a border around it */
         if (GTK_WIDGET_CAN_DEFAULT(m_widget))
         {
         if (GTK_WIDGET_CAN_DEFAULT(m_widget))
         {
-            /* the default button has a border around it */
-            border = 6;
+#ifdef __WXGTK20__
+#if 0
+            GtkBorder *default_border;
+            gtk_widget_style_get( m_widget, "default_border", &default_border, NULL );
+            if (default_border)
+            {
+                left_border += default_border->left;
+                right_border += default_border->right;
+                top_border += default_border->top;
+                bottom_border += default_border->bottom;
+                g_free( default_border );
+                
+            }
+#endif
+            GtkBorder *default_outside_border;
+            {
+                gtk_widget_style_get( m_widget, "default_outside_border", &default_outside_border, NULL );
+                left_border += default_outside_border->left;
+                right_border += default_outside_border->right;
+                top_border += default_outside_border->top;
+                bottom_border += default_outside_border->bottom;
+                g_free( default_outside_border );
+            }
+#else
+            left_border = 6;
+            right_border = 6;
+            top_border = 6;
             bottom_border = 5;
             bottom_border = 5;
-        }
 #endif
 #endif
+        }
 
 
-        DoMoveWindow( m_x-border,
-                      m_y-border,
-                      m_width+2*border,
-                      m_height+border+bottom_border );
+        DoMoveWindow( m_x-top_border,
+                      m_y-left_border,
+                      m_width+left_border+right_border,
+                      m_height+top_border+bottom_border );
     }
 
     if (m_hasScrolling)
     }
 
     if (m_hasScrolling)