Changeset 201:1999280506e6


Ignore:
Timestamp:
05/28/12 04:44:39 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Reworked the styling of the wizard pages so that the background of the title is correct on Gtk+ 3 too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/flight.py

    r191 r201  
    3030        self.add(frame)
    3131
    32         style = self.get_style() if pygobject else self.rc_get_style()
    33 
    3432        self._vbox = gtk.VBox()
    3533        self._vbox.set_homogeneous(False)
     
    3735
    3836        eventBox = gtk.EventBox()
    39         eventBox.modify_bg(0, style.bg[3])
    4037
    4138        alignment = gtk.Alignment(xalign = 0.0, xscale = 0.0)
    4239       
    43         label = gtk.Label(title)
    44         label.modify_fg(0, style.fg[3])
    45         label.modify_font(pango.FontDescription("bold 24"))
     40        titleLabel = gtk.Label(title)
     41        titleLabel.modify_font(pango.FontDescription("bold 24"))
    4642        alignment.set_padding(padding_top = 4, padding_bottom = 4,
    4743                              padding_left = 6, padding_right = 0)
    4844                             
    49         alignment.add(label)
     45        alignment.add(titleLabel)
    5046        eventBox.add(alignment)
    5147       
    5248        self._vbox.pack_start(eventBox, False, False, 0)
     49
     50        self._titleEventBox = eventBox
     51        self._titleLabel = titleLabel
    5352
    5453        mainBox = gtk.VBox()       
     
    141140                              clicked = clicked)
    142141
     142    def setStyle(self):
     143        """Set the styles of some of the items on the page."""
     144        style = self.get_style() if pygobject else self.rc_get_style()
     145
     146        self._titleEventBox.modify_bg(0, style.bg[3])
     147        self._titleLabel.modify_fg(0, style.fg[3])
     148   
    143149    def initialize(self):
    144150        """Initialize the page.
     
    25122518        self._finishPage = FinishPage(self)
    25132519        self._pages.append(self._finishPage)
    2514        
     2520
    25152521        maxWidth = 0
    25162522        maxHeight = 0
     
    25222528            maxWidth = max(maxWidth, width)
    25232529            maxHeight = max(maxHeight, height)
     2530            page.setStyle()
    25242531        maxWidth += 16
    25252532        maxHeight += 32
Note: See TracChangeset for help on using the changeset viewer.