mailr16780 - /branches/uf_redesign/gui/about.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on June 08, 2012 - 16:42:
Author: bugman
Date: Fri Jun  8 16:42:05 2012
New Revision: 16780

URL: http://svn.gna.org/viewcvs/relax?rev=16780&view=rev
Log:
The about dialog now used the gui.fonts module.

This allows the fonts to scale to a decent size on Mac OS X, so that the text 
is readable.


Modified:
    branches/uf_redesign/gui/about.py

Modified: branches/uf_redesign/gui/about.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/uf_redesign/gui/about.py?rev=16780&r1=16779&r2=16780&view=diff
==============================================================================
--- branches/uf_redesign/gui/about.py (original)
+++ branches/uf_redesign/gui/about.py Fri Jun  8 16:42:05 2012
@@ -37,6 +37,7 @@
 from status import Status; status = Status()
 
 # relax GUI module imports.
+from gui.fonts import font
 from gui.icons import relax_icons
 
 
@@ -224,15 +225,11 @@
             self.cursor_type = 'normal'
 
 
-    def draw_url(self, url_text=None, point_size=11, 
family=wx.FONTFAMILY_ROMAN, pos_x=0, carriage_ret=False, centre=False):
+    def draw_url(self, url_text=None, pos_x=0, carriage_ret=False, 
centre=False):
         """Draw a URL as a hyperlink.
 
         @keyword url_text:      The text of the url.
         @type url_text:         str
-        @keyword point_size:    The size of the text in points.
-        @type point_size:       int
-        @keyword family:        The font family.
-        @type family:           int
         @keyword pos_x:         The starting x position for the text.
         @type pos_x:            int
         @keyword carriage_ret:  A flag which if True will cause a carriage 
return, by shifting the offset by y.
@@ -246,8 +243,7 @@
         orig_fg = deepcopy(self.dc.GetTextForeground())
 
         # Set the font.
-        font = wx.Font(pointSize=point_size, family=family, style=wx.NORMAL, 
weight=wx.NORMAL)
-        self.dc.SetFont(font)
+        self.dc.SetFont(font.roman_normal)
         self.dc.SetTextForeground('#0017aa')
 
         # The text extent.
@@ -277,12 +273,11 @@
         self.dc.SetTextForeground(orig_fg)
 
 
-    def draw_title(self, text, point_size=14, family=wx.FONTFAMILY_ROMAN):
+    def draw_title(self, text):
         """Draw the title."""
 
         # Set the font.
-        font = wx.Font(point_size, family, wx.NORMAL, wx.NORMAL)
-        self.dc.SetFont(font)
+        self.dc.SetFont(font.roman_title)
 
         # The text extent.
         x, y = self.dc.GetTextExtent(text)
@@ -294,7 +289,7 @@
         self.offset(y)
 
 
-    def draw_wrapped_text(self, text, point_size=10, 
family=wx.FONTFAMILY_ROMAN, spacer=10):
+    def draw_wrapped_text(self, text, spacer=10):
         """Generic method for drawing wrapped text in the relax about widget.
 
         @param text:        The text to wrap and draw.
@@ -304,8 +299,7 @@
         """
 
         # Set the font.
-        font = wx.Font(point_size, family, wx.NORMAL, wx.NORMAL)
-        self.dc.SetFont(font)
+        self.dc.SetFont(font.roman_normal)
 
         # Wrap the text.
         width = self.dim_x - 2*self.border
@@ -328,7 +322,7 @@
             for i in range(len(text_elements)):
                 # URL text.
                 if url[i]:
-                    self.draw_url(point_size=point_size, family=family, 
url_text=text_elements[i], pos_x=pos_x)
+                    self.draw_url(url_text=text_elements[i], pos_x=pos_x)
 
                 # Add the text.
                 else:
@@ -529,8 +523,7 @@
         """Draw the copyright statements."""
 
         # Set the font.
-        font = wx.Font(10, wx.FONTFAMILY_ROMAN, wx.NORMAL, wx.NORMAL)
-        self.dc.SetFont(font)
+        self.dc.SetFont(font.roman_normal)
 
         # The text extent.
         x1, y1 = self.dc.GetTextExtent(self.info.copyright[0])
@@ -554,8 +547,7 @@
         """Draw the relax description text."""
 
         # Set the font.
-        font = wx.Font(12, wx.FONTFAMILY_ROMAN, wx.NORMAL, wx.NORMAL)
-        self.dc.SetFont(font)
+        self.dc.SetFont(font.roman_font_12)
 
         # The text extent.
         x, y = self.dc.GetTextExtent(self.info.desc)




Related Messages


Powered by MHonArc, Updated Fri Jun 08 17:00:01 2012