~glitter-team/glitter/trunk

« back to all changes in this revision

Viewing changes to glitter/data/themes/sofa/resources/navigationbar_background_texture_normal.py

  • Committer: Jan Jokela
  • Date: 2009-09-15 22:04:08 UTC
  • Revision ID: jan@jan-laptop-20090915220408-92rpl49koraxt0gl
Added missing resources in sofa theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# !/usr/bin/python
 
2
# -*- coding: utf-8 -*-
 
3
 
 
4
# nublo
 
5
# a redefinition of senses
 
6
        
 
7
__authors__ = ["Jan Jokela <janjokela@gmail.com>"]
 
8
__licenses__ = ["LICENSE.LGPL"]
 
9
__description__ = "Navigation bar base texture"
 
10
 
 
11
import math
 
12
import clutter
 
13
import cairo
 
14
from cluttercairo import CairoTexture
 
15
 
 
16
class Texture(CairoTexture):
 
17
 
 
18
    def __init__(self, width, height):
 
19
        
 
20
        CairoTexture.__init__(self, width, height)
 
21
        
 
22
        self.width = width
 
23
        self.height = height
 
24
 
 
25
        self.context = self.cairo_create()
 
26
        
 
27
        linpat = cairo.LinearGradient(self.width / 2.0, 0.0, self.width / 2.0, self.height);
 
28
 
 
29
        linpat.add_color_stop_rgba (0.0,  0.2, 0.2, 0.2, 1.0);        
 
30
        linpat.add_color_stop_rgba (0.4,  0.1, 0.1, 0.1, 1.0);
 
31
        linpat.add_color_stop_rgba (0.95,  0.4, 0.4, 0.4, 1.0);
 
32
        linpat.add_color_stop_rgba (1.0,  0.1, 0.1, 0.1, 1.0);
 
33
 
 
34
        self.context.rectangle(0.0, 0.0, self.width, self.height)
 
35
 
 
36
        self.context.close_path()
 
37
        self.context.set_source(linpat)
 
38
        self.context.fill()
 
39
        
 
40
        self.context.stroke()
 
41
        del self.context      
 
42
          
 
43
    def resize(self, width, height):
 
44
 
 
45
        pass
 
46