Added single-click support.
authorStefanos Harhalakis <v13@v13.gr>
Mon, 28 Jun 2010 22:18:13 +0000 (22:18 +0000)
committerStefanos Harhalakis <v13@v13.gr>
Mon, 28 Jun 2010 22:18:13 +0000 (22:18 +0000)
Added asymmetric size support.

misc/drlaunch.desktop
src/config.py
src/icongrid.py
src/widget.py

index 93ab363..71434fc 100644 (file)
@@ -3,3 +3,4 @@ Name=DrLaunch
 Comment=Application launcer widget with portrait mode
 Type=python
 X-Path=drlaunch_widget.py
+X-Multiple=true
index 5c7e39e..67e111b 100755 (executable)
@@ -25,7 +25,7 @@ __version__ = "$Id: 0.py 2265 2010-02-21 19:16:26Z v13 $"
 import os
 import pickle
 
-version = "0.1"
+version = "0.2"
 
 try:
     from glib import get_user_config_dir
index 5eee444..5184d09 100755 (executable)
@@ -52,7 +52,7 @@ class IconGrid(object):       #(gobject.GObject):
     def __init__(self, isconfig=False):
 #      self.__gobject_init__()
 
-       self.size=0
+       self.size=(0,0)
 
        self.isconfig=isconfig
 
@@ -96,11 +96,11 @@ class IconGrid(object):     #(gobject.GObject):
 
        w=config.iconsize + config.iconspace
 
-       if self.mode=='l':
+       if self.mode=='l' or config.getIndiv():
            x2=int(x / w)
            y2=int(y / w)
        else:
-           x2=self.size - int(y/w) - 1
+           x2=self.size[1] - int(y/w) - 1
            y2=int(x/w)
 
        ret=self.get(x2,y2)
@@ -120,7 +120,7 @@ class IconGrid(object):     #(gobject.GObject):
                y2=y * (config.iconsize + config.iconspace)
            else:
                x2=y * (config.iconsize + config.iconspace)
-               y2=(self.size-x-1) * (config.iconsize + config.iconspace)
+               y2=(self.size[1]-x-1) * (config.iconsize + config.iconspace)
 
            # Only repaint the needed icons
            rect=gdk.Rectangle(x2, y2, w, w)
index 878c063..bf490f2 100755 (executable)
@@ -138,8 +138,7 @@ class DrlaunchPlugin(IconGrid, HomePluginItem, FremantleRotation):
            launcher.launch(icon.name)
 
     def signalLongpress(self, sender, icon):
-       if config.getLongpress():
-           self.handle_click(sender, icon)
+       self.handle_click(sender, icon)
 
     def signalClick(self, sender, icon):
        if not config.getLongpress():