From 150e02c0a05b99d9614b4a2f766a4c61c792087c Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Tue, 6 Sep 2016 15:58:34 +0100 Subject: [PATCH 01/31] gtk3 --- usr/lib/linuxmint/mintMenu/capi.py | 36 ----- usr/lib/linuxmint/mintMenu/keybinding.py | 26 +-- usr/lib/linuxmint/mintMenu/mintMenu.py | 148 +++++++++--------- usr/lib/linuxmint/mintMenu/mintMenuConfig.py | 50 +++--- .../mintMenu/plugins/applications.py | 114 +++++--------- .../linuxmint/mintMenu/plugins/easybuttons.py | 27 ++-- usr/lib/linuxmint/mintMenu/plugins/execute.py | 2 +- usr/lib/linuxmint/mintMenu/plugins/places.py | 5 +- usr/lib/linuxmint/mintMenu/plugins/recent.py | 11 +- .../mintMenu/plugins/system_management.py | 2 +- usr/lib/linuxmint/mintMenu/pointerMonitor.py | 5 +- 11 files changed, 163 insertions(+), 263 deletions(-) delete mode 100644 usr/lib/linuxmint/mintMenu/capi.py diff --git a/usr/lib/linuxmint/mintMenu/capi.py b/usr/lib/linuxmint/mintMenu/capi.py deleted file mode 100644 index d4e2c44..0000000 --- a/usr/lib/linuxmint/mintMenu/capi.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/python2 - -import gi -import ctypes -from ctypes import * - -libgobject = CDLL('libgobject-2.0.so.0') - -class _PyGObject_Functions(ctypes.Structure): - _fields_ = [ - ('register_class', - ctypes.PYFUNCTYPE(ctypes.c_void_p, ctypes.c_char_p, - ctypes.c_int, ctypes.py_object, - ctypes.py_object)), - ('register_wrapper', - ctypes.PYFUNCTYPE(ctypes.c_void_p, ctypes.py_object)), - ('lookup_class', - ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_int)), - ('newgobj', - ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)), - ] - -class PyGObjectCPAI(object): - def __init__(self): - PyCObject_AsVoidPtr = ctypes.pythonapi.PyCObject_AsVoidPtr - PyCObject_AsVoidPtr.restype = ctypes.c_void_p - PyCObject_AsVoidPtr.argtypes = [ctypes.py_object] - addr = PyCObject_AsVoidPtr(ctypes.py_object( - gi._gobject._PyGObject_API)) - self._api = _PyGObject_Functions.from_address(addr) - - def pygobject_new(self, addr): - return self._api.newgobj(addr) - -def get_widget(ptr): - return PyGObjectCPAI().pygobject_new(ptr) diff --git a/usr/lib/linuxmint/mintMenu/keybinding.py b/usr/lib/linuxmint/mintMenu/keybinding.py index dbc44f3..f7cbd1d 100644 --- a/usr/lib/linuxmint/mintMenu/keybinding.py +++ b/usr/lib/linuxmint/mintMenu/keybinding.py @@ -25,18 +25,14 @@ # DEALINGS IN THE SOFTWARE. import gi -gi.require_version("Gtk", "2.0") +gi.require_version("Gtk", "3.0") from Xlib.display import Display from Xlib import X, error -from gi.repository import Gtk, Gdk, GObject, GLib +from gi.repository import Gtk, Gdk, GdkX11, GObject, GLib import threading import ctypes from ctypes import * -import capi - -gdk = CDLL("libgdk-x11-2.0.so.0") -gtk = CDLL("libgtk-x11-2.0.so.0") SPECIAL_MODS = (["Super_L", ""], ["Super_R", ""], @@ -57,8 +53,7 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): threading.Thread.__init__ (self) self.setDaemon (True) - gdk.gdk_keymap_get_default.restype = c_void_p - self.keymap = capi.get_widget (gdk.gdk_keymap_get_default()) + self.keymap = Gdk.Keymap().get_default() self.display = Display() self.screen = self.display.screen() self.window = self.screen.root @@ -90,12 +85,7 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): self.known_modifiers_mask |= modifier def get_keycode(self, keyval): - count = c_int() - array = (KeymapKey * 10)() - keys = cast(array, POINTER(KeymapKey)) - gdk.gdk_keymap_get_entries_for_keyval.argtypes = [c_void_p, c_uint, c_void_p, c_void_p] - gdk.gdk_keymap_get_entries_for_keyval(hash(self.keymap), keyval, byref(keys), byref(count)) - return keys[0].keycode + return self.keymap.get_entries_for_keyval(keyval).keys[0].keycode def grab(self, key): accelerator = key @@ -137,8 +127,7 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): if window is None: self.window = self.screen.root else: - gdk.gdk_x11_drawable_get_xid.argtypes = [c_void_p] - self.window = self.display.create_resource_object("window", gdk.gdk_x11_drawable_get_xid(hash(window))) + self.window = self.display.create_resource_object("window", window.get_xid()) self.grab(self.keytext) def get_mask_combinations(self, mask): @@ -185,7 +174,7 @@ class KeymapKey(Structure): ("group", c_int), ("level", c_int)] -class KeybindingWidget(Gtk.HBox): +class KeybindingWidget(Gtk.Box): __gsignals__ = { 'accel-edited': (GObject.SignalFlags.RUN_LAST, None, ()), } @@ -235,8 +224,7 @@ class KeybindingWidget(Gtk.HBox): self.set_button_text() self.emit("accel-edited") return True - gtk.gtk_accelerator_name.restype = c_char_p - accel_string = gtk.gtk_accelerator_name(event.keyval, event.state) + accel_string = Gtk.accelerator_name( event.keyval, event.state ) accel_string = self.sanitize(accel_string) self.value = accel_string self.set_button_text() diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 0945e4d..a0d41c4 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -1,7 +1,7 @@ #!/usr/bin/python2 import gi -gi.require_version("Gtk", "2.0") +gi.require_version("Gtk", "3.0") gi.require_version('MatePanelApplet', '4.0') from gi.repository import Gtk, GdkPixbuf, Gdk, GObject from gi.repository import MatePanelApplet @@ -26,8 +26,6 @@ except Exception, e: GObject.threads_init() -gdk = CDLL("libgdk-x11-2.0.so.0") - # Rename the process architecture = commands.getoutput("uname -a") if (architecture.find("x86_64") >= 0): @@ -77,7 +75,7 @@ class MainWindow( object ): builder.add_from_file(os.path.join( self.path, "mintMenu.glade" )) self.window = builder.get_object( "mainWindow" ) self.window.realize() - self.window.window.set_decorations(Gdk.WMDecoration.BORDER) + self.window.get_window().set_decorations(Gdk.WMDecoration.BORDER) self.window.set_title("") self.paneholder = builder.get_object( "paneholder" ) self.border = builder.get_object( "border" ) @@ -111,11 +109,11 @@ class MainWindow( object ): self.getSetGSettingEntries() - self.tooltips = Gtk.Tooltips() + self.tooltipsWidgets = [] if self.globalEnableTooltips and self.enableTooltips: - self.tooltips.enable() + self.tooltipsEnable() else: - self.tooltips.disable() + self.tooltipsEnable( False ) self.PopulatePlugins(); self.firstTime = True; @@ -137,9 +135,9 @@ class MainWindow( object ): self.enableTooltips = settings.get_boolean(key) if self.globalEnableTooltips and self.enableTooltips: - self.tooltips.enable() + self.tooltipsEnable() else: - self.tooltips.disable() + self.tooltipsEnable( False ) def toggleStartWithFavorites( self, settings, key, args = None ): self.startWithFavorites = settings.get_boolean(key) @@ -179,12 +177,18 @@ class MainWindow( object ): self.globalEnableTooltips = self.panelSettings.get_boolean( "tooltips-enabled" ) - def SetupMintMenuBorder( self, defaultStyle = None ): + def SetupMintMenuBorder( self ): + context = self.window.get_style_context() + context.save() + context.set_state( Gtk.StateFlags.NORMAL ) if self.usecustomcolor: - self.window.modify_bg( Gtk.StateType.NORMAL, Gdk.color_parse( self.custombordercolor ) ) - elif defaultStyle is not None: - self.window.modify_bg( Gtk.StateType.NORMAL, defaultStyle.lookup_color('bg_color')[1] ) + bg_color = Gdk.RGBA() + bg_color.parse( self.custombordercolor ) + self.window.override_background_color( Gtk.StateFlags.NORMAL, bg_color ) + else: + self.window.override_background_color( Gtk.StateFlags.NORMAL, None ) self.border.set_padding( self.borderwidth, self.borderwidth, self.borderwidth, self.borderwidth ) + context.restore() def detect_desktop_environment (self): self.de = "mate" @@ -206,7 +210,7 @@ class MainWindow( object ): start = time.time() PluginPane = Gtk.EventBox() PluginPane.show() - PaneLadder = Gtk.VBox( False, 0 ) + PaneLadder = Gtk.Box( orientation=Gtk.Orientation.VERTICAL ) PluginPane.add( PaneLadder ) ImageBox = Gtk.EventBox() ImageBox.show() @@ -267,7 +271,7 @@ class MainWindow( object ): self.panesToColor.append( MyPlugin.content_holder ) MyPlugin.content_holder.show() - VBox1 = Gtk.VBox( False, 0 ) + VBox1 = Gtk.Box( orientation=Gtk.Orientation.VERTICAL ) if MyPlugin.heading != "": Label1 = Gtk.Label(label= MyPlugin.heading ) Align1 = Gtk.Alignment.new( 0, 0, 0, 0 ) @@ -283,7 +287,7 @@ class MainWindow( object ): heading.set_visible_window( False ) heading.set_size_request( MyPlugin.width, 30 ) else: - heading = Gtk.HBox() + heading = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL ) #heading.set_relief( Gtk.ReliefStyle.NONE ) heading.set_size_request( MyPlugin.width, -1 ) #heading.set_sensitive(False) @@ -294,14 +298,17 @@ class MainWindow( object ): VBox1.pack_start( heading, False, False, 0 ) VBox1.show() #Add plugin to Plugin Box under heading button - MyPlugin.content_holder.reparent( VBox1 ) + MyPlugin.content_holder.get_parent().remove(MyPlugin.content_holder) + VBox1.add( MyPlugin.content_holder ) #Add plugin to main window PaneLadder.pack_start( VBox1 , True, True, 0) PaneLadder.show() - if MyPlugin.window: - MyPlugin.window.destroy() + try: + MyPlugin.get_window().destroy() + except AttributeError: + pass try: if hasattr( MyPlugin, 'do_plugin' ): @@ -327,7 +334,7 @@ class MainWindow( object ): self.paneholder.pack_start( ImageBox, False, False, 0 ) self.paneholder.pack_start( PluginPane, False, False, 0 ) PluginPane = Gtk.EventBox() - PaneLadder = Gtk.VBox( False, 0 ) + PaneLadder = Gtk.Box( orientation=Gtk.Orientation.VERTICAL ) PluginPane.add( PaneLadder ) ImageBox = Gtk.EventBox() self.panesToColor.extend( [ PluginPane, ImageBox ] ) @@ -349,31 +356,25 @@ class MainWindow( object ): self.paneholder.pack_start( ImageBox, False, False, 0 ) self.paneholder.pack_start( PluginPane, False, False, 0 ) - self.tooltips.disable() - #print u"Loading", (time.time() - start), "s" - - # A little hacky but works - def getDefaultStyle( self ): - widget = Gtk.EventBox() - widget.show() - return Gtk.rc_get_style(widget) + self.tooltipsEnable( False )) def loadTheme( self ): - defaultStyle = self.getDefaultStyle() - self.SetPaneColors( self.panesToColor, defaultStyle ) - self.SetupMintMenuBorder( defaultStyle ) + self.SetPaneColors( self.panesToColor ) + self.SetupMintMenuBorder() self.SetHeadingStyle( self.headingsToColor ) - def SetPaneColors( self, items, defaultStyle = None ): - if self.usecustomcolor: - for item in items: - item.modify_bg( Gtk.StateType.NORMAL, Gdk.color_parse( self.customcolor ) ) - # TODO: Changing background color isn't working for pixmaps! The following does not work: - item.get_style().bg_pixmap[Gtk.StateType.NORMAL] = None - elif defaultStyle is not None: - for item in items: - item.modify_bg( Gtk.StateType.NORMAL, defaultStyle.lookup_color('bg_color')[1] ) - item.get_style().bg_pixmap[Gtk.StateType.NORMAL] = defaultStyle.bg_pixmap[Gtk.StateType.NORMAL] + def SetPaneColors( self, items ): + for item in items: + context = item.get_style_context() + context.save() + context.set_state( Gtk.StateFlags.NORMAL ) + if self.usecustomcolor: + bg_color = Gdk.RGBA() + bg_color.parse( self.customcolor ) + item.override_background_color( Gtk.StateFlags.NORMAL, bg_color ) + else: + item.override_background_color( Gtk.StateFlags.NORMAL, None ) + context.restore() def SetHeadingStyle( self, items ): if self.usecustomcolor: @@ -390,8 +391,13 @@ class MainWindow( object ): markup = '%s' % (color, text) item.set_markup( markup ) - def setTooltip( self, widget, tip, tipPrivate = None ): - self.tooltips.set_tip( widget, tip, tipPrivate ) + def tooltipsEnable( self, enable = True ): + for widget in self.tooltipsWidgets: + widget.set_has_tooltip( enable ) + + def setTooltip( self, widget, tip ): + self.tooltipsWidgets.append( widget ) + widget.set_tooltip_text( tip ) def RegenPlugins( self, *args, **kargs ): #print @@ -435,7 +441,7 @@ class MainWindow( object ): self.firstTime = False self.window.set_opacity(1.0) - self.window.window.focus( Gdk.CURRENT_TIME ) + self.window.get_window().focus( Gdk.CURRENT_TIME ) for plugin in self.plugins.values(): if hasattr( plugin, "onShowMenu" ): @@ -514,20 +520,18 @@ class MenuWin( object ): self.pointerMonitor.connect("activate", self.onPointerOutside) def onWindowMap( self, *args ): - self.applet.set_state( Gtk.StateType.SELECTED ) - self.keybinder.set_focus_window( self.mainwin.window.window ) - #self.pointerMonitor.grabPointer() + self.applet.get_style_context().set_state( Gtk.StateFlags.SELECTED ) + self.keybinder.set_focus_window( self.mainwin.window.get_window() ) return False def onWindowUnmap( self, *args ): - self.applet.set_state( Gtk.StateType.NORMAL ) + self.applet.get_style_context().set_state( Gtk.StateFlags.NORMAL ) self.keybinder.set_focus_window() - #self.pointerMonitor.ungrabPointer() return False def onRealize( self, *args): - self.pointerMonitor.addWindowToMonitor( self.mainwin.window.window ) - self.pointerMonitor.addWindowToMonitor( self.applet.window ) + self.pointerMonitor.addWindowToMonitor( self.mainwin.window.get_window() ) + self.pointerMonitor.addWindowToMonitor( self.applet.get_window() ) self.pointerMonitor.start() return False @@ -544,8 +548,8 @@ class MenuWin( object ): def leave_notify(self, applet, event): # Hack for mate-panel-test-applets focus issue (this can be commented) - if event.state & Gdk.ModifierType.BUTTON1_MASK and applet.state & Gtk.StateType.SELECTED: - if event.x >= 0 and event.y >= 0 and event.x < applet.window.get_width() and event.y < applet.window.get_height(): + if event.state & Gdk.ModifierType.BUTTON1_MASK and applet.get_style_context().get_state() & Gtk.StateFlags.SELECTED: + if event.x >= 0 and event.y >= 0 and event.x < applet.get_window().get_width() and event.y < applet.get_window().get_height(): self.mainwin.stopHiding() self.do_image(self.buttonIcon, False) @@ -572,19 +576,19 @@ class MenuWin( object ): self.systemlabel.set_tooltip_text(tooltip) self.button_icon.set_tooltip_text(tooltip) if self.applet.get_orient() == MatePanelApplet.AppletOrient.UP or self.applet.get_orient() == MatePanelApplet.AppletOrient.DOWN: - self.button_box = Gtk.HBox() + self.button_box = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL ) self.button_box.pack_start( self.button_icon, False, False, 0 ) self.button_box.pack_start( self.systemlabel, False, False, 0 ) self.button_icon.set_padding( 5, 0 ) # if we have a vertical panel elif self.applet.get_orient() == MatePanelApplet.AppletOrient.LEFT: - self.button_box = Gtk.VBox() + self.button_box = Gtk.Box( orientation=Gtk.Orientation.VERTICAL ) self.systemlabel.set_angle( 270 ) self.button_box.pack_start( self.button_icon , False, False, 0) self.button_box.pack_start( self.systemlabel , False, False, 0) self.button_icon.set_padding( 0, 5 ) - elif self.applet.get_orient() == MatePanelApplet.AppletOrient.RIGHT: - self.button_box = Gtk.VBox() + elif self.applet.get_orient( orientation=Gtk.Orientation.VERTICAL ) == MatePanelApplet.AppletOrient.RIGHT: + self.button_box = Gtk.Box() self.systemlabel.set_angle( 90 ) self.button_box.pack_start( self.systemlabel , False, False, 0) self.button_box.pack_start( self.button_icon , False, False, 0) @@ -626,17 +630,17 @@ class MenuWin( object ): def changeOrientation( self, *args, **kargs ): if self.applet.get_orient() == MatePanelApplet.AppletOrient.UP or self.applet.get_orient() == MatePanelApplet.AppletOrient.DOWN: - tmpbox = Gtk.HBox() + tmpbox = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL ) self.systemlabel.set_angle( 0 ) self.button_box.reorder_child( self.button_icon, 0 ) self.button_icon.set_padding( 5, 0 ) elif self.applet.get_orient() == MatePanelApplet.AppletOrient.LEFT: - tmpbox = Gtk.VBox() + tmpbox = Gtk.Box( orientation=Gtk.Orientation.VERTICAL ) self.systemlabel.set_angle( 270 ) self.button_box.reorder_child( self.button_icon, 0 ) self.button_icon.set_padding( 0, 5 ) elif self.applet.get_orient() == MatePanelApplet.AppletOrient.RIGHT: - tmpbox = Gtk.VBox() + tmpbox = Gtk.Box( orientation=Gtk.Orientation.VERTICAL ) self.systemlabel.set_angle( 90 ) self.button_box.reorder_child( self.button_icon, 1 ) self.button_icon.set_padding( 0, 5 ) @@ -688,10 +692,8 @@ class MenuWin( object ): self.button_icon.show() # This code calculates width and height for the button_box # and takes the orientation in account - sl_req = Gtk.Requisition() - bi_req = Gtk.Requisition() - self.button_icon.size_request(bi_req) - self.systemlabel.size_request(sl_req) + bi_req = self.button_icon.size_request() + sl_req = self.systemlabel.size_request() if self.applet.get_orient() == MatePanelApplet.AppletOrient.UP or self.applet.get_orient() == MatePanelApplet.AppletOrient.DOWN: if self.hideIcon: self.applet.set_size_request( sl_req.width + 2, bi_req.height ) @@ -751,7 +753,7 @@ class MenuWin( object ): self.mainwin.hide() def toggleMenu( self ): - if self.applet.state & Gtk.StateType.SELECTED: + if self.applet.get_style_context().get_state() & Gtk.StateFlags.SELECTED: self.mainwin.hide() else: self.positionMenu() @@ -769,10 +771,8 @@ class MenuWin( object ): x = c_int() y = c_int() # Get the dimensions/position of the widgetToAlignWith - gdk.gdk_window_get_origin.argtypes = [c_void_p, c_void_p, c_void_p] - gdk.gdk_window_get_origin(hash(self.applet.window), byref(x), byref(y)) - entryX = x.value - entryY = y.value + entryX = self.applet.get_window().get_origin().x + entryY = self.applet.get_window().get_origin().y entryWidth, entryHeight = self.applet.get_allocation().width, self.applet.get_allocation().height entryHeight = entryHeight + self.mainwin.offset @@ -811,17 +811,17 @@ class MenuWin( object ): # this callback is to create a context menu def create_menu(self): - action_group = Gtk.ActionGroup("context-menu") - action = Gtk.Action("MintMenuPrefs", _("Preferences"), None, "gtk-preferences") + action_group = Gtk.ActionGroup(name="context-menu") + action = Gtk.Action(name="MintMenuPrefs", label=_("Preferences"), tooltip=None, stock_id="gtk-preferences") action.connect("activate", self.showPreferences) action_group.add_action(action) - action = Gtk.Action("MintMenuEdit", _("Edit menu"), None, "gtk-edit") + action = Gtk.Action(name="MintMenuEdit", label=_("Edit menu"), tooltip=None, stock_id="gtk-edit") action.connect("activate", self.showMenuEditor) action_group.add_action(action) - action = Gtk.Action("MintMenuReload", _("Reload plugins"), None, "gtk-refresh") + action = Gtk.Action(name="MintMenuReload", label=_("Reload plugins"), tooltip=None, stock_id="gtk-refresh") action.connect("activate", self.mainwin.RegenPlugins) action_group.add_action(action) - action = Gtk.Action("MintMenuAbout", _("About"), None, "gtk-about") + action = Gtk.Action(name="MintMenuAbout", label=_("About"), tooltip=None, stock_id="gtk-about") action.connect("activate", self.showAboutDialog) action_group.add_action(action) action_group.set_translation_domain ("mintmenu") diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py index 5e48a8d..40837e4 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py @@ -3,7 +3,7 @@ import sys import gi -gi.require_version("Gtk", "2.0") +gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Gdk, GdkPixbuf import keybinding @@ -62,7 +62,7 @@ class mintMenuConfig( object ): self.builder.get_object("buttonTextLabel").set_text(_("Button text:")) self.builder.get_object("label1").set_text(_("Options")) - self.builder.get_object("label23").set_text(_("Applications")) + self.builder.get_object("applicationsLabel").set_text(_("Applications")) self.builder.get_object("colorsLabel").set_text(_("Theme")) self.builder.get_object("favLabel").set_text(_("Favorites")) @@ -141,8 +141,8 @@ class mintMenuConfig( object ): self.showButtonIcon = self.builder.get_object( "showButtonIcon" ) self.buttonText = self.builder.get_object( "buttonText" ) self.hotkeyWidget = keybinding.KeybindingWidget(_("Keyboard shortcut:") ) - table = self.builder.get_object( "main_table" ) - table.attach(self.hotkeyWidget, 0, 2, 2, 3, Gtk.AttachOptions.FILL, Gtk.AttachOptions.FILL, 0, 0) + grid = self.builder.get_object( "main_grid" ) + grid.attach(self.hotkeyWidget, 0, 2, 2, 1) self.buttonIcon = self.builder.get_object( "buttonIcon" ) self.buttonIconChooser = self.builder.get_object( "button_icon_chooser" ) self.image_filter = Gtk.FileFilter() @@ -214,9 +214,9 @@ class mintMenuConfig( object ): self.bindGSettingsValueToWidget( self.settings, "int", "border-width", self.borderWidth, "value-changed", self.borderWidth.set_value, self.borderWidth.get_value_as_int ) self.bindGSettingsValueToWidget( self.settings, "bool", "use-custom-color", self.useCustomColors, "toggled", self.useCustomColors.set_active, self.useCustomColors.get_active ) - self.bindGSettingsValueToWidget( self.settings, "color", "custom-color", self.backgroundColor, "color-set", self.backgroundColor.set_color, self.getBackgroundColor ) - self.bindGSettingsValueToWidget( self.settings, "color", "custom-heading-color", self.headingColor, "color-set", self.headingColor.set_color, self.getHeadingColor ) - self.bindGSettingsValueToWidget( self.settings, "color", "custom-border-color", self.borderColor, "color-set", self.borderColor.set_color, self.getBorderColor ) + self.bindGSettingsValueToWidget( self.settings, "color", "custom-color", self.backgroundColor, "color-set", self.backgroundColor.set_rgba, self.getBackgroundColor ) + self.bindGSettingsValueToWidget( self.settings, "color", "custom-heading-color", self.headingColor, "color-set", self.headingColor.set_rgba, self.getHeadingColor ) + self.bindGSettingsValueToWidget( self.settings, "color", "custom-border-color", self.borderColor, "color-set", self.borderColor.set_rgba, self.getBorderColor ) self.bindGSettingsValueToWidget( self.settings, "bool", "hide-applet-icon", self.showButtonIcon, "toggled", self.setShowButtonIcon, self.getShowButtonIcon ) self.bindGSettingsValueToWidget( self.settings, "string", "applet-text", self.buttonText, "changed", self.buttonText.set_text, self.buttonText.get_text ) self.bindGSettingsValueToWidget( self.settings, "string", "hot-key", self.hotkeyWidget, "accel-edited", self.hotkeyWidget.set_val, self.hotkeyWidget.get_val ) @@ -352,7 +352,9 @@ class mintMenuConfig( object ): def bindGSettingsValueToWidget( self, settings, setting_type, key, widget, changeEvent, setter, getter ): settings.notifyAdd( key, self.callSetter, args = [ setting_type, setter ] ) if setting_type == "color": - setter( Gdk.color_parse( settings.get( setting_type, key ) ) ) + color = Gdk.RGBA() + color.parse( settings.get( setting_type, key ) ) + setter( color ) else: setter( settings.get( setting_type, key ) ) widget.connect( changeEvent, lambda *args: self.callGetter( settings, setting_type, key, getter ) ) @@ -365,7 +367,9 @@ class mintMenuConfig( object ): elif args[0] == "int": args[1]( settings.get_int(key) ) elif args[0] == "color": - args[1]( Gdk.color_parse( settings.get_string(key) ) ) + color = Gdk.RGBA() + color.parse( settings.get_string(key) ) + args[1]( color ) def callGetter( self, settings, setting_type, key, getter ): if (setting_type == "int"): @@ -382,31 +386,19 @@ class mintMenuConfig( object ): self.headingColorLabel.set_sensitive( widget.get_active() ) def getBackgroundColor( self ): - try: - color = self.backgroundColor.get_color() - except: - color = Gdk.Color(0, 0, 0) - self.backgroundColor.get_color(color) - return self.gdkColorToString( color ) + color = self.backgroundColor.get_rgba() + return self.gdkRGBAToString( color ) def getBorderColor( self ): - try: - color = self.borderColor.get_color() - except: - color = Gdk.Color(0, 0, 0) - self.borderColor.get_color(color) - return self.gdkColorToString( color ) + color = self.borderColor.get_rgba() + return self.gdkRGBAToString( color ) def getHeadingColor( self ): - try: - color = self.headingColor.get_color() - except: - color = Gdk.Color(0, 0, 0) - self.headingColor.get_color(color) - return self.gdkColorToString( color ) + color = self.headingColor.get_rgba() + return self.gdkRGBAToString( color ) - def gdkColorToString( self, gdkColor ): - return "#%.2X%.2X%.2X" % ( gdkColor.red / 256, gdkColor.green / 256, gdkColor.blue / 256 ) + def gdkRGBAToString( self, gdkRGBA ): + return "#%.2X%.2X%.2X" % ( gdkRGBA.red * 256, gdkRGBA.green * 256, gdkRGBA.blue * 256 ) def moveUp( self, upButton ): diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 2a927ef..4040da5 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -1,7 +1,7 @@ #!/usr/bin/python2 import gi -gi.require_version("Gtk", "2.0") +gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Pango, Gdk, Gio, GLib @@ -20,8 +20,6 @@ from execute import Execute from easygsettings import EasyGSettings from easyfiles import * -gtk = CDLL("libgtk-x11-2.0.so.0") - import matemenu from user import home @@ -122,10 +120,11 @@ class SuggestionButton ( Gtk.Button ): self.set_size_request( -1, -1 ) Align1 = Gtk.Alignment() Align1.set( 0, 0.5, 1.0, 0 ) - HBox1 = Gtk.HBox() - labelBox = Gtk.VBox( False, 2 ) + HBox1 = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL ) + labelBox = Gtk.Box( orientation=Gtk.Orientation.VERTICAL, spacing=2 ) self.image = Gtk.Image() - self.image.set_from_stock( self.iconName, iconSize ) + self.image.set_from_icon_name( self.iconName, Gtk.IconSize.INVALID ) + self.image.set_pixel_size( iconSize ) self.image.show() HBox1.pack_start( self.image, False, False, 5 ) self.label = Gtk.Label() @@ -148,7 +147,7 @@ class SuggestionButton ( Gtk.Button ): self.label.set_markup(text) def set_icon_size (self, size): - self.image.set_from_stock( self.iconName, size ) + self.image.set_pixel_size( size ) class TargetEntry(Structure): _fields_ = [("target", c_char_p), @@ -157,13 +156,10 @@ class TargetEntry(Structure): class pluginclass( object ): TARGET_TYPE_TEXT = 80 - array2 = TargetEntry * 2 - toButton = array2( ("text/uri-list", 0, TARGET_TYPE_TEXT), ("text/uri-list", 0, TARGET_TYPE_TEXT) ) + toButton = ( Gtk.TargetEntry.new( "text/uri-list", 0, TARGET_TYPE_TEXT ), Gtk.TargetEntry.new( "text/uri-list", 0, TARGET_TYPE_TEXT ) ) TARGET_TYPE_FAV = 81 - array = TargetEntry * 3 - toFav = array( ( "FAVORITES", Gtk.TargetFlags.SAME_APP, 81 ), ( "text/plain", 0, 100 ), ( "text/uri-list", 0, 101 ) ) - array1 = TargetEntry * 2 - fromFav = array1( ("FAVORITES", Gtk.TargetFlags.SAME_APP, 81), ("FAVORITES", Gtk.TargetFlags.SAME_APP, 81) ) + toFav = ( Gtk.TargetEntry.new( "FAVORITES", Gtk.TargetFlags.SAME_APP, 81 ), Gtk.TargetEntry.new( "text/plain", 0, 100 ), Gtk.TargetEntry.new( "text/uri-list", 0, 101 ) ) + fromFav = ( Gtk.TargetEntry.new( "FAVORITES", Gtk.TargetFlags.SAME_APP, 81 ), Gtk.TargetEntry.new( "FAVORITES", Gtk.TargetFlags.SAME_APP, 81 ) ) @print_timing def __init__( self, mintMenuWin, toggleButton, de ): @@ -221,10 +217,9 @@ class pluginclass( object ): self.favoritesBox.connect( "drag-data-received", self.ReceiveCallback ) - gtk.gtk_drag_dest_set.argtypes = [c_void_p, c_ushort, c_void_p, c_int, c_ushort] - gtk.gtk_drag_dest_set ( hash(self.favoritesBox), Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toButton, 2, Gdk.DragAction.COPY ) + self.favoritesBox.drag_dest_set ( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toButton, Gdk.DragAction.COPY ) self.showFavoritesButton.connect( "drag-data-received", self.ReceiveCallback ) - gtk.gtk_drag_dest_set ( hash(self.showFavoritesButton), Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toButton, 2, Gdk.DragAction.COPY ) + self.showFavoritesButton.drag_dest_set ( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toButton, Gdk.DragAction.COPY ) # self.searchButton.connect( "button_release_event", self.SearchWithButton ) try: @@ -543,8 +538,7 @@ class pluginclass( object ): # of the existing text, that's the most likely candidate anyhow self.searchEntry.grab_focus() if self.rememberFilter or not clear: - gtk.gtk_editable_set_position.argtypes = [c_void_p, c_int] - gtk.gtk_editable_set_position(hash(self.searchEntry), -1) + self.searchEntry.set_position(-1) else: self.searchEntry.set_text("") @@ -577,14 +571,14 @@ class pluginclass( object ): text = "%s" % text - suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "") + suggestionButton = SuggestionButton("list-add", self.iconSize, "") suggestionButton.connect("clicked", self.search_google) suggestionButton.set_text(_("Search Google for %s") % text) suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/google.ico") self.applicationsBox.add(suggestionButton) self.suggestions.append(suggestionButton) - suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "") + suggestionButton = SuggestionButton("list-add", self.iconSize, "") suggestionButton.connect("clicked", self.search_wikipedia) suggestionButton.set_text(_("Search Wikipedia for %s") % text) suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/wikipedia.ico") @@ -592,7 +586,7 @@ class pluginclass( object ): self.suggestions.append(suggestionButton) separator = Gtk.EventBox() - separator.add(Gtk.HSeparator()) + separator.add(Gtk.Separator( orientation=Gtk.Orientation.HORIZONTAL )) separator.set_visible_window(False) separator.set_size_request(-1, 20) separator.type = "separator" @@ -600,21 +594,21 @@ class pluginclass( object ): self.applicationsBox.add(separator) self.suggestions.append(separator) - suggestionButton = SuggestionButton(Gtk.STOCK_ADD, self.iconSize, "") + suggestionButton = SuggestionButton("list-add", self.iconSize, "") suggestionButton.connect("clicked", self.search_dictionary) suggestionButton.set_text(_("Lookup %s in Dictionary") % text) suggestionButton.set_image("/usr/lib/linuxmint/mintMenu/search_engines/dictionary.png") self.applicationsBox.add(suggestionButton) self.suggestions.append(suggestionButton) - suggestionButton = SuggestionButton(Gtk.STOCK_FIND, self.iconSize, "") + suggestionButton = SuggestionButton("edit-find", self.iconSize, "") suggestionButton.connect("clicked", self.Search) suggestionButton.set_text(_("Search Computer for %s") % text) self.applicationsBox.add(suggestionButton) self.suggestions.append(suggestionButton) - #self.last_separator = gtk.EventBox() - #self.last_separator.add(gtk.HSeparator()) + #self.last_separator = Gtk.EventBox() + #self.last_separator.add(Gtk.Separator( orientation=Gtk.Orientation.HORIZONTAL )) #self.last_separator.set_size_request(-1, 20) #self.last_separator.type = "separator" #self.mintMenuWin.SetPaneColors( [ self.last_separator ] ) @@ -846,8 +840,7 @@ class pluginclass( object ): if event.string.strip() != "" or event.keyval == Gdk.KEY_BackSpace: self.searchEntry.grab_focus() - gtk.gtk_editable_set_position.argtypes = [c_void_p, c_int] - gtk.gtk_editable_set_position(hash(self.searchEntry), -1) + self.searchEntry.set_position( -1 ) self.searchEntry.event( event ) return True @@ -917,8 +910,7 @@ class pluginclass( object ): mTree.show_all() self.mintMenuWin.stopHiding() - gtk.gtk_menu_popup.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_uint, c_uint] - gtk.gtk_menu_popup(hash(mTree), None, None, None, None, ev.button, ev.time) + mTree.popup(None, None, None, None, ev.button, ev.time) else: mTree = Gtk.Menu() mTree.set_events(Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.POINTER_MOTION_HINT_MASK | @@ -937,8 +929,7 @@ class pluginclass( object ): insertSpaceMenuItem.connect( "activate", self.onFavoritesInsertSpace, widget, insertBefore ) insertSeparatorMenuItem.connect( "activate", self.onFavoritesInsertSeparator, widget, insertBefore ) self.mintMenuWin.stopHiding() - gtk.gtk_menu_popup.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_uint, c_uint] - gtk.gtk_menu_popup(hash(mTree), None, None, None, None, ev.button, ev.time) + mTree.popup(None, None, None, None, ev.button, ev.time) def menuPopup( self, widget, event ): if event.button == 3: @@ -1000,8 +991,7 @@ class pluginclass( object ): startupMenuItem.connect( "toggled", self.onAddToStartup, widget ) self.mintMenuWin.stopHiding() - gtk.gtk_menu_popup.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_uint, c_uint] - gtk.gtk_menu_popup(hash(mTree), None, None, None, None, event.button, event.time) + mTree.popup(None, None, None, None, ev.button, ev.time) def searchPopup( self, widget=None, event=None ): @@ -1033,7 +1023,8 @@ class pluginclass( object ): menuItem = Gtk.ImageMenuItem(_("Search Computer")) img = Gtk.Image() - img.set_from_stock(Gtk.STOCK_FIND, self.iconSize) + img.set_from_icon_name("edit-find", Gtk.IconSize.INVALID) + img.set_pixel_size( self.iconSize ) menuItem.set_image(img) menuItem.connect("activate", self.Search) menu.append(menuItem) @@ -1079,8 +1070,7 @@ class pluginclass( object ): menu.show_all() self.mintMenuWin.stopHiding() - gtk.gtk_menu_popup.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_uint, c_uint] - gtk.gtk_menu_popup(hash(menu), None, None, None, None, event.button, event.time) + menu.popup(None, None, None, None, event.button, event.time) #menu.attach_to_widget(self.searchButton, None) #menu.reposition() @@ -1290,11 +1280,11 @@ class pluginclass( object ): # Scroll button into view def scrollItemIntoView( self, widget, event = None ): - viewport = widget.parent + viewport = widget.get_parent() while not isinstance( viewport, Gtk.Viewport ): - if not viewport.parent: + if not viewport.get_parent(): return - viewport = viewport.parent + viewport = viewport.get_parent() aloc = widget.get_allocation() viewport.get_vadjustment().clamp_page(aloc.y, aloc.y + aloc.height) @@ -1310,8 +1300,9 @@ class pluginclass( object ): return space def favoritesBuildSeparator( self ): - separator = Gtk.HSeparator() - separator.set_size_request( -1, 20 ) + separator = Gtk.Separator( orientation=Gtk.Orientation.HORIZONTAL ) + separator.set_margin_top( 5 ) + separator.set_margin_bottom( 5 ) separator.type = "separator" separator.show_all() @@ -1406,34 +1397,15 @@ class pluginclass( object ): self.favorites.append( favButton ) self.favoritesPositionOnGrid( favButton ) favButton.connect( "drag-data-received", self.onFavButtonDragReorder ) - gtk.gtk_drag_dest_set.argtypes = [c_void_p, c_ushort, c_void_p, c_int, c_ushort] - gtk.gtk_drag_dest_set( hash(favButton), Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.fromFav, 2, Gdk.DragAction.COPY ) + favButton.drag_dest_set( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY favButton.connect( "drag-data-get", self.onFavButtonDragReorderGet ) - gtk.gtk_drag_source_set.argtypes = [c_void_p, c_ushort, c_void_p, c_int, c_ushort] - gtk.gtk_drag_source_set( hash(favButton), Gdk.ModifierType.BUTTON1_MASK, self.toFav, 3, Gdk.DragAction.COPY ) + favButton.drag_source_set ( Gdk.ModifierType.BUTTON1_MASK, self.toFav, Gdk.DragAction.COPY ) position += 1 self.favoritesSave() except Exception, e: print e - def favoritesGetNumRows( self ): - rows = 0 - col = 0 - for fav in self.favorites: - if ( fav.type == "separator" or fav.type == "space" ) and col != 0: - rows += 1 - col = 0 - col += 1 - if fav.type == "separator" or fav.type == "space": - rows += 1 - col = 0 - - if col >= self.favCols: - rows += 1 - col = 0 - return rows - def favoritesPositionOnGrid( self, favorite ): row = 0 col = 0 @@ -1453,9 +1425,9 @@ class pluginclass( object ): col = 0 if favorite.type == "separator" or favorite.type == "space": - self.favoritesBox.attach( favorite, col, col + self.favCols, row, row + 1, yoptions = 0 ) + self.favoritesBox.attach( favorite, col, row, self.favCols, 1 ) else: - self.favoritesBox.attach( favorite, col, col + 1, row, row + 1, yoptions = 0 ) + self.favoritesBox.attach( favorite, col, row, 1, 1 ) def favoritesReorder( self, oldposition, newposition ): if oldposition == newposition: @@ -1479,7 +1451,6 @@ class pluginclass( object ): self.favoritesPositionOnGrid( fav ) self.favoritesSave() - self.favoritesBox.resize( self.favoritesGetNumRows(), self.favCols ) def favoritesAdd( self, favButton, position = -1 ): if favButton: @@ -1488,11 +1459,9 @@ class pluginclass( object ): self.favoritesPositionOnGrid( favButton ) favButton.connect( "drag-data-received", self.onFavButtonDragReorder ) - gtk.gtk_drag_dest_set.argtypes = [c_void_p, c_ushort, c_void_p, c_int, c_ushort] - gtk.gtk_drag_dest_set( hash(favButton), Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, 3, Gdk.DragAction.COPY ) + favButton.drag_dest_set( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY ) favButton.connect( "drag-data-get", self.onFavButtonDragReorderGet ) - gtk.gtk_drag_source_set.argtypes = [c_void_p, c_ushort, c_void_p, c_int, c_ushort] - gtk.gtk_drag_source_set ( hash(favButton), Gdk.ModifierType.BUTTON1_MASK, self.toFav, 3, Gdk.DragAction.COPY ) + favButton.drag_source_set ( Gdk.ModifierType.BUTTON1_MASK, self.toFav, Gdk.DragAction.COPY ) if position >= 0: self.favoritesReorder( favButton.position, position ) @@ -1509,7 +1478,6 @@ class pluginclass( object ): self.favoritesBox.remove( self.favorites[ i ] ) self.favoritesPositionOnGrid( self.favorites[ i ] ) self.favoritesSave() - self.favoritesBox.resize( self.favoritesGetNumRows(), self.favCols ) def favoritesRemoveLocation( self, location ): for fav in self.favorites: @@ -1529,7 +1497,7 @@ class pluginclass( object ): appListFile.close( ) except Exception, e: - msgDlg = Gtk.MessageDialog( None, gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, _("Couldn't save favorites. Check if you have write access to ~/.linuxmint/mintMenu")+"\n(" + e.__str__() + ")" ) + msgDlg = Gtk.MessageDialog( None, Gtk.DialogFlags.MODAL, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, _("Couldn't save favorites. Check if you have write access to ~/.linuxmint/mintMenu")+"\n(" + e.__str__() + ")" ) msgDlg.run(); msgDlg.destroy(); @@ -1722,7 +1690,7 @@ class pluginclass( object ): for item in sortedApplicationList: launcherName = item[0] button = item[1] - self.applicationsBox.pack_start( button, False, False, 0 ) + self.applicationsBox.add( button ) if launcherName in launcherNames: button.hide() else: @@ -1740,7 +1708,7 @@ class pluginclass( object ): # Build a list of all categories in the menu ( [ { "name", "icon", tooltip" } ] def buildCategoryList( self ): - newCategoryList = [ { "name": _("All"), "icon": "stock_select-all", "tooltip": _("Show all applications"), "filter":"", "index": 0 } ] + newCategoryList = [ { "name": _("All"), "icon": "edit-select-all", "tooltip": _("Show all applications"), "filter":"", "index": 0 } ] num = 1 diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index 41a959d..bb01dc2 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -13,8 +13,6 @@ from filemonitor import monitor as filemonitor import ctypes from ctypes import * -gtk = CDLL("libgtk-x11-2.0.so.0") - class IconManager(GObject.GObject): __gsignals__ = { @@ -124,8 +122,8 @@ class easyButton( Gtk.Button ): self.set_size_request( buttonWidth, buttonHeight ) Align1 = Gtk.Alignment.new( 0, 0.5, 1.0, 0 ) - HBox1 = Gtk.HBox() - self.labelBox = Gtk.VBox( False, 2 ) + HBox1 = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL ) + self.labelBox = Gtk.Box( orientation=Gtk.Orientation.VERTICAL, spacing=2 ) self.buttonImage = Gtk.Image() @@ -135,7 +133,7 @@ class easyButton( Gtk.Button ): else: #[ iW, iH ] = iconManager.getIconSize( self.iconSize ) self.buttonImage.set_size_request( self.iconSize, self.iconSize ) - self.image_box = Gtk.HBox() + self.image_box = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL ) self.image_box.pack_start(self.buttonImage, False, False, 5) self.image_box.show_all() HBox1.pack_start( self.image_box, False, False, 0 ) @@ -163,7 +161,7 @@ class easyButton( Gtk.Button ): self.connections.append( self.connect( event, callback ) ) def onRelease( self, widget ): - widget.set_state(Gtk.StateType.NORMAL) + widget.get_style_context().set_state( Gtk.StateFlags.NORMAL ) def onDestroy( self, widget ): self.buttonImage.clear() @@ -188,6 +186,7 @@ class easyButton( Gtk.Button ): label.set_ellipsize( Pango.EllipsizeMode.END ) label.set_alignment( 0.0, 1.0 ) + label.set_max_width_chars(0) label.show() self.labelBox.pack_start( label , True, True, 0) @@ -271,17 +270,13 @@ class ApplicationLauncher( easyButton ): # Drag and Drop self.connectSelf( "drag-data-get", self.dragDataGet ) - array = TargetEntry * 2 - targets = array(( "text/plain", 0, 100 ), ( "text/uri-list", 0, 101 )) - gtk.gtk_drag_source_set.argtypes = [c_void_p, c_ushort, c_void_p, c_int, c_ushort] - gtk.gtk_drag_source_set(hash(self), Gdk.ModifierType.BUTTON1_MASK, targets, 2, Gdk.DragAction.COPY) + targets = ( Gtk.TargetEntry.new( "text/plain", 0, 100 ), Gtk.TargetEntry.new( "text/uri-list", 0, 101 ) ) + self.drag_source_set( Gdk.ModifierType.BUTTON1_MASK, targets, Gdk.DragAction.COPY ) icon = self.getIcon( Gtk.IconSize.DND ) if icon: iconName, s = icon.get_icon_name() - c = c_char_p(iconName.decode('utf-8', 'ignore').encode('ascii', 'ignore')) - gtk.gtk_drag_source_set_icon_name.argtypes = [c_void_p, c_char_p] - gtk.gtk_drag_source_set_icon_name( hash(self), c) + self.drag_source_set_icon_name( iconName ) self.connectSelf( "focus-in-event", self.onFocusIn ) self.connectSelf( "focus-out-event", self.onFocusOut ) @@ -398,9 +393,7 @@ class ApplicationLauncher( easyButton ): icon = self.getIcon( Gtk.IconSize.DND ) if icon: iconName, size = icon.get_icon_name() - c = c_char_p(iconName.encode('ascii', 'ignore')) - gtk.gtk_drag_source_set_icon_name.argtypes = [c_void_p, c_char_p] - gtk.gtk_drag_source_set_icon_name( hash(self), c) + self.drag_source_set_icon_name( iconName ) def startupFileChanged( self, *args ): self.inStartup = os.path.exists( self.startupFilePath ) @@ -493,7 +486,7 @@ class MenuApplicationLauncher( ApplicationLauncher ): appComment = self.appComment if self.highlight: try: - #color = self.labelBox.rc_get_style().fg[ Gtk.StateType.SELECTED ].to_string() + #color = self.labelBox.get_style_context().get_color( Gtk.StateFlags.SELECTED ).to_string() #if len(color) > 0 and color[0] == "#": #appName = "%s" % (color, appName); #appComment = "%s" % (color, appComment); diff --git a/usr/lib/linuxmint/mintMenu/plugins/execute.py b/usr/lib/linuxmint/mintMenu/plugins/execute.py index 291060c..67d9d5c 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/execute.py +++ b/usr/lib/linuxmint/mintMenu/plugins/execute.py @@ -23,7 +23,7 @@ def Execute( cmd , commandCwd=None): cwd = tmpCwd if isinstance( cmd, str ) or isinstance( cmd, unicode): - if (cmd.find("ubiquity") >= 0) or (cmd.find("/home/") >= 0) or (cmd.find("su-to-root") >= 0) or (cmd.find("\"") >= 0): + if (cmd.find("ubiquity") >= 0) or (cmd.find("/home/") >= 0) or (cmd.find("xdg-su") >= 0) or (cmd.find("\"") >= 0): print "running manually..." try: os.chdir(cwd) diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py index 5709967..d00c9ae 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -15,8 +15,6 @@ from execute import Execute from user import home from urllib import unquote -gtk = CDLL("libgtk-x11-2.0.so.0") - # i18n gettext.install("mintmenu", "/usr/share/linuxmint/locale") @@ -263,8 +261,7 @@ class pluginclass( object ): trashMenu.show_all() emptyTrashMenuItem.connect ( "activate", self.emptyTrash, widget ) self.mintMenuWin.stopHiding() - gtk.gtk_menu_popup.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p, c_void_p, c_uint, c_uint] - gtk.gtk_menu_popup(hash(trashMenu), None, None, None, None, 3, 0) + trashMenu.popup(None, None, None, None, 3, 0) def emptyTrash( self, menu, widget): os.system("rm -rf " + home + "/.local/share/Trash/info/*") diff --git a/usr/lib/linuxmint/mintMenu/plugins/recent.py b/usr/lib/linuxmint/mintMenu/plugins/recent.py index 0759a3b..2e3c6ed 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/recent.py +++ b/usr/lib/linuxmint/mintMenu/plugins/recent.py @@ -1,7 +1,7 @@ #!/usr/bin/python2 import gi -gi.require_version("Gtk", "2.0") +gi.require_version("Gtk", "3.0") from gi.repository import Gtk, Pango import os @@ -140,13 +140,12 @@ class pluginclass: Align1 = Gtk.Alignment() Align1.set( 0, 0.5, 0, 0) Align1.set_padding( 0, 0, 0, 0 ) - HBox1 = Gtk.HBox( False, 5 ) - VBox1 = Gtk.VBox( False, 2 ) + HBox1 = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL, spacing=5 ) + VBox1 = Gtk.Box( orientation=Gtk.Orientation.VERTICAL, spacing=2 ) VBox1.show() - req = Gtk.Requisition() - AButton.size_request(req) + req = AButton.size_request() Label1 = Gtk.Label( DispName ) Label1.set_size_request( req.width-20, -1 ) @@ -190,7 +189,7 @@ class pluginclass: FileString=[] IconString=[] RecentInfo=self.RecManagerInstance.get_items() - # print RecentInfo[0].get_icon(gtk.ICON_SIZE_MENU) + # print RecentInfo[0].get_icon(Gtk.IconSize.MENU) count=0 MaxEntries=self.numentries if self.numentries == -1: diff --git a/usr/lib/linuxmint/mintMenu/plugins/system_management.py b/usr/lib/linuxmint/mintMenu/plugins/system_management.py index 6708106..b106cae 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/system_management.py +++ b/usr/lib/linuxmint/mintMenu/plugins/system_management.py @@ -1,7 +1,7 @@ #!/usr/bin/python2 import gi -gi.require_version("Gtk", "2.0") +gi.require_version("Gtk", "3.0") from gi.repository import Gtk import os diff --git a/usr/lib/linuxmint/mintMenu/pointerMonitor.py b/usr/lib/linuxmint/mintMenu/pointerMonitor.py index 7d643c8..caaa754 100644 --- a/usr/lib/linuxmint/mintMenu/pointerMonitor.py +++ b/usr/lib/linuxmint/mintMenu/pointerMonitor.py @@ -1,7 +1,7 @@ #!/usr/bin/python2 import gi -gi.require_version("Gtk", "2.0") +gi.require_version("Gtk", "3.0") from Xlib.display import Display from Xlib import X, error @@ -10,8 +10,7 @@ import threading import ctypes from ctypes import * -gdk = CDLL("libgdk-x11-2.0.so.0") -gtk = CDLL("libgtk-x11-2.0.so.0") +gdk = CDLL("libgdk-3.so.0") class PointerMonitor(GObject.GObject, threading.Thread): __gsignals__ = { From be31734ffb9d5d23f69df2c193ebb90fd90b6f97 Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Tue, 6 Sep 2016 17:52:12 +0100 Subject: [PATCH 02/31] glade part #1 --- usr/lib/linuxmint/mintMenu/mintMenu.glade | 6 +- .../mintMenu/plugins/applications.glade | 172 ++++++++---------- .../linuxmint/mintMenu/plugins/places.glade | 16 +- .../linuxmint/mintMenu/plugins/recent.glade | 17 +- .../mintMenu/plugins/system_management.glade | 16 +- 5 files changed, 106 insertions(+), 121 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.glade b/usr/lib/linuxmint/mintMenu/mintMenu.glade index b29b943..0762f78 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenu.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenu.glade @@ -1,7 +1,6 @@ - - + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK @@ -16,9 +15,10 @@ True False - + True False + horizontal diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.glade b/usr/lib/linuxmint/mintMenu/plugins/applications.glade index 3986a83..9722395 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.glade +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.glade @@ -1,7 +1,6 @@ - - + 169 227 @@ -14,25 +13,26 @@ True False - + True False + vertical True False False False - 14 - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 3 + vertical 3 - + True False True @@ -40,11 +40,11 @@ True False - 0 15 10 <span weight="bold">Favorites</span> True + 0 True @@ -58,48 +58,40 @@ True True False - False none - + True False - 1 - 0 - 0 - 10 + end + 10 + 2 - + True False - 2 - - - True - False - All _Applications - True - - - True - True - 0 - - - - - True - False - 5 - gtk-go-forward - - - True - True - 1 - - + All _Applications + True + + True + True + 0 + + + + + True + False + 5 + 5 + gtk-go-forward + + + True + True + 1 + @@ -127,10 +119,12 @@ queue none - + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + True + True @@ -149,13 +143,14 @@ - + True False 3 + vertical 3 - + True False True @@ -163,11 +158,11 @@ True False - 0 15 10 <span weight="bold">All Applications</span> True + 0 True @@ -181,48 +176,40 @@ True True False - False none - + True False - 1 - 0 - 0 - 10 + end + 10 + 2 - + True False - 2 - - - True - False - _Favorites - True - - - True - True - 0 - - - - - True - False - 5 - gtk-go-forward - - - True - True - 1 - - + _Favorites + True + + True + True + 0 + + + + + True + False + 5 + 5 + gtk-go-forward + + + True + True + 1 + @@ -243,7 +230,7 @@ - + True False @@ -251,16 +238,18 @@ True True never - automatic True False none - + True False + True + True + vertical @@ -273,10 +262,11 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical False @@ -291,17 +281,18 @@ False True never - automatic True False none - + True False + True 6 + vertical @@ -336,7 +327,7 @@ - + 227 30 True @@ -366,8 +357,6 @@ True False False - True - True @@ -381,12 +370,11 @@ 28 True True + False True True False - False none - False @@ -395,7 +383,7 @@ True True gtk-find - 1 + 1 diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.glade b/usr/lib/linuxmint/mintMenu/plugins/places.glade index 569388c..167e844 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/places.glade +++ b/usr/lib/linuxmint/mintMenu/plugins/places.glade @@ -1,7 +1,6 @@ - - + False 3 @@ -15,10 +14,8 @@ True True 3 - automatic - automatic - + @@ -26,14 +23,16 @@ False none - + True False + vertical - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 2 @@ -43,9 +42,10 @@ - + True False + vertical start diff --git a/usr/lib/linuxmint/mintMenu/plugins/recent.glade b/usr/lib/linuxmint/mintMenu/plugins/recent.glade index a567995..2db0c15 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/recent.glade +++ b/usr/lib/linuxmint/mintMenu/plugins/recent.glade @@ -1,7 +1,6 @@ - - + False 3 @@ -12,9 +11,10 @@ False 5 - + True False + vertical 3 @@ -25,16 +25,15 @@ True True - automatic - automatic True False - + True False + vertical start @@ -59,17 +58,16 @@ True False - automatic - automatic True False none - + True False + vertical start @@ -105,7 +103,6 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True diff --git a/usr/lib/linuxmint/mintMenu/plugins/system_management.glade b/usr/lib/linuxmint/mintMenu/plugins/system_management.glade index 31bc2ce..fe21a9e 100644 --- a/usr/lib/linuxmint/mintMenu/plugins/system_management.glade +++ b/usr/lib/linuxmint/mintMenu/plugins/system_management.glade @@ -1,7 +1,6 @@ - - + False 3 @@ -15,10 +14,8 @@ True True 3 - automatic - automatic - + @@ -26,14 +23,16 @@ False none - + True False + vertical - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical 2 @@ -43,9 +42,10 @@ - + True False + vertical start From 76b0ace41f4cc6a7a04723ad16b94df7ea9cedd9 Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Tue, 6 Sep 2016 18:27:13 +0100 Subject: [PATCH 03/31] glade part #2 --- .../linuxmint/mintMenu/mintMenuConfig.glade | 1448 +++++++---------- 1 file changed, 633 insertions(+), 815 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade index 29dcf3f..f1522d7 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade @@ -1,97 +1,60 @@ - + + 10 - 0 - 0 1 - 0 - 0 - 128 1 - 0 - 1 - 0 + 128 1 + 1 100 - 0 - 0 1 - 0 - 0 - 128 1 - 0 - 1 - 0 + 128 1 + 1 1000 - 0 - 2 - 1 - 0 100 + 1 + 2 - 4 1 - 0 - 1 - 0 + 4 1 + 1 - 128 1 - 0 - 1 - 0 + 128 1 + 1 10000 - 0 - 10 1 - 0 - 0 + 10 - 128 1 - 0 - 1 - 0 + 128 1 + 1 10000 - 0 - 10 1 - 0 - 0 + 10 - - - - - - - Default - - - - - False 5 @@ -101,12 +64,12 @@ True dialog - + True False 2 - + True False end @@ -133,7 +96,6 @@ True True True - False True @@ -151,28 +113,34 @@ - + True False - 2 - 2 - 2 5 + 2 + + + True + False + Name: + + + 0 + 0 + + True True - + True False False - True - True 1 - 2 - GTK_EXPAND + 0 @@ -182,35 +150,22 @@ Path: + 0 1 - 2 - GTK_EXPAND - - True - False - Name: - - - GTK_EXPAND - - - - + True False True True - + True False False - True - True True @@ -223,7 +178,6 @@ True True True - False True @@ -241,17 +195,14 @@ 1 - 2 1 - 2 - - True + False True - 1 + 2 @@ -270,12 +221,12 @@ dialog select-folder - + True False 2 - + True False end @@ -286,7 +237,6 @@ True True True - False True @@ -302,7 +252,6 @@ True True True - False True @@ -326,8 +275,20 @@ button1 + button2 + + + + + + + + Default + + + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -335,10 +296,11 @@ center True - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + vertical True @@ -677,216 +639,164 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - True + 10 + 10 + 10 + 10 + 0 + none - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 0 - 0 - none + vertical - + + Use custom colors + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + 5 + True + + + False + True + 5 + 0 + + + + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 6 - 6 + 2 + True - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + Headings: + start + + + 0 + 0 + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 0 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + Borders: + + + 0 + 1 + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 1 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + Background: + + + 0 + 2 + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + + 1 + 2 + + + + + True + False + start + Theme: + + + 0 + 3 + + + + + True + False + model1 - - Use custom colors - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - 0 - True - - - False - True - 5 - 0 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 4 - 2 - 2 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Headings: - - - GTK_FILL - GTK_FILL - 5 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Borders: - - - 1 - 2 - GTK_FILL - GTK_FILL - 5 - - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Background: - - - 2 - 3 - GTK_FILL - GTK_FILL - 5 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - #000000000000 - - - 1 - 2 - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - #000000000000 - - - 1 - 2 - 2 - 3 - GTK_FILL - GTK_FILL - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - #000000000000 - - - 1 - 2 - GTK_FILL - GTK_FILL - - - - - True - False - 0 - Theme: - - - 3 - 4 - - - - - True - False - model1 - - - - 0 - - - - - 1 - 2 - 3 - 4 - - - - - False - True - 1 - + + + 0 + + + 1 + 3 + - - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - + + False + True + 1 + - - True - True - 0 - + + 2 + @@ -901,57 +811,35 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 + 10 + 10 + 10 + 10 0 none - + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 8 - 2 5 - True - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Icon size: - - - 4 - 5 - GTK_FILL - - - - - + + Show application comments True True + False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - True - True - adjustment3 + 10 + True - 1 - 2 - 4 - 5 - GTK_FILL - - 5 + 0 + 0 + 2 @@ -961,33 +849,12 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True - 2 + 0 1 - 2 - GTK_FILL - - 5 - - - - - Show application comments - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - - - 2 - GTK_FILL - - 5 + 2 @@ -997,16 +864,12 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True - 2 + 0 2 - 3 - GTK_FILL - - 5 + 2 @@ -1014,14 +877,12 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 + start Hover delay (seconds): + 0 3 - 4 - GTK_FILL - @@ -1029,21 +890,46 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + + 100 False False - True - True adjustment4 + 100 1 - 2 3 - 4 - GTK_FILL - - 5 + + + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + Icon size: + + + 0 + 4 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + 1 + False + False + adjustment3 + 1 + + + 1 + 4 @@ -1051,14 +937,12 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 + start Search command: + 0 5 - 6 - GTK_FILL - @@ -1066,20 +950,13 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_STRUCTURE_MASK - + False False - True - True 1 - 2 5 - 6 - - - 5 @@ -1108,32 +985,29 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True - 2 + 0 7 - 8 - GTK_FILL - - 5 + 2 + + + + + + - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - - + + 3 + - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -1145,34 +1019,34 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 + 10 + 10 + 10 + 10 0 none - + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 3 - 2 - 5 + 5 5 + 5 True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 + start Number of columns: - GTK_FILL - GTK_FILL - 5 + 0 + 0 @@ -1180,18 +1054,15 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 False False - True - True adjustment5 + 1 1 - 2 - GTK_FILL - GTK_FILL - 5 + 0 @@ -1199,15 +1070,12 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 + start Icon size: + 0 1 - 2 - GTK_FILL - GTK_FILL - 5 @@ -1215,20 +1083,15 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 1 False False - True - True adjustment6 + 1 1 - 2 1 - 2 - GTK_FILL - GTK_FILL - 5 @@ -1238,29 +1101,20 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True - 2 + 0 2 - 3 - GTK_FILL - GTK_FILL - 5 + 2 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - True - - + + 4 + @@ -1275,28 +1129,48 @@ - + True False + 10 + 10 + 10 + 10 0 none - + True False - 12 + vertical - + + Allow Scrollbar + True + True + False + 10 + True + + + False + False + 0 + + + + True False + 5 + 3 + 4 - - Allow Scrollbar + True - True - False - False - True + False + Height: + True False @@ -1305,422 +1179,367 @@ - + True - False - 3 - 5 - - - True - False - 4 - - - True - False - Height: - True - - - False - False - 0 - - - - - True - True - 5 - - False - False - False - True - True - adjustment7 - True - - - False - False - 2 - - - - + True + 5 + + False + False + False + adjustment7 + True False False - 4 - 1 + 2 + + + + + False + True + 1 + + + + + True + False + 3 + 4 + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + Icon size: + + + False + True + 0 - + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + False + False + adjustment8 + + + False + False + 1 + + + + + True + True + 2 + + + + + True + False + 0 + none + + True False - 3 - 4 + 14 + 2 + 10 + vertical - + + Computer True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Icon size: + True + False + True False + False + 0 + + + + + Home Folder + True + True + False + True + + + True + True + 1 + + + + + Network + True + True + False + True + + + True + True + 2 + + + + + Desktop + True + True + False + True + + + True + True + 3 + + + + + Trash + True + True + False + True + + + True + True + 4 + + + + + + + True + False + Toggle Default Places: + True + + + + + False + False + 3 + + + + + Show GTK bookmarks + True + True + False + True + + + True + True + 4 + + + + + True + False + 0 + none + + + True + False + 9 + + + True + True + etched-in + + + True + True + True + + + + + + + + True True 0 - + True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - True - True - adjustment8 + False + vertical + + + True + False + vertical + 5 + + + gtk-new + True + True + True + True + + + False + False + 0 + + + + + gtk-edit + True + True + True + True + + + False + False + 1 + + + + + False + False + 6 + 0 + + + + + True + False + vertical + + + gtk-go-up + True + True + True + True + + + False + False + 0 + + + + + gtk-go-down + True + True + True + True + + + False + False + 1 + + + + + False + False + 5 + 1 + + + + + True + False + vertical + + + gtk-remove + True + True + True + True + + + False + False + 0 + + + + + False + False + 5 + 2 + + False False + 6 1 - - True - True - 2 - - - + + True False - 0 - none - - - True - False - 2 - 10 - 14 - - - True - False - - - Computer - True - True - False - False - True - - - False - False - 0 - - - - - Home Folder - True - True - False - False - True - - - True - True - 1 - - - - - Network - True - True - False - False - True - - - True - True - 2 - - - - - Desktop - True - True - False - False - True - - - True - True - 3 - - - - - Trash - True - True - False - False - True - - - True - True - 4 - - - - - - - - - True - False - Toggle Default Places: - True - - + Custom Places: + True - - False - False - 3 - - - - - Show GTK bookmarks - True - True - False - False - True - - - True - True - 4 - - - - - True - False - 0 - none - - - True - False - 9 - - - True - False - - - True - True - automatic - automatic - etched-in - - - True - True - True - - - - - True - True - 0 - - - - - True - False - - - True - False - 5 - - - gtk-new - True - True - True - False - True - - - False - False - 0 - - - - - gtk-edit - True - True - True - False - True - - - False - False - 1 - - - - - False - False - 6 - 0 - - - - - True - False - - - gtk-go-up - True - True - True - False - True - - - False - False - 0 - - - - - gtk-go-down - True - True - True - False - True - - - False - False - 1 - - - - - False - False - 5 - 1 - - - - - True - False - - - gtk-remove - True - True - True - False - True - - - False - False - 0 - - - - - False - False - 5 - 2 - - - - - False - False - 6 - 1 - - - - - - - - - True - False - Custom Places: - True - - - - - True - True - 5 - + + True + True + 5 + - - - True - False - 1 - True - - + + 5 + @@ -2037,7 +1856,7 @@ - + True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK @@ -2050,7 +1869,6 @@ True True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False True From acf692a95eabdead0bb65a03de28e821753d3fea Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Tue, 6 Sep 2016 21:45:42 +0100 Subject: [PATCH 04/31] glade part #3 --- .../linuxmint/mintMenu/mintMenuConfig.glade | 919 +++++++++--------- 1 file changed, 451 insertions(+), 468 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade index f1522d7..75f6565 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade @@ -80,7 +80,6 @@ True True True - False True @@ -308,137 +307,118 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 4 - + True False + 10 + 10 + 10 + 10 0 none - + True False - 10 - 10 + 10 + True + True + 5 + 5 - + + Show button icon + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + True + + + 0 + 0 + 2 + + + + True False - 4 - 2 - 5 - 5 + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + Button text: + + + 0 + 1 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + False + False + + + 1 + 1 + + + + + True + False + start + Button icon: + + + 0 + 3 + + + + + True + False + 7 - - Show button icon - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - 0 - 0 - True - - - 2 - GTK_FILL - - - - - + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Button text: - 1 - 2 - GTK_FILL - + True + True + 0 - - - - + True False - 0 - Button icon: + gtk-missing-image> - 3 - 4 - GTK_FILL - - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - True - True - - - 1 - 2 - 1 - 2 - GTK_FILL - - - - - - - - - True - False - 7 - - - True - False - - - True - True - 0 - - - - - True - False - gtk-missing-image - - - True - True - 1 - - - - - 1 - 2 - 3 - 4 - GTK_FILL - + True + True + 1 + + 1 + 3 + + + + + + + @@ -456,175 +436,209 @@ - + True False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 6 - 3 + 10 + 10 + 10 + 10 + 0 + none - + True False 5 - + True False - 10 + 10 + vertical + 5 - + + Always start with favorites pane + True + True + False + True + + + False + False + 0 + + + + + Show applications plugin + True + True + False + True + True + + + False + False + 1 + + + + + Show system plugin + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + + False + False + 2 + + + + + Show places plugin> + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + + False + False + 3 + + + + + Show recent documents plugin + True + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + + + False + False + 4 + + + + True False - 5 + 8 + 3 - - Always start with favorites pane - True - True - False - False - True - - - False - False - 0 - - - - - Show applications plugin - True - True - False - False - True - True - - - False - False - 1 - - - - - Show system plugin - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - - - False - False - 2 - - - - - Show places plugin - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - - - False - False - 3 - - - - - Show recent documents plugin - True - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - False - True - - - False - False - 4 - - - - + True False - 2 - 3 - 8 - - - True - False - 0 - Border width: - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - True - True - adjustment1 - 1 - - - 1 - 2 - - - - - True - False - px - - - 2 - 3 - - + start + Border width: - False - True - 5 + 0 + 0 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + False + False + adjustment1 + 1 + + + 1 + 0 + + + + + True + False + start + 5 + px + + + 2 + 0 + + + + + True + False + start + Opacity: + + + 0 + 1 + + + + + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + False + False + adjustment2 + 1 + + + 1 + 1 + + + + + True + False + start + 5 + % + + + 2 + 1 + + False + True + 5 + - True + False True 0 - - False - True - 6 - 0 - + + 1 + @@ -1553,28 +1567,93 @@ - + True False + 10 + 10 + 10 + 10 0 none - + > True False - 12 + vertical - + + Allow Scrollbar + True + True + False + 10 + True + + + False + False + 0 + + + + True False + 5 + 3 + 4 - - Allow Scrollbar + + True + False + Height: + True + + + False + True + 0 + + + + True True - False - False - True + 5 + + False + False + False + adjustment9 + True + + + False + False + 2 + + + + + False + True + 1 + + + + + True + False + 4 + 4 + + + True + False + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + start + Icon size: False @@ -1583,72 +1662,48 @@ - + True - False - 3 - 5 - - - True - False - 4 - - - True - False - Height: - True - - - False - True - 0 - - - - - True - True - 5 - - False - False - False - True - True - adjustment9 - True - - - False - False - 2 - - - - + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + + False + False + adjustment10 False - True - 4 + False 1 + + + False + False + 2 + + + + + True + False + 0 + none - + True False - 4 - 4 + 14 + 10 + vertical - + + Software Manager True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 0 - Icon size: + True + False + True False @@ -1657,16 +1712,12 @@ - + + Package Manager True True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - True - True - adjustment10 + False + True False @@ -1674,168 +1725,100 @@ 1 + + + Control Center + True + True + False + True + + + True + True + 2 + + + + + Terminal + True + True + False + none + True + + + True + True + 3 + + + + + Lock Screen + True + True + False + True + + + True + True + 4 + + + + + Logout + True + True + False + True + + + True + True + 5 + + + + + Quit + True + True + False + True + + + True + True + 6 + + - - False - False - 2 - - - + + True False - 0 - none - - - True - False - 2 - 10 - 14 - - - True - False - - - Software Manager - True - True - False - False - True - - - False - False - 0 - - - - - Package Manager - True - True - False - False - True - - - False - False - 1 - - - - - Control Center - True - True - False - False - True - - - True - True - 2 - - - - - Terminal - True - True - False - False - none - True - - - True - True - 3 - - - - - Lock Screen - True - True - False - False - 0.54000002145767212 - True - - - True - True - 4 - - - - - Logout - True - True - False - False - True - - - True - True - 5 - - - - - Quit - True - True - False - False - True - - - True - True - 6 - - - - - - - - - True - False - 0.56000000238418579 - Toggle Default Items: - True - - + Toggle Default Items: + True - - False - True - 3 - + + False + True + 3 + - - - True - False - - + + 6 + From a1d5e35535b3539b3a85b871a70a4a72b35ad2ed Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Tue, 6 Sep 2016 22:07:46 +0100 Subject: [PATCH 05/31] fix errors --- usr/lib/linuxmint/mintMenu/mintMenu.py | 2 +- usr/lib/linuxmint/mintMenu/plugins/applications.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index a0d41c4..acce03a 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -356,7 +356,7 @@ class MainWindow( object ): self.paneholder.pack_start( ImageBox, False, False, 0 ) self.paneholder.pack_start( PluginPane, False, False, 0 ) - self.tooltipsEnable( False )) + self.tooltipsEnable( False ) def loadTheme( self ): self.SetPaneColors( self.panesToColor ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 4040da5..9c55932 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -1397,7 +1397,7 @@ class pluginclass( object ): self.favorites.append( favButton ) self.favoritesPositionOnGrid( favButton ) favButton.connect( "drag-data-received", self.onFavButtonDragReorder ) - favButton.drag_dest_set( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY + favButton.drag_dest_set( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY ) favButton.connect( "drag-data-get", self.onFavButtonDragReorderGet ) favButton.drag_source_set ( Gdk.ModifierType.BUTTON1_MASK, self.toFav, Gdk.DragAction.COPY ) position += 1 From 4d9de57f27f0327b9032df0ccc6f2c44c9b380e0 Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Wed, 7 Sep 2016 00:40:16 +0100 Subject: [PATCH 06/31] fix some glade typos --- usr/lib/linuxmint/mintMenu/mintMenuConfig.glade | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade index 75f6565..2a67b5d 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade @@ -400,7 +400,7 @@ True False - gtk-missing-image> + gtk-missing-image True @@ -503,7 +503,7 @@ - Show places plugin> + Show places plugin True True False @@ -1577,7 +1577,7 @@ 0 none - > + True False vertical From daac10823f105255dc08dc96304b61ea94d5f667 Mon Sep 17 00:00:00 2001 From: leigh123linux Date: Wed, 7 Sep 2016 09:40:38 +0100 Subject: [PATCH 07/31] fix border colour --- usr/lib/linuxmint/mintMenu/mintMenu.py | 51 ++++++++++++++++---------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index acce03a..1ebbd35 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -177,18 +177,15 @@ class MainWindow( object ): self.globalEnableTooltips = self.panelSettings.get_boolean( "tooltips-enabled" ) - def SetupMintMenuBorder( self ): + def SetupMintMenuBorder( self, color = None ): context = self.window.get_style_context() - context.save() - context.set_state( Gtk.StateFlags.NORMAL ) if self.usecustomcolor: - bg_color = Gdk.RGBA() - bg_color.parse( self.custombordercolor ) - self.window.override_background_color( Gtk.StateFlags.NORMAL, bg_color ) - else: - self.window.override_background_color( Gtk.StateFlags.NORMAL, None ) + borderColor = Gdk.RGBA() + borderColor.parse( self.custombordercolor ) + self.window.override_background_color( context.get_state(), borderColor ) + elif color is not None: + self.window.override_background_color( context.get_state(), color ) self.border.set_padding( self.borderwidth, self.borderwidth, self.borderwidth, self.borderwidth ) - context.restore() def detect_desktop_environment (self): self.de = "mate" @@ -358,23 +355,37 @@ class MainWindow( object ): self.paneholder.pack_start( PluginPane, False, False, 0 ) self.tooltipsEnable( False ) + # A little bit hacky but works. + def getDefaultColors( self ): + widget = Gtk.EventBox() + widget.show() + + context = widget.get_style_context() + context.set_state( Gtk.StateFlags.NORMAL ) + context.add_class( Gtk.STYLE_CLASS_DEFAULT ) + context.add_class( Gtk.STYLE_CLASS_BACKGROUND ) + + fgColor = context.get_color( context.get_state() ) + bgColor = context.get_background_color( context.get_state() ) + borderColor = context.get_border_color( context.get_state() ) + + return { "fg": fgColor, "bg": bgColor, "border": borderColor } + def loadTheme( self ): - self.SetPaneColors( self.panesToColor ) - self.SetupMintMenuBorder() + colors = self.getDefaultColors() + self.SetPaneColors( self.panesToColor, colors["bg"] ) + self.SetupMintMenuBorder( colors["border"] ) self.SetHeadingStyle( self.headingsToColor ) - def SetPaneColors( self, items ): + def SetPaneColors( self, items, color = None ): for item in items: context = item.get_style_context() - context.save() - context.set_state( Gtk.StateFlags.NORMAL ) if self.usecustomcolor: - bg_color = Gdk.RGBA() - bg_color.parse( self.customcolor ) - item.override_background_color( Gtk.StateFlags.NORMAL, bg_color ) - else: - item.override_background_color( Gtk.StateFlags.NORMAL, None ) - context.restore() + bgColor = Gdk.RGBA() + bgColor.parse( self.customcolor ) + item.override_background_color( context.get_state(), bgColor ) + elif color is not None: + item.override_background_color( context.get_state(), color ) def SetHeadingStyle( self, items ): if self.usecustomcolor: From ee8ae40cd02d4989eabb408d65cc2ff0a689051e Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 12:45:07 +0100 Subject: [PATCH 08/31] Remove more ctypes --- usr/lib/linuxmint/mintMenu/keybinding.py | 7 ------- usr/lib/linuxmint/mintMenu/mintMenu.py | 5 +---- .../mintMenu/plugins/applications.py | 7 ------- .../linuxmint/mintMenu/plugins/easybuttons.py | 7 ------- usr/lib/linuxmint/mintMenu/plugins/places.py | 2 -- usr/lib/linuxmint/mintMenu/pointerMonitor.py | 19 +++++++++---------- 6 files changed, 10 insertions(+), 37 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/keybinding.py b/usr/lib/linuxmint/mintMenu/keybinding.py index f7cbd1d..ca50863 100644 --- a/usr/lib/linuxmint/mintMenu/keybinding.py +++ b/usr/lib/linuxmint/mintMenu/keybinding.py @@ -31,8 +31,6 @@ from Xlib.display import Display from Xlib import X, error from gi.repository import Gtk, Gdk, GdkX11, GObject, GLib import threading -import ctypes -from ctypes import * SPECIAL_MODS = (["Super_L", ""], ["Super_R", ""], @@ -169,11 +167,6 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): self.ungrab() self.display.close() -class KeymapKey(Structure): - _fields_ = [("keycode", c_uint), - ("group", c_int), - ("level", c_int)] - class KeybindingWidget(Gtk.Box): __gsignals__ = { 'accel-edited': (GObject.SignalFlags.RUN_LAST, None, ()), diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index f604f40..3092455 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -14,8 +14,6 @@ import gettext import traceback import time import gc -import ctypes -from ctypes import * import xdg.Config import keybinding import pointerMonitor @@ -753,9 +751,8 @@ class MenuWin( object ): ourWidth = self.mainwin.window.get_size()[0] ourHeight = self.mainwin.window.get_size()[1] + self.mainwin.offset - x = c_int() - y = c_int() # Get the dimensions/position of the widgetToAlignWith + print(self.applet.get_window().get_origin()) entryX = self.applet.get_window().get_origin().x entryY = self.applet.get_window().get_origin().y diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 2d6da86..d184132 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -13,8 +13,6 @@ import threading import commands import subprocess import filecmp -import ctypes -from ctypes import * from easybuttons import * from execute import Execute from easygsettings import EasyGSettings @@ -149,11 +147,6 @@ class SuggestionButton ( Gtk.Button ): def set_icon_size (self, size): self.image.set_pixel_size( size ) -class TargetEntry(Structure): - _fields_ = [("target", c_char_p), - ("flags", c_int), - ("info", c_int)] - class pluginclass( object ): TARGET_TYPE_TEXT = 80 toButton = ( Gtk.TargetEntry.new( "text/uri-list", 0, TARGET_TYPE_TEXT ), Gtk.TargetEntry.new( "text/uri-list", 0, TARGET_TYPE_TEXT ) ) diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index 19941d7..409868e 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -10,8 +10,6 @@ from execute import * import xdg.DesktopEntry import xdg.Menu from filemonitor import monitor as filemonitor -import ctypes -from ctypes import * class IconManager(GObject.GObject): @@ -232,11 +230,6 @@ class easyButton( Gtk.Button ): #[ iW, iH ] = iconManager.getIconSize( self.iconSize ) self.buttonImage.set_size_request( self.iconSize, self.iconSize ) -class TargetEntry(Structure): - _fields_ = [("target", c_char_p), - ("flags", c_int), - ("info", c_int)] - class ApplicationLauncher( easyButton ): def __init__( self, desktopFile, iconSize): diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py index d00c9ae..720edb0 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -6,8 +6,6 @@ import string import gettext import commands import time -import ctypes -from ctypes import * from easybuttons import * from easygsettings import EasyGSettings diff --git a/usr/lib/linuxmint/mintMenu/pointerMonitor.py b/usr/lib/linuxmint/mintMenu/pointerMonitor.py index caaa754..67c2410 100644 --- a/usr/lib/linuxmint/mintMenu/pointerMonitor.py +++ b/usr/lib/linuxmint/mintMenu/pointerMonitor.py @@ -7,10 +7,6 @@ from Xlib.display import Display from Xlib import X, error from gi.repository import Gtk, Gdk, GObject, GLib import threading -import ctypes -from ctypes import * - -gdk = CDLL("libgdk-3.so.0") class PointerMonitor(GObject.GObject, threading.Thread): __gsignals__ = { @@ -27,9 +23,7 @@ class PointerMonitor(GObject.GObject, threading.Thread): # Receives GDK windows def addWindowToMonitor(self, window): - gdk.gdk_x11_drawable_get_xid.argtypes = [c_void_p] - xWindow = self.display.create_resource_object("window", gdk.gdk_x11_drawable_get_xid(hash(window))) - self.windows.append(xWindow) + self.windows.append(window) def grabPointer(self): self.root.grab_button(X.AnyButton, X.AnyModifier, True, X.ButtonPressMask, X.GrabModeSync, X.GrabModeAsync, 0, 0) @@ -54,9 +48,14 @@ class PointerMonitor(GObject.GObject, threading.Thread): if event.type == X.ButtonPress: # Check if pointer is inside monitored windows for w in self.windows: - p = w.query_pointer() - g = w.get_geometry() - if p.win_x >= 0 and p.win_y >= 0 and p.win_x <= g.width and p.win_y <= g.height: + if Gtk.check_version (3, 20, 0) is None: + pdevice = Gdk.Display.get_default().get_default_seat().get_pointer() + else: + pdevice = Gdk.Display.get_default().get_device_manager().get_client_pointer() + p = self.get_window().get_device_position(pdevice) + g = self.get_size() + + if p.x >= 0 and p.y >= 0 and p.x <= g.width and p.y <= g.height: break else: # Is outside, so activate From 0824cdf39d286a2d7447bf2ed203b95441f9a7c0 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 13:02:28 +0100 Subject: [PATCH 09/31] Fix get_origin calls in Betsy --- usr/lib/linuxmint/mintMenu/mintMenu.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 3092455..70cd375 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -752,9 +752,13 @@ class MenuWin( object ): ourHeight = self.mainwin.window.get_size()[1] + self.mainwin.offset # Get the dimensions/position of the widgetToAlignWith - print(self.applet.get_window().get_origin()) - entryX = self.applet.get_window().get_origin().x - entryY = self.applet.get_window().get_origin().y + try: + entryX = self.applet.get_window().get_origin().x + entryY = self.applet.get_window().get_origin().y + except: + # In Betsy get_origin returns an unamed tuple so the code above fails + entryX = self.applet.get_window().get_origin()[1] + entryY = self.applet.get_window().get_origin()[2] entryWidth, entryHeight = self.applet.get_allocation().width, self.applet.get_allocation().height entryHeight = entryHeight + self.mainwin.offset From 240c5cbc266490574640e876b5d51fdd0fc6ff9d Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 13:24:38 +0100 Subject: [PATCH 10/31] Fix keybinding in LMDE --- usr/lib/linuxmint/mintMenu/keybinding.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/keybinding.py b/usr/lib/linuxmint/mintMenu/keybinding.py index ca50863..3f23db9 100644 --- a/usr/lib/linuxmint/mintMenu/keybinding.py +++ b/usr/lib/linuxmint/mintMenu/keybinding.py @@ -60,19 +60,6 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): self.raw_keyval = None self.keytext = "" - def is_hotkey(self, key, modifier): - keymatch = False - modmatch = False - modifier = modifier & ~Gdk.ModifierType.SUPER_MASK - modint = int(modifier) - if self.get_keycode(key) == self.keycode: - keymatch = True - for ignored_mask in self.ignored_masks: - if self.modifiers | ignored_mask == modint | ignored_mask: - modmatch = True - break - return keymatch and modmatch - def map_modifiers(self): gdk_modifiers =(Gdk.ModifierType.CONTROL_MASK, Gdk.ModifierType.SHIFT_MASK, Gdk.ModifierType.MOD1_MASK, Gdk.ModifierType.MOD2_MASK, Gdk.ModifierType.MOD3_MASK, Gdk.ModifierType.MOD4_MASK, Gdk.ModifierType.MOD5_MASK, @@ -82,9 +69,6 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): if "Mod" not in Gtk.accelerator_name(0, modifier) or "Mod4" in Gtk.accelerator_name(0, modifier): self.known_modifiers_mask |= modifier - def get_keycode(self, keyval): - return self.keymap.get_entries_for_keyval(keyval).keys[0].keycode - def grab(self, key): accelerator = key accelerator = accelerator.replace("", "") @@ -95,7 +79,11 @@ class GlobalKeyBinding(GObject.GObject, threading.Thread): return False self.keytext = key - self.keycode = self.get_keycode(keyval) + try: + self.keycode = self.keymap.get_entries_for_keyval(keyval).keys[0].keycode + except: + # In Betsy, the get_entries_for_keyval() returns an unamed tuple... + self.keycode = self.keymap.get_entries_for_keyval(keyval)[1][0].keycode self.modifiers = int(modifiers) catch = error.CatchError(error.BadAccess) From bf34d718cca165159187c615635261157ede7dc8 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 13:30:28 +0100 Subject: [PATCH 11/31] Fix unknown variable name --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index d184132..8db50e9 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -860,9 +860,9 @@ class pluginclass( object ): return False - def favPopup( self, widget, ev ): - if ev.button == 3: - if ev.y > widget.get_allocation().height / 2: + def favPopup( self, widget, event ): + if event.button == 3: + if event.y > widget.get_allocation().height / 2: insertBefore = False else: insertBefore = True @@ -916,7 +916,7 @@ class pluginclass( object ): mTree.show_all() self.mintMenuWin.stopHiding() - mTree.popup(None, None, None, None, ev.button, ev.time) + mTree.popup(None, None, None, None, event.button, event.time) else: mTree = Gtk.Menu() mTree.set_events(Gdk.EventMask.POINTER_MOTION_MASK | Gdk.EventMask.POINTER_MOTION_HINT_MASK | @@ -935,7 +935,7 @@ class pluginclass( object ): insertSpaceMenuItem.connect( "activate", self.onFavoritesInsertSpace, widget, insertBefore ) insertSeparatorMenuItem.connect( "activate", self.onFavoritesInsertSeparator, widget, insertBefore ) self.mintMenuWin.stopHiding() - mTree.popup(None, None, None, None, ev.button, ev.time) + mTree.popup(None, None, None, None, event.button, event.time) def menuPopup( self, widget, event ): if event.button == 3: @@ -997,7 +997,7 @@ class pluginclass( object ): startupMenuItem.connect( "toggled", self.onAddToStartup, widget ) self.mintMenuWin.stopHiding() - mTree.popup(None, None, None, None, ev.button, ev.time) + mTree.popup(None, None, None, None, event.button, event.time) def searchPopup( self, widget=None, event=None ): From ccf9573581f5762f4427271653d1d5a5f16b8707 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 13:44:09 +0100 Subject: [PATCH 12/31] Fix popup menus --- usr/lib/linuxmint/mintMenu/plugins/applications.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 8db50e9..5384025 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -916,6 +916,7 @@ class pluginclass( object ): mTree.show_all() self.mintMenuWin.stopHiding() + mTree.attach_to_widget(widget, None) mTree.popup(None, None, None, None, event.button, event.time) else: mTree = Gtk.Menu() @@ -935,6 +936,7 @@ class pluginclass( object ): insertSpaceMenuItem.connect( "activate", self.onFavoritesInsertSpace, widget, insertBefore ) insertSeparatorMenuItem.connect( "activate", self.onFavoritesInsertSeparator, widget, insertBefore ) self.mintMenuWin.stopHiding() + mTree.attach_to_widget(widget, None) mTree.popup(None, None, None, None, event.button, event.time) def menuPopup( self, widget, event ): @@ -997,6 +999,7 @@ class pluginclass( object ): startupMenuItem.connect( "toggled", self.onAddToStartup, widget ) self.mintMenuWin.stopHiding() + mTree.attach_to_widget(widget, None) mTree.popup(None, None, None, None, event.button, event.time) @@ -1078,9 +1081,9 @@ class pluginclass( object ): menu.show_all() self.mintMenuWin.stopHiding() + menu.attach_to_widget(self.searchButton, None) menu.popup(None, None, None, None, event.button, event.time) - #menu.attach_to_widget(self.searchButton, None) #menu.reposition() #menu.reposition() #self.mintMenuWin.grab() From 916ad7b7313cf84c24a6a858a9eba94d95e343ba Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 15:50:25 +0100 Subject: [PATCH 13/31] Fix DND in favorites --- .../mintMenu/plugins/applications.py | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/applications.py b/usr/lib/linuxmint/mintMenu/plugins/applications.py index 5384025..3305b42 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/applications.py +++ b/usr/lib/linuxmint/mintMenu/plugins/applications.py @@ -1407,10 +1407,10 @@ class pluginclass( object ): favButton.position = position self.favorites.append( favButton ) self.favoritesPositionOnGrid( favButton ) - favButton.connect( "drag-data-received", self.onFavButtonDragReorder ) - favButton.drag_dest_set( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY ) - favButton.connect( "drag-data-get", self.onFavButtonDragReorderGet ) - favButton.drag_source_set ( Gdk.ModifierType.BUTTON1_MASK, self.toFav, Gdk.DragAction.COPY ) + favButton.drag_source_set (Gdk.ModifierType.BUTTON1_MASK, self.toFav, Gdk.DragAction.COPY) + favButton.drag_dest_set(Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY) + favButton.connect("drag-data-get", self.on_drag_data_get) + favButton.connect("drag-data-received", self.on_drag_data_received) position += 1 self.favoritesSave() @@ -1469,10 +1469,10 @@ class pluginclass( object ): self.favorites.append( favButton ) self.favoritesPositionOnGrid( favButton ) - favButton.connect( "drag-data-received", self.onFavButtonDragReorder ) - favButton.drag_dest_set( Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY ) - favButton.connect( "drag-data-get", self.onFavButtonDragReorderGet ) - favButton.drag_source_set ( Gdk.ModifierType.BUTTON1_MASK, self.toFav, Gdk.DragAction.COPY ) + favButton.connect("drag-data-received", self.on_drag_data_received) + favButton.drag_dest_set(Gtk.DestDefaults.MOTION | Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, self.toFav, Gdk.DragAction.COPY) + favButton.connect("drag-data-get", self.on_drag_data_get) + favButton.drag_source_set (Gdk.ModifierType.BUTTON1_MASK, self.toFav, Gdk.DragAction.COPY) if position >= 0: self.favoritesReorder( favButton.position, position ) @@ -1519,15 +1519,14 @@ class pluginclass( object ): return False - def onFavButtonDragReorderGet( self, widget, context, selection, targetType, eventTime ): - if targetType == self.TARGET_TYPE_FAV: + def on_drag_data_get(self, widget, context, selection, info, time): + if info == self.TARGET_TYPE_FAV: self.drag_origin = widget.position - selection.set( selection.target, 8, str(widget.position)) + selection.set(selection.get_target(), 8, str(widget.position)) - def onFavButtonDragReorder( self, widget, context, x, y, selection, targetType, time ): - if targetType == self.TARGET_TYPE_FAV: - #self.favoritesReorder( int(selection.data), widget.position ) - self.favoritesReorder( self.drag_origin, widget.position ) + def on_drag_data_received( self, widget, context, x, y, selection, info, time): + if info == self.TARGET_TYPE_FAV: + self.favoritesReorder( int(selection.get_data()), widget.position ) def on_icon_theme_changed(self, theme): print "on_icon_theme_changed" From 65fb842a81239e9d20897105886d6481683ff0b5 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:00:31 +0100 Subject: [PATCH 14/31] Fix add to desktop --- debian/control | 2 +- usr/lib/linuxmint/mintMenu/plugins/easybuttons.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/debian/control b/debian/control index b4fe344..16c07bb 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Depends: mate-menus, gvfs-bin, python-xlib, - gir1.2-mate-panel, gir1.2-gtk-2.0, + gir1.2-mate-panel, gir1.2-gtk-2.0, gir1.2-mate-desktop mozo Description: Advanced MATE menu One of the most advanced menus under Linux. MintMenu supports filtering, diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index 409868e..89c23fe 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -3,6 +3,7 @@ from gi.repository import Gtk, Gdk, GLib from gi.repository import Pango from gi.repository import GObject +from gi.repository import MateDesktop import os.path import shutil import re @@ -399,11 +400,11 @@ class ApplicationLauncher( easyButton ): shutil.copyfile( self.desktopFile, self.startupFilePath ) # Remove %u, etc. from Exec entry, because MATE will not replace them when it starts the app - item = matedesktop.item_new_from_uri( self.startupFilePath, matedesktop.LOAD_ONLY_IF_EXISTS ) + item = MateDesktop.DesktopItem.new_from_uri(self.startupFilePath, MateDesktop.DesktopItemLoadFlags.ONLY_IF_EXISTS) if item: r = re.compile("%[A-Za-z]"); - tmp = r.sub("", item.get_string( matedesktop.KEY_EXEC ) ).strip() - item.set_string( matedesktop.KEY_EXEC, tmp ) + tmp = r.sub("", item.get_string( MateDesktop.DESKTOP_ITEM_EXEC ) ).strip() + item.set_string( MateDesktop.DESKTOP_ITEM_EXEC, tmp ) item.save( self.startupFilePath, 0 ) def removeFromStartup( self ): From c7a2d83dde68f7bc5fe7870417ea86063625b15f Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:04:01 +0100 Subject: [PATCH 15/31] Fix empty trash popup --- usr/lib/linuxmint/mintMenu/plugins/places.py | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/lib/linuxmint/mintMenu/plugins/places.py b/usr/lib/linuxmint/mintMenu/plugins/places.py index 720edb0..ee2a9ff 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/places.py +++ b/usr/lib/linuxmint/mintMenu/plugins/places.py @@ -259,6 +259,7 @@ class pluginclass( object ): trashMenu.show_all() emptyTrashMenuItem.connect ( "activate", self.emptyTrash, widget ) self.mintMenuWin.stopHiding() + trashMenu.attach_to_widget(widget, None) trashMenu.popup(None, None, None, None, 3, 0) def emptyTrash( self, menu, widget): From 419136c89aa910f613d033b8fe195612c461f36f Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:12:21 +0100 Subject: [PATCH 16/31] Removed obsolete opacity support in config window --- .../linuxmint/mintMenu/mintMenuConfig.glade | 74 ++++++++----------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade index 17a9b2c..49bdc5b 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade @@ -1,5 +1,5 @@ - + @@ -335,6 +335,7 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK start 5 + 0.5 True @@ -467,6 +468,7 @@ True True False + 0.5 True @@ -482,6 +484,7 @@ True False True + 0.5 True @@ -497,6 +500,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -512,6 +516,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -527,6 +532,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -582,47 +588,6 @@ 0 - - - True - False - start - Opacity: - - - 0 - 1 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - adjustment2 - 1 - - - 1 - 1 - - - - - True - False - start - 5 - % - - - 2 - 1 - - False @@ -686,6 +651,7 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK start 5 + 0.5 True @@ -861,6 +827,7 @@ False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK 11 + 0.5 True @@ -876,6 +843,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -891,6 +859,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -993,6 +962,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -1008,6 +978,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -1023,6 +994,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -1133,6 +1105,7 @@ True False GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 0.5 True @@ -1182,6 +1155,7 @@ True False 10 + 0.5 True @@ -1298,6 +1272,7 @@ True True False + 0.5 True @@ -1312,6 +1287,7 @@ True True False + 0.5 True @@ -1326,6 +1302,7 @@ True True False + 0.5 True @@ -1340,6 +1317,7 @@ True True False + 0.5 True @@ -1354,6 +1332,7 @@ True True False + 0.5 True @@ -1385,6 +1364,7 @@ True True False + 0.5 True @@ -1415,7 +1395,7 @@ True True - + @@ -1607,6 +1587,7 @@ False 10 10 + 0.5 True @@ -1725,6 +1706,7 @@ True False 10 + 0.5 True @@ -1740,6 +1722,7 @@ True False 10 + 0.5 True @@ -1755,6 +1738,7 @@ True False 10 + 0.5 True @@ -1771,6 +1755,7 @@ False 10 none + 0.5 True @@ -1786,6 +1771,7 @@ True False 10 + 0.5 True @@ -1801,6 +1787,7 @@ True False 10 + 0.5 True @@ -1816,6 +1803,7 @@ True False 10 + 0.5 True From 272a9079e4ce31d2fe132c1ab637a7ef43602ba3 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:18:43 +0100 Subject: [PATCH 17/31] [Alexei Sorokin] Recent: Fix Gtk warnings --- usr/lib/linuxmint/mintMenu/plugins/recent.py | 33 ++++++-------------- 1 file changed, 10 insertions(+), 23 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/recent.py b/usr/lib/linuxmint/mintMenu/plugins/recent.py index 2e3c6ed..933266c 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/recent.py +++ b/usr/lib/linuxmint/mintMenu/plugins/recent.py @@ -136,34 +136,21 @@ class pluginclass: AButton.set_size_request( 200, -1 ) AButton.set_relief( Gtk.ReliefStyle.NONE ) AButton.connect( "clicked", self.callback, Name ) + AButton.show() - Align1 = Gtk.Alignment() - Align1.set( 0, 0.5, 0, 0) - Align1.set_padding( 0, 0, 0, 0 ) - HBox1 = Gtk.Box( orientation=Gtk.Orientation.HORIZONTAL, spacing=5 ) - VBox1 = Gtk.Box( orientation=Gtk.Orientation.VERTICAL, spacing=2 ) - - VBox1.show() - - req = AButton.size_request() - - Label1 = Gtk.Label( DispName ) - Label1.set_size_request( req.width-20, -1 ) - Label1.set_ellipsize( Pango.EllipsizeMode.END ) - Label1.show() - VBox1.add( Label1 ) + Box1 = Gtk.Box(orientation=Gtk.Orientation.HORIZONTAL, spacing=5) ButtonIcon = Gtk.Image() + ButtonIcon.set_size_request(20, -1) ButtonIcon.set_from_pixbuf(RecentImage) - HBox1.add( ButtonIcon ) + Box1.add(ButtonIcon) - ButtonIcon.show() - HBox1.add( VBox1 ) - HBox1.show() - Align1.add( HBox1 ) - Align1.show() - AButton.add( Align1 ) - AButton.show() + Label1 = Gtk.Label( DispName ) + Label1.set_ellipsize( Pango.EllipsizeMode.END ) + Box1.add( Label1 ) + + AButton.add( Box1 ) + AButton.show_all() self.recentBox.pack_start( AButton, False, True, 0 ) From 7dde0271ee896b46c12e9f4aab39f5df2a444643 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:26:39 +0100 Subject: [PATCH 18/31] Fix race condition with dconf on session start gsettings is known to randomly spit changes signal by mistake at session start. Only start listening to these after the menu elements are created. --- usr/lib/linuxmint/mintMenu/mintMenu.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 70cd375..79275a2 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -462,7 +462,14 @@ class MenuWin( object ): self.applet = applet self.detect_desktop_environment() self.settings = Gio.Settings.new("com.linuxmint.mintmenu") - self.keybinder = keybinding.GlobalKeyBinding() + self.keybinder = keybinding.GlobalKeyBinding() + self.loadSettings() + + self.createPanelButton() + + self.mate_settings = Gio.Settings.new("org.mate.interface") + self.mate_settings.connect( "changed::gtk-theme", self.changeTheme ) + self.settings.connect( "changed::applet-text", self.reloadSettings ) self.settings.connect( "changed::theme-name", self.changeTheme ) self.settings.connect( "changed::hot-key", self.reloadSettings ) @@ -470,12 +477,6 @@ class MenuWin( object ): self.settings.connect( "changed::hide-applet-icon", self.reloadSettings ) self.settings.connect( "changed::applet-icon-size", self.reloadSettings ) self.settings.connect( "changed::hot-key", self.hotkeyChanged ) - self.loadSettings() - - self.mate_settings = Gio.Settings.new("org.mate.interface") - self.mate_settings.connect( "changed::gtk-theme", self.changeTheme ) - - self.createPanelButton() self.applet.set_flags( MatePanelApplet.AppletFlags.EXPAND_MINOR ) self.applet.connect( "button-press-event", self.showMenu ) From 63b9abce0e912d79686e7e709cdba1f3adc5933a Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:34:26 +0100 Subject: [PATCH 19/31] Fix #157 --- usr/lib/linuxmint/mintMenu/mintMenu.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index 79275a2..e675740 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -592,6 +592,8 @@ class MenuWin( object ): self.buttonText = self.settings.get_string("applet-text") self.theme_name = self.settings.get_string( "theme-name" ) self.hotkeyText = self.settings.get_string( "hot-key" ) + if not os.path.exists(self.settings.get_string("applet-icon")): + self.settings.reset("applet-icon") self.buttonIcon = self.settings.get_string( "applet-icon" ) self.iconSize = self.settings.get_int( "applet-icon-size" ) From 3c01271a1f73896bb0696ddcbf2adaa1244f135a Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Fri, 28 Apr 2017 16:49:14 +0100 Subject: [PATCH 20/31] Fix typo in debian/control --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 16c07bb..3397d28 100644 --- a/debian/control +++ b/debian/control @@ -19,7 +19,7 @@ Depends: mate-menus, gvfs-bin, python-xlib, - gir1.2-mate-panel, gir1.2-gtk-2.0, gir1.2-mate-desktop + gir1.2-mate-panel, gir1.2-gtk-2.0, gir1.2-mate-desktop, mozo Description: Advanced MATE menu One of the most advanced menus under Linux. MintMenu supports filtering, From 0653dcdf7ad8e084ae68a52301a38c89a3379138 Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Sat, 29 Apr 2017 03:00:45 -0700 Subject: [PATCH 21/31] Don't ignore icons from /usr/share/pixmaps This fixes some apps like Slack and WMail not showing the proper icon --- usr/lib/linuxmint/mintMenu/plugins/easybuttons.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index 89c23fe..04d0776 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -88,7 +88,7 @@ class IconManager(GObject.GObject): image = Gtk.Image() icon_found = False for theme in self.themes: - if theme.has_icon( realIconName ): + if theme.lookup_icon(realIconName, 0, Gtk.IconLookupFlags.FORCE_REGULAR): icon_found = True break From f67292b048147877cc4d58f59c52bd07650785c8 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Mon, 1 May 2017 17:00:00 +0100 Subject: [PATCH 22/31] Give the applet box a class name to allow easier themeing --- usr/lib/linuxmint/mintMenu/mintMenu.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index e675740..d0a0b74 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -505,11 +505,13 @@ class MenuWin( object ): def onWindowMap( self, *args ): self.applet.get_style_context().set_state( Gtk.StateFlags.SELECTED ) + self.button_box.get_style_context().set_state( Gtk.StateFlags.SELECTED ) self.keybinder.set_focus_window( self.mainwin.window.get_window() ) return False def onWindowUnmap( self, *args ): self.applet.get_style_context().set_state( Gtk.StateFlags.NORMAL ) + self.button_box.get_style_context().set_state( Gtk.StateFlags.NORMAL ) self.keybinder.set_focus_window() return False @@ -583,6 +585,8 @@ class MenuWin( object ): self.button_box.show_all() self.sizeButton() + self.button_box.get_style_context().add_class('mintmenu') + self.applet.add( self.button_box ) self.applet.set_background_widget( self.applet ) From b37564a4ccab3a3bebeee39c4595502a47557c13 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Mon, 1 May 2017 19:51:27 +0100 Subject: [PATCH 23/31] 5.7.7 --- debian/changelog | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/debian/changelog b/debian/changelog index c472e6a..ac8fe7c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,37 @@ +mintmenu (5.7.7) sonya; urgency=medium + + [ leigh123linux ] + * gtk3 + * glade part #1 + * glade part #2 + * glade part #3 + * fix errors + * fix some glade typos + * fix border colour + + [ Clement Lefebvre ] + * Remove more ctypes + * Fix get_origin calls in Betsy + * Fix keybinding in LMDE + * Fix unknown variable name + * Fix popup menus + * Fix DND in favorites + * Fix add to desktop + * Fix empty trash popup + * Removed obsolete opacity support in config window + * [Alexei Sorokin] Recent: Fix Gtk warnings + * Fix race condition with dconf on session start + * Fix #157 + * Fix typo in debian/control + + [ JosephMcc ] + * Don't ignore icons from /usr/share/pixmaps + + [ Clement Lefebvre ] + * Give the applet box a class name to allow easier themeing + + -- Clement Lefebvre Mon, 01 May 2017 19:50:14 +0100 + mintmenu (5.7.6) serena; urgency=medium * Reorganize imports From e86e11044d11dcba4f7f1b9f30c44719fb6b2700 Mon Sep 17 00:00:00 2001 From: JosephMcc Date: Mon, 1 May 2017 13:09:09 -0700 Subject: [PATCH 24/31] Remove the ability to set a custom border This just doesn't work the way a user would expect under gtk3 so go ahead and remove it. --- usr/lib/linuxmint/mintMenu/mintMenu.py | 27 +----- .../linuxmint/mintMenu/mintMenuConfig.glade | 86 ++----------------- usr/lib/linuxmint/mintMenu/mintMenuConfig.py | 15 ---- .../com.linuxmint.mintmenu.gschema.xml | 12 --- 4 files changed, 6 insertions(+), 134 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index d0a0b74..e89d589 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -62,7 +62,6 @@ class MainWindow( object ): self.window.get_window().set_decorations(Gdk.WMDecoration.BORDER) self.window.set_title("") self.paneholder = builder.get_object( "paneholder" ) - self.border = builder.get_object( "border" ) builder.connect_signals(self) @@ -86,10 +85,8 @@ class MainWindow( object ): self.settings.connect( "changed::start-with-favorites", self.toggleStartWithFavorites ) self.settings.connect( "changed::tooltips-enabled", self.toggleTooltipsEnabled ) self.settings.connect( "changed::use-custom-color", self.toggleUseCustomColor ) - self.settings.connect( "changed::custom-border-color", self.toggleCustomBorderColor ) self.settings.connect( "changed::custom-heading-color", self.toggleCustomHeadingColor ) self.settings.connect( "changed::custom-color", self.toggleCustomBackgroundColor ) - self.settings.connect( "changed::border-width", self.toggleBorderWidth ) self.getSetGSettingEntries() @@ -126,18 +123,10 @@ class MainWindow( object ): def toggleStartWithFavorites( self, settings, key, args = None ): self.startWithFavorites = settings.get_boolean(key) - def toggleBorderWidth( self, settings, key, args = None ): - self.borderwidth = settings.get_int(key) - self.SetupMintMenuBorder() - def toggleUseCustomColor( self, settings, key, args = None ): self.usecustomcolor = settings.get_boolean(key) self.loadTheme() - def toggleCustomBorderColor( self, settings, key, args = None ): - self.custombordercolor = settings.get_string(key) - self.SetupMintMenuBorder() - def toggleCustomBackgroundColor( self, settings, key, args = None): self.customcolor = settings.get_string(key) self.SetPaneColors( self.panesToColor ) @@ -153,24 +142,12 @@ class MainWindow( object ): self.usecustomcolor = self.settings.get_boolean( "use-custom-color" ) self.customcolor = self.settings.get_string( "custom-color" ) self.customheadingcolor = self.settings.get_string( "custom-heading-color" ) - self.custombordercolor = self.settings.get_string( "custom-border-color" ) - self.borderwidth = self.settings.get_int( "border-width" ) self.offset = self.settings.get_int( "offset" ) self.enableTooltips = self.settings.get_boolean( "tooltips-enabled" ) self.startWithFavorites = self.settings.get_boolean( "start-with-favorites" ) self.globalEnableTooltips = self.panelSettings.get_boolean( "tooltips-enabled" ) - def SetupMintMenuBorder( self, color = None ): - context = self.window.get_style_context() - if self.usecustomcolor: - borderColor = Gdk.RGBA() - borderColor.parse( self.custombordercolor ) - self.window.override_background_color( context.get_state(), borderColor ) - elif color is not None: - self.window.override_background_color( context.get_state(), color ) - self.border.set_padding( self.borderwidth, self.borderwidth, self.borderwidth, self.borderwidth ) - def PopulatePlugins( self ): self.panesToColor = [ ] self.headingsToColor = [ ] @@ -337,14 +314,12 @@ class MainWindow( object ): fgColor = context.get_color( context.get_state() ) bgColor = context.get_background_color( context.get_state() ) - borderColor = context.get_border_color( context.get_state() ) - return { "fg": fgColor, "bg": bgColor, "border": borderColor } + return { "fg": fgColor, "bg": bgColor } def loadTheme( self ): colors = self.getDefaultColors() self.SetPaneColors( self.panesToColor, colors["bg"] ) - self.SetupMintMenuBorder( colors["border"] ) self.SetHeadingStyle( self.headingsToColor ) def SetPaneColors( self, items, color = None ): diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade index 49bdc5b..c9b2639 100644 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.glade @@ -542,58 +542,7 @@ - - True - False - 8 - 3 - - - True - False - start - Border width: - - - 0 - 0 - - - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - False - False - adjustment1 - 1 - - - 1 - 0 - - - - - True - False - start - 5 - px - - - 2 - 0 - - - - - False - True - 5 - + @@ -693,31 +642,6 @@ 0 - - - True - False - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - start - Borders: - - - 0 - 1 - - - - - True - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - 1 - 1 - - True @@ -728,7 +652,7 @@ 0 - 2 + 1 @@ -740,7 +664,7 @@ 1 - 2 + 1 @@ -752,7 +676,7 @@ 0 - 3 + 2 @@ -769,7 +693,7 @@ 1 - 3 + 2 diff --git a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py index 96914b9..2d29950 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenuConfig.py +++ b/usr/lib/linuxmint/mintMenu/mintMenuConfig.py @@ -58,9 +58,6 @@ class mintMenuConfig( object ): self.builder.get_object("use_apt").set_label(_("Search for packages to install")) self.builder.get_object("swapGeneric").set_label(_("Swap name and generic name")) - self.builder.get_object("label11").set_text(_("Border width:")) - self.builder.get_object("label25").set_text(_("pixels")) - self.builder.get_object("buttonTextLabel").set_text(_("Button text:")) self.builder.get_object("label1").set_text(_("Options")) self.builder.get_object("applicationsLabel").set_text(_("Applications")) @@ -72,7 +69,6 @@ class mintMenuConfig( object ): self.builder.get_object("backgroundColorLabel").set_text(_("Background:")) self.builder.get_object("headingColorLabel").set_text(_("Headings:")) - self.builder.get_object("borderColorLabel").set_text(_("Borders:")) self.builder.get_object("themeLabel").set_text(_("Theme:")) #self.builder.get_object("applicationsLabel").set_text(_("Applications")) @@ -131,13 +127,10 @@ class mintMenuConfig( object ): self.placesIconSize = self.builder.get_object( "placesIconSize" ) self.systemIconSize = self.builder.get_object( "systemIconSize" ) self.favCols = self.builder.get_object( "numFavCols" ) - self.borderWidth = self.builder.get_object( "borderWidth" ) self.useCustomColors = self.builder.get_object( "useCustomColors" ) self.backgroundColor = self.builder.get_object( "backgroundColor" ) - self.borderColor = self.builder.get_object( "borderColor" ) self.headingColor = self.builder.get_object( "headingColor" ) self.backgroundColorLabel = self.builder.get_object( "backgroundColorLabel" ) - self.borderColorLabel = self.builder.get_object( "borderColorLabel" ) self.headingColorLabel = self.builder.get_object( "headingColorLabel" ) self.showButtonIcon = self.builder.get_object( "showButtonIcon" ) self.enableInternetSearch = self.builder.get_object( "enableInternetSearch" ) @@ -215,11 +208,9 @@ class mintMenuConfig( object ): self.bindGSettingsValueToWidget( self.settingsPlaces, "int", "icon-size", self.placesIconSize, "value-changed", self.placesIconSize.set_value, self.placesIconSize.get_value ) self.bindGSettingsValueToWidget( self.settingsSystem, "int", "icon-size", self.systemIconSize, "value-changed", self.systemIconSize.set_value, self.systemIconSize.get_value ) - self.bindGSettingsValueToWidget( self.settings, "int", "border-width", self.borderWidth, "value-changed", self.borderWidth.set_value, self.borderWidth.get_value_as_int ) self.bindGSettingsValueToWidget( self.settings, "bool", "use-custom-color", self.useCustomColors, "toggled", self.useCustomColors.set_active, self.useCustomColors.get_active ) self.bindGSettingsValueToWidget( self.settings, "color", "custom-color", self.backgroundColor, "color-set", self.backgroundColor.set_rgba, self.getBackgroundColor ) self.bindGSettingsValueToWidget( self.settings, "color", "custom-heading-color", self.headingColor, "color-set", self.headingColor.set_rgba, self.getHeadingColor ) - self.bindGSettingsValueToWidget( self.settings, "color", "custom-border-color", self.borderColor, "color-set", self.borderColor.set_rgba, self.getBorderColor ) self.bindGSettingsValueToWidget( self.settings, "bool", "hide-applet-icon", self.showButtonIcon, "toggled", self.setShowButtonIcon, self.getShowButtonIcon ) self.bindGSettingsValueToWidget( self.settings, "string", "applet-text", self.buttonText, "changed", self.buttonText.set_text, self.buttonText.get_text ) self.bindGSettingsValueToWidget( self.settings, "string", "hot-key", self.hotkeyWidget, "accel-edited", self.hotkeyWidget.set_val, self.hotkeyWidget.get_val ) @@ -382,20 +373,14 @@ class mintMenuConfig( object ): def toggleUseCustomColors( self, widget ): self.backgroundColor.set_sensitive( widget.get_active() ) - self.borderColor.set_sensitive( widget.get_active() ) self.headingColor.set_sensitive( widget.get_active() ) self.backgroundColorLabel.set_sensitive( widget.get_active() ) - self.borderColorLabel.set_sensitive( widget.get_active() ) self.headingColorLabel.set_sensitive( widget.get_active() ) def getBackgroundColor( self ): color = self.backgroundColor.get_rgba() return self.gdkRGBAToString( color ) - def getBorderColor( self ): - color = self.borderColor.get_rgba() - return self.gdkRGBAToString( color ) - def getHeadingColor( self ): color = self.headingColor.get_rgba() return self.gdkRGBAToString( color ) diff --git a/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml b/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml index 5bffba8..2620b92 100644 --- a/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml +++ b/usr/share/glib-2.0/schemas/com.linuxmint.mintmenu.gschema.xml @@ -32,12 +32,6 @@ - - 1 - - - - 0 @@ -85,12 +79,6 @@ - - - "#DEDEDE" - - - From 2373274304c58f79451fda735a028265113e3d58 Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Tue, 2 May 2017 13:07:29 +0100 Subject: [PATCH 25/31] Fix launching apps which use su-to-root This was removed by mistake during the port to GTK3. --- usr/lib/linuxmint/mintMenu/plugins/execute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/lib/linuxmint/mintMenu/plugins/execute.py b/usr/lib/linuxmint/mintMenu/plugins/execute.py index 67d9d5c..9e1f0e9 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/execute.py +++ b/usr/lib/linuxmint/mintMenu/plugins/execute.py @@ -23,7 +23,7 @@ def Execute( cmd , commandCwd=None): cwd = tmpCwd if isinstance( cmd, str ) or isinstance( cmd, unicode): - if (cmd.find("ubiquity") >= 0) or (cmd.find("/home/") >= 0) or (cmd.find("xdg-su") >= 0) or (cmd.find("\"") >= 0): + if (cmd.find("ubiquity") >= 0) or (cmd.find("/home/") >= 0) or (cmd.find("su-to-root") >= 0) or (cmd.find("xdg-su") >= 0) or (cmd.find("\"") >= 0): print "running manually..." try: os.chdir(cwd) From dfd867db6ba6e440145f93c4996c50aa538c246e Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Tue, 2 May 2017 13:10:55 +0100 Subject: [PATCH 26/31] 5.7.8 --- debian/changelog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/debian/changelog b/debian/changelog index ac8fe7c..f3d3f64 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +mintmenu (5.7.8) sonya; urgency=medium + + [ JosephMcc ] + * Remove the ability to set a custom border + + [ Clement Lefebvre ] + * Fix launching apps which use su-to-root + + -- Clement Lefebvre Tue, 02 May 2017 13:10:32 +0100 + mintmenu (5.7.7) sonya; urgency=medium [ leigh123linux ] From 9064176c5c7f18d9995ad407e3f67816dd5a0ecc Mon Sep 17 00:00:00 2001 From: monsta Date: Wed, 3 May 2017 10:13:11 +0300 Subject: [PATCH 27/31] build: fix dependencies for GTK+3 --- debian/control | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 3397d28..5956a66 100644 --- a/debian/control +++ b/debian/control @@ -11,7 +11,6 @@ Depends: ${python:Depends}, ${misc:Depends}, python (>= 2.4), python (<< 3), - python-gtk2, python-glade2, mint-common, python-mate-menu, python-xdg, xdg-utils, python-setproctitle, @@ -19,7 +18,7 @@ Depends: mate-menus, gvfs-bin, python-xlib, - gir1.2-mate-panel, gir1.2-gtk-2.0, gir1.2-mate-desktop, + gir1.2-mate-panel, gir1.2-gtk-3.0, gir1.2-mate-desktop, mozo Description: Advanced MATE menu One of the most advanced menus under Linux. MintMenu supports filtering, From 403d493375485cde89752f2bedec12aa10a1cb84 Mon Sep 17 00:00:00 2001 From: monsta Date: Wed, 3 May 2017 10:43:57 +0300 Subject: [PATCH 28/31] build: depend on GI packages of MATE >= 1.18.0 to avoid accidental usage with old GTK+2 build of MATE --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 5956a66..c8238e0 100644 --- a/debian/control +++ b/debian/control @@ -18,7 +18,7 @@ Depends: mate-menus, gvfs-bin, python-xlib, - gir1.2-mate-panel, gir1.2-gtk-3.0, gir1.2-mate-desktop, + gir1.2-mate-panel (>= 1.18.0), gir1.2-gtk-3.0, gir1.2-mate-desktop (>= 1.18.0), mozo Description: Advanced MATE menu One of the most advanced menus under Linux. MintMenu supports filtering, From fe5b4403a82bcab86e71f1605e40ee51f457ec5b Mon Sep 17 00:00:00 2001 From: monsta Date: Wed, 3 May 2017 10:44:52 +0300 Subject: [PATCH 29/31] build: remove dependencies on C libs of MATE they're not used directly, we only need GI packages, and these already depend on the corresponding C libs --- debian/control | 1 - 1 file changed, 1 deletion(-) diff --git a/debian/control b/debian/control index c8238e0..fcf0133 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,6 @@ Depends: mint-common, python-mate-menu, python-xdg, xdg-utils, python-setproctitle, - libmatepanelapplet, libmatedesktop, mate-menus, gvfs-bin, python-xlib, From 2c8a68633eb54781b0284abc7371fc75fad25877 Mon Sep 17 00:00:00 2001 From: monsta Date: Thu, 4 May 2017 11:15:06 +0300 Subject: [PATCH 30/31] fix menu crash when placed on left vertical panel --- usr/lib/linuxmint/mintMenu/mintMenu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/lib/linuxmint/mintMenu/mintMenu.py b/usr/lib/linuxmint/mintMenu/mintMenu.py index e89d589..529ad19 100755 --- a/usr/lib/linuxmint/mintMenu/mintMenu.py +++ b/usr/lib/linuxmint/mintMenu/mintMenu.py @@ -548,8 +548,8 @@ class MenuWin( object ): self.button_box.pack_start( self.button_icon , False, False, 0) self.button_box.pack_start( self.systemlabel , False, False, 0) self.button_icon.set_padding( 0, 5 ) - elif self.applet.get_orient( orientation=Gtk.Orientation.VERTICAL ) == MatePanelApplet.AppletOrient.RIGHT: - self.button_box = Gtk.Box() + elif self.applet.get_orient() == MatePanelApplet.AppletOrient.RIGHT: + self.button_box = Gtk.Box( orientation=Gtk.Orientation.VERTICAL ) self.systemlabel.set_angle( 90 ) self.button_box.pack_start( self.systemlabel , False, False, 0) self.button_box.pack_start( self.button_icon , False, False, 0) From 89c5ea08aeb3f04866bc0ed45e31aed84d033a56 Mon Sep 17 00:00:00 2001 From: monsta Date: Thu, 4 May 2017 11:19:03 +0300 Subject: [PATCH 31/31] easybuttons: fix runtime warning about missing MateDesktop version --- usr/lib/linuxmint/mintMenu/plugins/easybuttons.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py index 04d0776..275b128 100755 --- a/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py +++ b/usr/lib/linuxmint/mintMenu/plugins/easybuttons.py @@ -1,5 +1,7 @@ #!/usr/bin/python2 +import gi +gi.require_version('MateDesktop', '2.0') from gi.repository import Gtk, Gdk, GLib from gi.repository import Pango from gi.repository import GObject