Codebase list xapp / 5ac1e6b
mate-xapp-status-applet.py: Add a small margin at either end of the applet, and allow ctrl-right-clicks anywhere on it, so the user can bring up the About menu. Michael Webster 3 years ago
1 changed file(s) with 19 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
3333 padding-bottom: 0;
3434 padding-right: 2px;
3535 }
36
3736 .statuswidget-vertical {
3837 border: none;
3938 padding-top: 2px;
188187 return GLib.SOURCE_REMOVE
189188
190189 def on_button_press(self, widget, event):
190 # If the user does ctrl->right-click, open the applet's about menu
191 # instead of sending to the app.
192 if event.state & Gdk.ModifierType.CONTROL_MASK and event.button == Gdk.BUTTON_SECONDARY:
193 return Gdk.EVENT_PROPAGATE
194
191195 orientation = translate_applet_orientation_to_xapp(self.orientation)
192196
193197 x, y = self.calc_menu_origin(widget, orientation)
352356 indicator.orientation = orient
353357 indicator.update_orientation()
354358
355 box_orientation = Gtk.Orientation.HORIZONTAL
356
357359 if orient in (MatePanelApplet.AppletOrient.LEFT, MatePanelApplet.AppletOrient.RIGHT):
358 box_orientation = Gtk.Orientation.VERTICAL
359
360 self.indicator_box.set_orientation(box_orientation)
360 self.indicator_box.set_orientation(Gtk.Orientation.VERTICAL)
361
362 self.indicator_box.props.margin_start = 0
363 self.indicator_box.props.margin_end = 0
364 self.indicator_box.props.margin_top = 2
365 self.indicator_box.props.margin_bottom = 2
366 else:
367 self.indicator_box.set_orientation(Gtk.Orientation.HORIZONTAL)
368
369 self.indicator_box.props.margin_start = 2
370 self.indicator_box.props.margin_end = 2
371 self.indicator_box.props.margin_top = 0
372 self.indicator_box.props.margin_bottom = 0
373
361374 self.indicator_box.queue_resize()
362375
363376 def sort_icons(self):