Index: src/gui/AlertBox.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/gui/AlertBox.py,v retrieving revision 1.16 diff -r1.16 AlertBox.py 146c146 < b1 = Button('OK') --- > b1 = Button('OK', border=self.border_style) Index: src/gui/Border.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/gui/Border.py,v retrieving revision 1.6 diff -r1.6 Border.py 99a100,101 > SHADOW_COLOR = 0x60303030 > 121c123 < self.style = self.BORDER_FLAT --- > self.style = style or self.BORDER_FLAT 123,124c125,126 < self.shadow_ho = 6 # Horisontal offset for dropshadow < self.shadow_vo = 6 # Vertical offset for dropshadow --- > self.shadow_ho = 6 # Horisontal offset for dropshadow > self.shadow_vo = 6 # Vertical offset for dropshadow 133a136,140 > try: > self.shadow_color = Color(self.osd.default_shadow_color) > except: > self.shadow_color = Color(self.SHADOW_COLOR) > 179,180c186,249 < # XXX Hack to make border draw inside the areas we expect. < if self.style == self.BORDER_FLAT: --- > self.width, self.height = self.parent.get_size() > pr = [ 0, 0, self.width, self.height ] > self.surface = self.parent.surface.subsurface( pr ) > > width, height = self.width, self.height > > if self.BORDER_SHADOW == self.style: > c = self.shadow_color.get_color_sdl() > > sr = ( pr[ 0 ] + self.shadow_ho, pr[ 1 ] + self.shadow_vo, pr[ 2 ], pr[ 3 ] ) > pr[ 2 ] += self.shadow_ho > pr[ 3 ] += self.shadow_vo > > psr = self.parent.surface.get_rect() > if psr[ 2 ] < pr[ 2 ] or psr[ 3 ] < pr[ 3 ]: > > tmp = self.parent.surface > from pygame.locals import * > self.parent.surface = pygame.Surface( ( pr[ 2 ], pr[ 3 ] ), > self.parent.surface.get_flags(), > self.parent.surface ) > # self.parent.surface = self.parent.surface.convert_alpha() # conver and optimize > > if self.parent.parent.surface: > s = self.parent.parent.surface > xo, yo = self.parent.left, self.parent.top > else: > s = self.osd.screen > xo, yo = self.parent.left, self.parent.top > # Copy old surface > self.parent.surface.blit( tmp, tmp.get_rect() ) > # Copy corners that have no shadow from parent.parent > self.parent.surface.blit( s, > ( 0, self.height ), > ( xo, yo + self.height, self.width + self.shadow_ho, self.shadow_vo ) > ) > self.parent.surface.blit( s, > ( self.width, 0 ), > ( xo + self.width, yo, self.shadow_ho, self.height ) > ) > self.surface = self.parent.surface.subsurface( pr ) > self.width, self.height = pr[ 2 ], pr[ 3 ] > self.parent.width = self.width > self.parent.height = self.height > > if c[3]: > box = pygame.Surface( ( width - self.shadow_ho, self.shadow_vo ) ) > box.fill( ( c[ 0 ], c[ 1 ], c[ 2 ] ) ) > box.set_alpha( c[ 3 ] ) > self.surface.blit( box, ( self.shadow_ho, height) ) > > box = pygame.Surface( ( self.shadow_ho, height ) ) > box.fill( ( c[ 0 ], c[ 1 ], c[ 2 ] ) ) > box.set_alpha( c[ 3 ] ) > self.surface.blit( box, ( width, self.shadow_vo ) ) > > else: > self.surface.fill( c, ( self.shadow_ho, self.height - self.shadow_vo, > self.width, self.shadow_vo ) ) > > self.surface.fill( c,( self.width - self.shadow_ho, self.shadow_vo, > self.shadow_ho, self.height ) ) > > # draw a border around it 182,185c251,253 < self.rect = pygame.draw.rect(self.parent.surface, c, < self.parent.surface.get_rect(), < self.thickness) < if DEBUG: print 'Border: x=%s, y=%s, w=%s, h=%s' % (self.left, self.top, self.width, self.height) --- > self.rect = pygame.draw.rect( self.surface, c, > ( self.left, self.top, width, height ), > self.thickness ) 186a255,263 > if self.BORDER_FLAT == self.style: > c = self.color.get_color_sdl() > self.rect = pygame.draw.rect( self.surface, c, > ( self.left, self.top, width, height ), > self.thickness ) > > if DEBUG: print 'Border: x=%s, y=%s, w=%s, h=%s' % (self.left, self.top, self.width, self.height) > self.blit_parent() > Index: src/gui/Button.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/gui/Button.py,v retrieving revision 1.12 diff -r1.12 Button.py 77c77 < from osd import Font --- > from osd import Font, OSDFont 106,109c106 < < if not height: < height = default_button_height < --- > 113a111,129 > > if not height: > if self.skin_info_widget.font: > nf = OSDFont( self.skin_info_widget.font.name, self.skin_info_widget.font.size ) > height = nf.height > > if self.skin_info_widget_selected.font: > sf = OSDFont( self.skin_info_widget_selected.font.name, \ > self.skin_info_widget_selected.font.size ) > if height: > height = max( height, sf.height ) > else: > height = sf.height > > if not height: > height = default_button_height > > self.height = height > 117a134 > self.height += self.v_margin * 2 127c144 < if self.skin_info_widget.font: --- > if self.skin_info_widget.font: Index: src/gui/Container.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/gui/Container.py,v retrieving revision 1.5 diff -r1.5 Container.py 110c110,112 < --- > else: > self.border = Border(self, self.border, > self.bd_color, self.bd_width) 152a155,157 > self.bd_color, self.bd_width) > else: > self.border = Border(self, self.border, Index: src/gui/Label.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/gui/Label.py,v retrieving revision 1.17 diff -r1.17 Label.py 134a135,143 > h_align Horizontal alignment > v_align Vertical alignment > width Width > height Height > text_prop A dict of 3 elements composing text proprieties: > { 'align_h' : align_h, 'align_v' : align_v, 'mode' : mode } > align_v = text vertical alignment > align_h = text horizontal alignment > mode = hard (break at chars); soft (break at words) 145c154 < width=-1, height=-1): --- > width=-1, height=-1, text_prop=None): 167a177,179 > self.text_prop = text_prop or { 'align_h': 'left', > 'align_v': 'top', > 'mode' : 'hard' } 248a261,264 > align_h = self.text_prop.setdefault( 'align_h', 'left' ) > align_v = self.text_prop.setdefault( 'align_v', 'top' ) > mode = self.text_prop.setdefault( 'mode', 'hard' ) > 251,252c267,268 < fgcolor=None, bgcolor=None, align_h='left', < align_v='top', mode='hard', layer='')[1] --- > fgcolor=None, bgcolor=None, align_h=align_h, > align_v=align_v, mode=mode, layer='')[1] 298a315,318 > align_h = self.text_prop[ 'align_h' ] > align_v = self.text_prop[ 'align_v' ] > mode = self.text_prop[ 'mode' ] > 302,303c322,323 < bgcolor=None, align_h='left', < align_v='top', mode='hard', --- > bgcolor=None, align_h=align_h, > align_v=align_v, mode=mode, Index: src/gui/PopupBox.py =================================================================== RCS file: /cvsroot/freevo/freevo/src/gui/PopupBox.py,v retrieving revision 1.23 diff -r1.23 PopupBox.py 135a136,137 > vertical_expansion Should it expands vertically to fits the contents? > horizontal_expansion Shout it expands horizontally to fits the contents? 143c145 < vertical_expansion=1): --- > vertical_expansion=1, horizontal_expansion=1, text_prop=None): 146c148,149 < --- > self.border_style = border = border or 'shadow' > 150a154,157 > text_prop = text_prop or { 'align_h': 'left', > 'align_v': 'top', > 'mode' : 'soft' } > 161d167 < 182c188,189 < self.label = Label(text, self, Align.CENTER, Align.CENTER) --- > self.label = Label(text, self, Align.CENTER, Align.CENTER, > text_prop=text_prop )