Changeset 989:d60ebbdef36c for src/mlx
- Timestamp:
- 06/27/19 18:48:47 (5 years ago)
- Branch:
- python3
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/flight.py
r954 r989 3260 3260 self.expectedWeight = currentWeight 3261 3261 3262 label = gtk.Label("<b>" + name + "</b>")3262 self._label = label = gtk.Label("<b>" + name + "</b>") 3263 3263 label.set_use_markup(True) 3264 3264 label.set_use_underline(True) 3265 3265 label.set_justify(JUSTIFY_CENTER) 3266 3266 label.set_alignment(0.5, 1.0) 3267 self.pack_start(label, False, False, 4)3268 3267 3269 3268 self._tankFigure = gtk.EventBox() 3270 self._tankFigure.set_size_request(38, -1)3269 self._tankFigure.set_size_request(38, 200) 3271 3270 self._tankFigure.set_visible_window(False) 3272 3271 self._tankFigure.set_tooltip_markup(xstr("fuel_tank_tooltip")) … … 3297 3296 label.set_mnemonic_widget(self._expectedButton) 3298 3297 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 3303 3307 3304 3308 def setCurrent(self, currentWeight): … … 3496 3500 3497 3501 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) 3500 3505 index = 0 3501 3506 for (tank, current, capacity) in tankData: … … 3504 3509 const.fuelTank2string(tank)), 3505 3510 capacity, current) 3506 self._fuelTable.attach(fuelTank, index, index+1, 0, 1)3507 3511 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 3508 3532 index += 1 3509 3533
Note:
See TracChangeset
for help on using the changeset viewer.