[#2764] [Scheduler] Fix corrupt plugin prefs page on osx

This commit is contained in:
Calum Lind 2015-09-20 14:55:01 +01:00
parent fbf5d5287f
commit 356f224a25
1 changed files with 11 additions and 11 deletions

View File

@ -58,23 +58,23 @@ class SchedulerSelectWidget(gtk.DrawingArea):
# redraw the whole thing
def expose(self, widget, event):
self.context = self.window.cairo_create()
self.context.rectangle(event.area.x, event.area.y, event.area.width, event.area.height)
self.context.clip()
context = self.window.cairo_create()
context.rectangle(event.area.x, event.area.y, event.area.width, event.area.height)
context.clip()
width = self.window.get_size()[0]
height = self.window.get_size()[1]
for y in xrange(7):
for x in xrange(24):
self.context.set_source_rgba(self.colors[self.button_state[x][y]][0],
self.colors[self.button_state[x][y]][1],
self.colors[self.button_state[x][y]][2], 0.7)
self.context.rectangle(width * (6 * x / 145.0 + 1 / 145.0), height * (6 * y / 43.0 + 1 / 43.0),
5 * width / 145.0, 5 * height / 43.0)
self.context.fill_preserve()
self.context.set_source_rgba(0.5, 0.5, 0.5, 0.5)
self.context.stroke()
context.set_source_rgba(self.colors[self.button_state[x][y]][0],
self.colors[self.button_state[x][y]][1],
self.colors[self.button_state[x][y]][2], 0.7)
context.rectangle(width * (6 * x / 145.0 + 1 / 145.0), height * (6 * y / 43.0 + 1 / 43.0),
5 * width / 145.0, 5 * height / 43.0)
context.fill_preserve()
context.set_source_rgba(0.5, 0.5, 0.5, 0.5)
context.stroke()
# coordinates --> which box
def get_point(self, event):