2
# -*- coding: utf-8 -*-
5
# a redefinition of senses
7
__authors__ = ["Jan Jokela <janjokela@gmail.com>"]
8
__licenses__ = ["LICENSE.LGPL"]
9
__description__ = "Button hover texture"
14
from cluttercairo import CairoTexture
16
class Texture(CairoTexture):
18
def __init__(self, width, height):
20
CairoTexture.__init__(self, width, height)
25
self.context = self.cairo_create()
27
linpat = cairo.LinearGradient(self.width / 2.0, 0.0, self.width / 2.0, self.height);
28
linpat.add_color_stop_rgba (0.0, 0.9, 0.9, 0.9, 1.0);
29
linpat.add_color_stop_rgba (1.0, 0.7, 0.8, 0.7, 1.0);
32
self.context.arc(self.height * 0.2, self.height * 0.2,
33
self.height * 0.2, math.pi, 3.0 * math.pi / 2.0)
34
self.context.line_to(self.width - (self.height * 0.2), 0.0)
35
self.context.arc(self.width - (self.height * 0.2),
40
self.context.line_to(self.width, self.height - (self.height * 0.2))
41
self.context.arc(self.width - (self.height * 0.2),
42
self.height - (self.height * 0.2),
46
self.context.line_to(self.height * 0.2, self.height)
47
self.context.arc(self.height * 0.2,
48
self.height - (self.height * 0.2),
53
self.context.close_path()
54
#self.context.set_source_rgba(0.0, 1.0, 0.0, 1.0)
55
self.context.set_source(linpat)
61
def resize(self, width, height):