1
1
#from gi.repository import Gtk
5
6
from softwarecenter.enums import ViewPages
6
7
from softwarecenter.paths import datadir
7
8
from mkit import floats_from_string
9
11
class SectionPainter(object):
11
# specify background overlay image and color mappings for available and installed view ids
12
BACKGROUND_IMAGES = {ViewPages.AVAILABLE : cairo.ImageSurface.create_from_png(
13
os.path.join(datadir, 'images/clouds.png')),
14
ViewPages.INSTALLED : cairo.ImageSurface.create_from_png(
15
os.path.join(datadir, 'images/arrows.png')),
13
# specify background overlay image and color mappings for available and
16
ViewPages.AVAILABLE: cairo.ImageSurface.create_from_png(
17
os.path.join(datadir, 'images/clouds.png')),
18
ViewPages.INSTALLED: cairo.ImageSurface.create_from_png(
19
os.path.join(datadir, 'images/arrows.png')),
17
BACKGROUND_COLORS = {ViewPages.AVAILABLE : floats_from_string('#0769BC'),
18
ViewPages.INSTALLED : floats_from_string('#aea79f'),
21
BACKGROUND_COLORS = {ViewPages.AVAILABLE: floats_from_string('#0769BC'),
22
ViewPages.INSTALLED: floats_from_string('#aea79f'),
21
25
def __init__(self):
22
26
self._view_id = None
25
28
def set_view_id(self, id):
29
31
def draw(self, widget, cr):