Skip to content

Commit

Permalink
some improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
ayhanyalcinsoy committed Jun 2, 2022
1 parent 12fb563 commit 6d3166a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pds/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class Pds:

SupportedDesktops = (DefaultDe, Kde5, Kde4, Kde3, Xfce, Enlightenment, LXDE,
SupportedDesktops = (DefaultDe, Kde5, Xfce, Enlightenment, LXDE, LxQt, Lumina, Cinnamon,
Fluxbox, Gnome, Gnome3, Mate)

def __init__(self, catalogName='', debug=False):
Expand Down
16 changes: 16 additions & 0 deletions pds/environments.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,19 @@ class Mate(DefaultDe):
ConfigFile = ''
ConfigType = None
DefaultIconTheme = 'mate'

class Lumina(DefaultDe):
Name = 'lumina'
Version = '1.6'
ConfigPath = '$HOME/.config/lumina'
ConfigFile = ''
ConfigType = None
DefaultIconTheme = 'adwaita'

class Cinnamon(DefaultDe):
Name = 'cinnamon'
Version = '5.2'
ConfigPath = '$HOME/.config/cinnamon'
ConfigFile = ''
ConfigType = None
DefaultIconTheme = 'adwaita'
10 changes: 7 additions & 3 deletions pds/qiconloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def __init__(self, pds = None, debug = False, forceCache = False):

logging.debug('Icon Dirs : %s' % ','.join(self.iconDirs))
self.themeIndex = self.readThemeIndex(self.themeName)
#self.extraIcons = ['/usr/share/pixmaps/icons']
self.extraIcons = ['/usr/share/pixmaps', '/usr/share/pixmaps/icons']
self.updateAvailableIcons()

Expand Down Expand Up @@ -143,6 +144,7 @@ def __get_icons(self, themeName = ''):
for iconDir in self.extraIcons:
if path.exists(iconDir):
icons.extend(glob(path.join(iconDir, '*.png')))
icons.extend(glob(path.join(iconDir, '*.svg')))

_icons = map(lambda a: a.split('/')[-1][:-4], icons)

Expand Down Expand Up @@ -177,10 +179,12 @@ def findIconHelper(self, size = int, themeName = str, iconName = str):
pixmap.load(fileName)
logging.debug('Icon: %s found in theme %s' % \
(iconName, themeName))
#print "pixmap ->{}".format(fileName)
return pixmap
elif path.exists(fileName_svg):
pixmap.load(fileName_svg)
logging.debug('Icon: %s found in %s' % (iconName, iconDir))
#print "pixmap ->{}".format(fileName_svg)
return pixmap

for iconDir in self.extraIcons:
Expand All @@ -193,11 +197,11 @@ def findIconHelper(self, size = int, themeName = str, iconName = str):
return pixmap
elif path.exists(fileName_svg):
image=QImage(size, size, QImage.Format_RGB32)
reader=QImageReader(fileName)
reader=QImageReader(fileName_svg)
reader.read(image)
pixmap.convertFromImage(image)
logging.debug('Icon: %s found in %s' % (iconName, iconDir))
#print "pixmap ->{}".format(fileName)
#print "pixmap ->{}".format(fileName_svg)
return pixmap

if len(self._themes) > 0:
Expand Down Expand Up @@ -267,7 +271,7 @@ def load(self, name, size = 128, forceCache = False):
return icon.pixmap(QSize(size, size))
return pix

def loadOverlayed(self, name, overlay = None, size = 128, overlay_size = 16, position = 2):
def loadOverlayed(self, name, overlay = None, size = 128, overlay_size = 16, position = 0):

if not overlay:
return self.load(name, size)
Expand Down

0 comments on commit 6d3166a

Please sign in to comment.