Changeset 989:d60ebbdef36c


Ignore:
Timestamp:
06/27/19 18:48:47 (5 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
python3
Phase:
public
Message:

The width of the fuel page has been significantly reduced (re #347).

File:
1 edited

Legend:

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

    r954 r989  
    32603260        self.expectedWeight = currentWeight
    32613261
    3262         label = gtk.Label("<b>" + name + "</b>")
     3262        self._label = label = gtk.Label("<b>" + name + "</b>")
    32633263        label.set_use_markup(True)
    32643264        label.set_use_underline(True)
    32653265        label.set_justify(JUSTIFY_CENTER)
    32663266        label.set_alignment(0.5, 1.0)
    3267         self.pack_start(label, False, False, 4)
    32683267
    32693268        self._tankFigure = gtk.EventBox()
    3270         self._tankFigure.set_size_request(38, -1)
     3269        self._tankFigure.set_size_request(38, 200)
    32713270        self._tankFigure.set_visible_window(False)
    32723271        self._tankFigure.set_tooltip_markup(xstr("fuel_tank_tooltip"))
     
    32973296        label.set_mnemonic_widget(self._expectedButton)
    32983297
    3299         alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
    3300                                   xscale = 0.0, yscale = 1.0)
    3301         alignment.add(self._expectedButton)
    3302         self.pack_start(alignment, False, False, 4)
     3298    @property
     3299    def label(self):
     3300        """Get the label with the caption."""
     3301        return self._label
     3302
     3303    @property
     3304    def expectedButton(self):
     3305        """Get the button containing the expected value."""
     3306        return self._expectedButton
    33033307
    33043308    def setCurrent(self, currentWeight):
     
    34963500
    34973501        self._fuelTanks = []
    3498         self._fuelTable = gtk.Table(numTanks, 1)
    3499         self._fuelTable.set_col_spacings(16)
     3502        self._fuelTable = gtk.Grid()
     3503        self._fuelTable.set_column_homogeneous(True)
     3504        self._fuelTable.set_row_spacing(4)
    35003505        index = 0
    35013506        for (tank, current, capacity) in tankData:
     
    35043509                                     const.fuelTank2string(tank)),
    35053510                                capacity, current)
    3506             self._fuelTable.attach(fuelTank, index, index+1, 0, 1)
    35073511            self._fuelTanks.append(fuelTank)
     3512
     3513            alignment = gtk.Alignment(xalign = 0.5, yalign = 1.0,
     3514                                      xscale = 1.0, yscale = 0.0)
     3515            alignment.add(fuelTank.label)
     3516            self._fuelTable.attach(alignment, index*2, 0, 3, 1)
     3517
     3518            alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3519                                      xscale = 0.0, yscale = 1.0)
     3520            alignment.add(fuelTank)
     3521            self._fuelTable.attach(alignment, index*2+1, 1, 1, 1)
     3522
     3523
     3524            alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,
     3525                                      xscale = 1.0, yscale = 0.0)
     3526            alignment.add(fuelTank.expectedButton)
     3527
     3528            self._fuelTable.attach(alignment, index*2,
     3529                                   2 if (index%2)==0 or numTanks==2 else 3,
     3530                                   3, 1)
     3531
    35083532            index += 1
    35093533
Note: See TracChangeset for help on using the changeset viewer.