~ubuntu-branches/debian/jessie/phatch/jessie

« back to all changes in this revision

Viewing changes to phatch/pyWx/lib/vlist.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski, Stani M, Piotr Ożarowski
  • Date: 2008-07-21 12:53:17 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080721125317-sqk2sdl3pwl2u4gl
Tags: 0.1.5-1
[ Stani M ]
* New upstream release(Closes LP: #228259, #232436, #236282, #236462, #237359)
* debian/control:
  - Added pkg-config and python-nautilus to build-depends, as
    setup.py uses nautilus-python.pc to look for the nautilus
    extensions path. Closes: #475233.
* debian/patches:
  - All patches of Ubuntu and Debian are implemented upstream and are removed
    from the package

[ Piotr Ożarowski ]
* Bump Standards-Version to 3.8.0 (no changes needed)
* debian/copyright wrapped at column 80 (where possible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        """Can be overwritten."""
36
36
        pass
37
37
        
 
38
    def GradientColour(self,colour):
 
39
        rgb     = r, g, b = colour.Red(), colour.Green(), colour.Blue()#wx2.6
 
40
        m       = max(rgb)
 
41
        rgb_without_max   = [x for x in rgb if x!=m]
 
42
        if not rgb_without_max:
 
43
            return wx.Colour(128,128,128)
 
44
        n       = max(rgb_without_max)
 
45
        keyw    = {}
 
46
        for c in ('Red','Green','Blue'):
 
47
            x   = getattr(colour,c)()
 
48
            if x == m:
 
49
                keyw[c.lower()] = x
 
50
            elif x == n:
 
51
                keyw[c.lower()] = x/2
 
52
            else:
 
53
                keyw[c.lower()] = x/8
 
54
        return wx.Colour(**keyw)
 
55
                
38
56
    def SetTheme(self,theme='default'):
39
57
        self._theme = theme
40
58
        if theme == 'light_blue': 
42
60
            self._color_from    = wx.Colour(180,197,214)
43
61
            self._color_to      = wx.Colour(217,226,234)
44
62
        else:
45
 
            self._color_from    = r, g, b = wx.SystemSettings_GetColour(
46
 
                                                wx.SYS_COLOUR_MENUHILIGHT)
47
 
##            self._color_to      = wx.SystemSettings_GetColour(
48
 
##                                        wx.SYS_COLOUR_HIGHLIGHT)
49
 
##            if self._color_from == self._color_to:
50
 
##                self._color_to  = wx.Colour(217,226,234)
51
 
            self._color_to      = wx.Colour(r*180/217,g*197/226,b*214/234)
 
63
            #theme based
 
64
            hilight = wx.SystemSettings_GetColour(wx.SYS_COLOUR_MENUHILIGHT)
 
65
            self._color_from    = self.GradientColour(hilight)
 
66
            self._color_to      = hilight
52
67
        
53
68
    def SetIconSize(self,icon_size=(48,48),units=5):#31.0):
54
69
        """All vertical spacing is calculated by the icon size.