Ignore:
Timestamp:
02/23/13 09:06:22 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Refined the formatting of the delay codes (re #154)

File:
1 edited

Legend:

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

    r437 r438  
    202202           ["Num", "Code", "Title", "Description"],
    203203           [ (CAPTION, "Others"),
    204              (DELAYCODE, ("      6", "OA  ", "NO GATES/STAND AVAILABLE",
     204             (DELAYCODE, ("        6", "OA     ", "NO GATES/STAND AVAILABLE",
    205205                          "Due to own airline activity")),
    206206             (DELAYCODE, ("9", "SG", "SCHEDULED GROUND TIME",
     
    217217           ["MA", "IATA", "Description"],
    218218           [ (CAPTION, "Passenger and baggage"),
    219              (DELAYCODE, ("    012", "01   ",
     219             (DELAYCODE, (" 012", "01   ",
    220220                          "Late shipping of parts and/or materials")),
    221              (DELAYCODE, ("    111", "11",
     221             (DELAYCODE, (" 111", "11",
    222222                          "Check-in reopened for late passengers")),
    223              (DELAYCODE, ("    121", "12",
     223             (DELAYCODE, (" 121", "12",
    224224                          "Check-in not completed by flight closure time")),
    225              (DELAYCODE, ("    132", "13",
     225             (DELAYCODE, (" 132", "13",
    226226                          "Error with passenger or baggage details"))
    227227            ])
     
    237237        self._delayCodeData = None
    238238
    239         self._treeView = None
    240 
    241239        self._treeView = gtk.TreeView(gtk.ListStore(str, str))
    242240        self._treeView.set_rules_hint(True)
     
    277275            self._previousWidth = allocation.width
    278276            index = 0
     277            lastIndex = len(self._alignments) - 1
    279278            for alignment in self._alignments:
    280279                column = self._treeView.get_column(index)
    281                 width = alignment.allocatedWidth + (8 if index==0 else 16)
     280                width = alignment.allocatedWidth
     281                width += 8 if (index==0 or index==lastIndex) else 16
    282282                column.set_fixed_width(width)
    283283                index += 1
     
    328328                label.set_alignment(0.0, 0.5)
    329329                alignment.add(label)
    330                 self._table.attach(alignment, 1, numColumns, i, i+1)
     330                self._table.attach(alignment, 1, numColumns, i, i+1,
     331                                   yoptions = FILL)
    331332                self._table.set_row_spacing(i, 8)
    332333            elif type==DELAYCODE:
     
    335336                alignment = Alignment(xalign = 0.5, yalign = 0.5, xscale = 1.0)
    336337                alignment.add(checkButton)
    337                 self._table.attach(alignment, 0, 1, i, i+1)
     338                self._table.attach(alignment, 0, 1, i, i+1,
     339                                   xoptions = FILL, yoptions = FILL)
    338340                if firstDelayCodeRow:
    339341                    self._alignments.append(alignment)
    340342
    341                 for j in range(0, len(elements)):
     343                for j in range(0, numColumns-1):
    342344                    label = gtk.Label(elements[j])
    343345                    label.set_alignment(1.0 if j==0 else 0.0, 0.5)
     
    345347                                          xscale = 1.0)
    346348                    alignment.add(label)
    347                     self._table.attach(alignment, j+1, j+2, i, i+1)
     349                    xoptions = FILL
     350                    if j==(numColumns-2): xoptions |= EXPAND
     351                    self._table.attach(alignment, j+1, j+2, i, i+1,
     352                                       xoptions = xoptions, yoptions = FILL)
    348353                    if firstDelayCodeRow:
    349354                        self._alignments.append(alignment)
Note: See TracChangeset for help on using the changeset viewer.