]> git.saurik.com Git - wxWidgets.git/blobdiff - src/aui/tabartgtk.cpp
Only give capture to wxPopupTransientWindow child if it's the only one.
[wxWidgets.git] / src / aui / tabartgtk.cpp
index 5c2bfb417f5e6b2c9299b1a41563a502c08153b2..1c86fbe9d03baab69316ca501e59bc02426c1dc3 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Jens Lody and Teodor Petrov
 // Modified by:
 // Created:     2012-03-23
 // Author:      Jens Lody and Teodor Petrov
 // Modified by:
 // Created:     2012-03-23
-// RCS-ID:      $Id$
 // Copyright:   (c) 2012 Jens Lody <jens@codeblocks.org>
 //                  and Teodor Petrov
 // Licence:     wxWindows licence
 // Copyright:   (c) 2012 Jens Lody <jens@codeblocks.org>
 //                  and Teodor Petrov
 // Licence:     wxWindows licence
@@ -79,6 +78,23 @@ void wxAuiGtkTabArt::DrawBackground(wxDC& dc, wxWindow* WXUNUSED(wnd), const wxR
                                        rect.x, rect.y, rect.width, rect.height);
 }
 
                                        rect.x, rect.y, rect.width, rect.height);
 }
 
+void wxAuiGtkTabArt::DrawBorder(wxDC& WXUNUSED(dc), wxWindow* wnd, const wxRect& rect)
+{
+    int generic_border_width = wxAuiGenericTabArt::GetBorderWidth(wnd);
+
+    if (!wnd) return;
+    if (!wnd->m_wxwindow) return;
+    if (!gtk_widget_is_drawable(wnd->m_wxwindow)) return;
+
+    GtkStyle *style_notebook = gtk_widget_get_style(wxGTKPrivate::GetNotebookWidget());
+
+    gtk_paint_box(style_notebook, wnd->GTKGetDrawingWindow(), GTK_STATE_NORMAL, GTK_SHADOW_OUT,
+                  NULL, wnd->m_wxwindow,
+                  const_cast<char*>("notebook"),
+                  rect.x + generic_border_width + 1, rect.y + generic_border_width + 1,
+                  rect.width - (generic_border_width + 1), rect.height - (generic_border_width + 1));
+}
+
 void ButtonStateAndShadow(int button_state, GtkStateType &state, GtkShadowType &shadow)
 {
 
 void ButtonStateAndShadow(int button_state, GtkStateType &state, GtkShadowType &shadow)
 {
 
@@ -366,7 +382,8 @@ void wxAuiGtkTabArt::DrawTab(wxDC& dc, wxWindow* wnd, const wxAuiNotebookPage& p
         *out_button_rect = DrawCloseButton(dc, widget, close_button_state, rect, wxRIGHT, &area);
     }
 
         *out_button_rect = DrawCloseButton(dc, widget, close_button_state, rect, wxRIGHT, &area);
     }
 
-    tab_rect.width = std::min(tab_rect.width, clip_width);
+    if ( clip_width < tab_rect.width )
+        tab_rect.width = clip_width;
     *out_tab_rect = tab_rect;
 
     dc.DestroyClippingRegion();
     *out_tab_rect = tab_rect;
 
     dc.DestroyClippingRegion();
@@ -464,6 +481,17 @@ int wxAuiGtkTabArt::GetBestTabCtrlSize(wxWindow* wnd,
     return tab_height;
 }
 
     return tab_height;
 }
 
+int wxAuiGtkTabArt::GetBorderWidth(wxWindow* wnd)
+{
+    return wxAuiGenericTabArt::GetBorderWidth(wnd) + wxMax(GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_hborder,
+                                                           GTK_NOTEBOOK (wxGTKPrivate::GetNotebookWidget())->tab_vborder);
+}
+
+int wxAuiGtkTabArt::GetAdditionalBorderSpace(wxWindow* wnd)
+{
+    return 2 * GetBorderWidth(wnd);
+}
+
 wxSize wxAuiGtkTabArt::GetTabSize(wxDC& dc,
                               wxWindow* wnd,
                               const wxString& caption,
 wxSize wxAuiGtkTabArt::GetTabSize(wxDC& dc,
                               wxWindow* wnd,
                               const wxString& caption,