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
33 | 33 | padding-bottom: 0; |
34 | 34 | padding-right: 2px; |
35 | 35 | } |
36 | ||
37 | 36 | .statuswidget-vertical { |
38 | 37 | border: none; |
39 | 38 | padding-top: 2px; |
188 | 187 | return GLib.SOURCE_REMOVE |
189 | 188 | |
190 | 189 | 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 | ||
191 | 195 | orientation = translate_applet_orientation_to_xapp(self.orientation) |
192 | 196 | |
193 | 197 | x, y = self.calc_menu_origin(widget, orientation) |
352 | 356 | indicator.orientation = orient |
353 | 357 | indicator.update_orientation() |
354 | 358 | |
355 | box_orientation = Gtk.Orientation.HORIZONTAL | |
356 | ||
357 | 359 | 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 | ||
361 | 374 | self.indicator_box.queue_resize() |
362 | 375 | |
363 | 376 | def sort_icons(self): |