~ubuntu-branches/ubuntu/maverick/poedit/maverick

« back to all changes in this revision

Viewing changes to build/wx-2.8.7-mac-listctrl-attributes.patch

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2008-09-16 19:47:00 UTC
  • mfrom: (0.2.9 upstream) (1.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20080916194700-ueyef0pgklk3u50k
Tags: 1.4.2-2
Adding debug package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: include/wx/mac/carbon/listctrl.h
 
2
===================================================================
 
3
--- include/wx/mac/carbon/listctrl.h    (revision 51611)
 
4
+++ include/wx/mac/carbon/listctrl.h    (working copy)
 
5
@@ -365,6 +365,17 @@
 
6
   void MacSetDrawingContext(void* context) { m_cgContext = context; }
 
7
   void* MacGetDrawingContext() { return m_cgContext; }
 
8
 
 
9
+
 
10
+#if wxABI_VERSION >= 20808
 
11
+  virtual wxVisualAttributes GetDefaultAttributes() const
 
12
+  {
 
13
+      return GetClassDefaultAttributes(GetWindowVariant());
 
14
+  }
 
15
+
 
16
+  static wxVisualAttributes
 
17
+  GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
 
18
+#endif // wxABI_VERSION >= 20808
 
19
+
 
20
 protected:
 
21
 
 
22
   // protected overrides needed for pimpl approach
 
23
Index: src/mac/carbon/listctrl_mac.cpp
 
24
===================================================================
 
25
--- src/mac/carbon/listctrl_mac.cpp     (revision 52040)
 
26
+++ src/mac/carbon/listctrl_mac.cpp     (working copy)
 
27
@@ -752,6 +752,12 @@
 
28
             (EventHandlerRef *)&m_macListCtrlEventHandler);
 
29
     }
 
30
 
 
31
+    // set the default font to slightly smaller font that the native
 
32
+    // DataBrowser control uses:
 
33
+    wxFont font;
 
34
+    font.MacCreateThemeFont(kThemeViewsFont);
 
35
+    m_font = font;
 
36
+
 
37
     return true;
 
38
 }
 
39
 
 
40
@@ -772,6 +778,18 @@
 
41
     delete m_renameTimer;
 
42
 }
 
43
 
 
44
+/*static*/
 
45
+wxVisualAttributes wxListCtrl::GetClassDefaultAttributes(wxWindowVariant variant)
 
46
+{
 
47
+    wxVisualAttributes attr;
 
48
+
 
49
+    attr.colFg = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
 
50
+    attr.colBg = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOX);
 
51
+    attr.font.MacCreateThemeFont(kThemeViewsFont);
 
52
+
 
53
+    return attr;
 
54
+}
 
55
+
 
56
 // ----------------------------------------------------------------------------
 
57
 // set/get/change style
 
58
 // ----------------------------------------------------------------------------
 
59
@@ -2707,9 +2725,8 @@
 
60
     if (bgColor == wxNullColour)
 
61
         bgColor = listBgColor;
 
62
 
 
63
-    wxFont listFont = list->GetFont();
 
64
-    if (font == wxNullFont)
 
65
-        font = listFont;
 
66
+    if (!font.Ok())
 
67
+        font = list->GetFont();
 
68
 
 
69
     wxMacCFStringHolder cfString;
 
70
     cfString.Assign( text, wxLocale::GetSystemEncoding() );
 
71
@@ -2832,8 +2849,7 @@
 
72
 
 
73
     if (font.Ok())
 
74
     {
 
75
-        if (font.GetFamily() != wxFONTFAMILY_DEFAULT)
 
76
-            info.fontID = font.MacGetThemeFontID();
 
77
+        info.fontID = font.MacGetThemeFontID();
 
78
 
 
79
         ::TextSize( (short)(font.MacGetFontSize()) ) ;
 
80
         ::TextFace( font.MacGetFontStyle() ) ;