Changeset 996:8035d80d5feb for src/mlx/gui/faultexplain.py
- Timestamp:
- 07/04/19 17:57:45 (5 years ago)
- Branch:
- python3
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/gui/faultexplain.py
r995 r996 19 19 #------------------------------------------------------------------------------- 20 20 21 class FaultFrame( gtk.Frame):21 class FaultFrame(Gtk.Frame): 22 22 """A frame containing the information about a single fault. 23 23 … … 26 26 def __init__(self, faultText): 27 27 """Construct the frame.""" 28 gtk.Frame.__init__(self)28 Gtk.Frame.__init__(self) 29 29 30 30 self._faultText = faultText 31 31 32 vbox = gtk.VBox()33 34 self._fault = fault = gtk.Label()32 vbox = Gtk.VBox() 33 34 self._fault = fault = Gtk.Label() 35 35 fault.set_xalign(0.0) 36 36 fault.set_justify(JUSTIFY_LEFT) … … 39 39 self.faultText = faultText 40 40 41 faultAlignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,41 faultAlignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 42 42 xscale = 1.0, yscale = 0.0) 43 43 faultAlignment.set_padding(padding_top = 0, padding_bottom = 0, … … 46 46 vbox.pack_start(faultAlignment, True, True, 4) 47 47 48 self._explanation = explanation = gtk.TextView()48 self._explanation = explanation = Gtk.TextView() 49 49 explanation.set_wrap_mode(WRAP_WORD) 50 50 explanation.set_accepts_tab(False) … … 60 60 61 61 styleContext = self.get_style_context() 62 color = styleContext.get_background_color( gtk.StateFlags.NORMAL)62 color = styleContext.get_background_color(Gtk.StateFlags.NORMAL) 63 63 fault.override_background_color(0, color) 64 64 … … 119 119 #------------------------------------------------------------------------------- 120 120 121 class FaultExplainWidget( gtk.Frame):121 class FaultExplainWidget(Gtk.Frame): 122 122 """The widget for the faults and their explanations.""" 123 123 @staticmethod … … 127 127 128 128 def __init__(self, gui): 129 gtk.Frame.__init__(self)129 Gtk.Frame.__init__(self) 130 130 131 131 self._gui = gui … … 134 134 label.set_use_underline(True) 135 135 136 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,136 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 137 137 xscale = 1.0, yscale = 1.0) 138 138 alignment.set_padding(padding_top = 4, padding_bottom = 4, 139 139 padding_left = 4, padding_right = 4) 140 140 141 self._outerBox = outerBox = gtk.EventBox()141 self._outerBox = outerBox = Gtk.EventBox() 142 142 outerBox.add(alignment) 143 143 144 self._innerBox = innerBox = gtk.EventBox()144 self._innerBox = innerBox = Gtk.EventBox() 145 145 alignment.add(self._innerBox) 146 146 147 alignment = gtk.Alignment(xalign = 0.5, yalign = 0.5,147 alignment = Gtk.Alignment(xalign = 0.5, yalign = 0.5, 148 148 xscale = 1.0, yscale = 1.0) 149 149 alignment.set_padding(padding_top = 0, padding_bottom = 0, … … 152 152 innerBox.add(alignment) 153 153 154 scroller = gtk.ScrolledWindow()154 scroller = Gtk.ScrolledWindow() 155 155 scroller.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC) 156 156 scroller.set_shadow_type(SHADOW_NONE) 157 157 158 self._faults = gtk.VBox()158 self._faults = Gtk.VBox() 159 159 self._faults.set_homogeneous(False) 160 160 scroller.add(self._faults) … … 189 189 """Add a fault with the given ID and text.""" 190 190 191 alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,191 alignment = Gtk.Alignment(xalign = 0.0, yalign = 0.0, 192 192 xscale = 1.0, yscale = 0.0) 193 193 alignment.set_padding(padding_top = 2, padding_bottom = 2, … … 287 287 else: 288 288 outerColour = \ 289 styleContext.get_border_color( gtk.StateFlags.DROP_ACTIVE)289 styleContext.get_border_color(Gtk.StateFlags.DROP_ACTIVE) 290 290 innerColour = self._gui.backgroundColour 291 291 292 self._outerBox.override_background_color( gtk.StateFlags.NORMAL,292 self._outerBox.override_background_color(Gtk.StateFlags.NORMAL, 293 293 outerColour) 294 self._innerBox.override_background_color( gtk.StateFlags.NORMAL,294 self._innerBox.override_background_color(Gtk.StateFlags.NORMAL, 295 295 innerColour) 296 296
Note:
See TracChangeset
for help on using the changeset viewer.