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

Attempted to make the General tab of the Preferences dialog better looking

File:
1 edited

Legend:

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

    r183 r186  
    299299        mainAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
    300300                                      xscale = 1.0, yscale = 0.0)
    301         mainAlignment.set_padding(padding_top = 16, padding_bottom = 8,
     301        mainAlignment.set_padding(padding_top = 0, padding_bottom = 8,
    302302                                  padding_left = 4, padding_right = 4)
    303303        mainBox = gtk.VBox()
    304304        mainAlignment.add(mainBox)
    305305
     306        guiBox = self._createFrame(mainBox, xstr("prefs_frame_gui"))
     307       
    306308        languageBox = gtk.HBox()
    307         mainBox.pack_start(languageBox, False, False, 4)
     309        guiBox.pack_start(languageBox, False, False, 4)
    308310
    309311        label = gtk.Label(xstr("prefs_language"))
     
    334336        self._hideMinimizedWindow.set_use_underline(True)
    335337        self._hideMinimizedWindow.set_tooltip_text(xstr("prefs_hideMinimizedWindow_tooltip"))
    336         mainBox.pack_start(self._hideMinimizedWindow, False, False, 4)
     338        guiBox.pack_start(self._hideMinimizedWindow, False, False, 4)
     339
     340        onlineBox = self._createFrame(mainBox, xstr("prefs_frame_online"))       
    337341
    338342        self._onlineGateSystem = gtk.CheckButton(xstr("prefs_onlineGateSystem"))
    339343        self._onlineGateSystem.set_use_underline(True)
    340344        self._onlineGateSystem.set_tooltip_text(xstr("prefs_onlineGateSystem_tooltip"))
    341         mainBox.pack_start(self._onlineGateSystem, False, False, 4)
     345        onlineBox.pack_start(self._onlineGateSystem, False, False, 4)
    342346
    343347        self._onlineACARS = gtk.CheckButton(xstr("prefs_onlineACARS"))
    344348        self._onlineACARS.set_use_underline(True)
    345349        self._onlineACARS.set_tooltip_text(xstr("prefs_onlineACARS_tooltip"))
    346         mainBox.pack_start(self._onlineACARS, False, False, 4)
     350        onlineBox.pack_start(self._onlineACARS, False, False, 4)
     351
     352        simulatorBox = self._createFrame(mainBox, xstr("prefs_frame_simulator"))
    347353
    348354        self._flareTimeFromFS = gtk.CheckButton(xstr("prefs_flaretimeFromFS"))
    349355        self._flareTimeFromFS.set_use_underline(True)
    350356        self._flareTimeFromFS.set_tooltip_text(xstr("prefs_flaretimeFromFS_tooltip"))
    351         mainBox.pack_start(self._flareTimeFromFS, False, False, 4)
     357        simulatorBox.pack_start(self._flareTimeFromFS, False, False, 4)
    352358                                       
    353359        self._syncFSTime = gtk.CheckButton(xstr("prefs_syncFSTime"))
    354360        self._syncFSTime.set_use_underline(True)
    355361        self._syncFSTime.set_tooltip_text(xstr("prefs_syncFSTime_tooltip"))
    356         mainBox.pack_start(self._syncFSTime, False, False, 4)
     362        simulatorBox.pack_start(self._syncFSTime, False, False, 4)
    357363
    358364        self._usingFS2Crew = gtk.CheckButton(xstr("prefs_usingFS2Crew"))
    359365        self._usingFS2Crew.set_use_underline(True)
    360366        self._usingFS2Crew.set_tooltip_text(xstr("prefs_usingFS2Crew_tooltip"))
    361         mainBox.pack_start(self._usingFS2Crew, False, False, 4)
     367        simulatorBox.pack_start(self._usingFS2Crew, False, False, 4)
    362368
    363369        pirepBox = gtk.HBox()
    364         mainBox.pack_start(pirepBox, False, False, 4)
     370        mainBox.pack_start(pirepBox, False, False, 8)
    365371
    366372        label = gtk.Label(xstr("prefs_pirepDirectory"))
     
    379385       
    380386        return mainAlignment
     387
     388    def _createFrame(self, mainBox, label):
     389        """Create a frame with an inner alignment and VBox.
     390
     391        Return the vbox."""
     392        frame = gtk.Frame(label = label)
     393        mainBox.pack_start(frame, False, False, 4)
     394        alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
     395                                  xscale = 1.0, yscale = 0.0)
     396        alignment.set_padding(padding_top = 4, padding_bottom = 0,
     397                              padding_left = 0, padding_right = 0)
     398        frame.add(alignment)
     399        vbox = gtk.VBox()
     400        alignment.add(vbox)
     401
     402        return vbox
    381403
    382404    def _setLanguage(self, language):
Note: See TracChangeset for help on using the changeset viewer.