Author: johannes
Date: 2007-04-25 03:48:01 -0500 (Wed, 25 Apr 2007)
New Revision: 9513
Modified:
trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
trunk/gnue-forms/src/uidrivers/wx26/widgets/hbox.py
trunk/gnue-forms/src/uidrivers/wx26/widgets/vbox.py
Log:
Add some extra space to widgets on wxMac so focus gets displayed correctly
Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py 2007-04-24 19:15:08 UTC (rev 9512)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/entry.py 2007-04-25 08:48:01 UTC (rev 9513)
@@ -403,13 +403,14 @@
# We set the background color to grey for all kinds of widgets if they
# are not editable, so the user can see some difference.
- if editable:
- colour = wx.NullColour
- else:
- colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)
+ if not 'wxMac' in wx.PlatformInfo:
+ if editable:
+ colour = wx.NullColour
+ else:
+ colour = wx.SystemSettings.GetColour(wx.SYS_COLOUR_BTNFACE)
- self.widgets[index].SetBackgroundColour(colour)
- self.widgets[index].Refresh()
+ self.widgets[index].SetBackgroundColour(colour)
+ self.widgets[index].Refresh()
# -------------------------------------------------------------------------
Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/hbox.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/hbox.py 2007-04-24 19:15:08 UTC (rev 9512)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/hbox.py 2007-04-25 08:48:01 UTC (rev 9513)
@@ -81,7 +81,10 @@
# introduce another sizer.
flags = wx.EXPAND
box = wx.BoxSizer(wx.HORIZONTAL)
- box.Add(item, 1, wx.ALIGN_CENTER)
+ if 'wxMac' in wx.PlatformInfo:
+ box.Add(item, 1, wx.ALIGN_CENTER | wx.ALL, 3)
+ else:
+ box.Add(item, 1, wx.ALIGN_CENTER)
item = box
else:
# Otherwise, align widgets on top.
Modified: trunk/gnue-forms/src/uidrivers/wx26/widgets/vbox.py
===================================================================
--- trunk/gnue-forms/src/uidrivers/wx26/widgets/vbox.py 2007-04-24 19:15:08 UTC (rev 9512)
+++ trunk/gnue-forms/src/uidrivers/wx26/widgets/vbox.py 2007-04-25 08:48:01 UTC (rev 9513)
@@ -83,7 +83,16 @@
pos = (self.last_item, self._entry_pos - 1)
span = (1, 1)
- self._sizer.Add(item, pos, span, wx.EXPAND)
+ if 'wxMac' in wx.PlatformInfo:
+ # On OSX we need a little extra space around the widgets to
+ # see the shiny focus properly.
+ if pos[0] == 0:
+ bfl = wx.TOP | wx.RIGHT
+ else:
+ bfl = wx.RIGHT
+ self._sizer.Add(item, pos, span, wx.EXPAND | bfl, 3)
+ else:
+ self._sizer.Add(item, pos, span, wx.EXPAND)
if add and ui_widget.is_growable():
# FIXME: If a stretch factor is used, the *whole* newly calculated
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.