18
18
from gettext import gettext as _
19
19
gettext.textdomain('qreator')
21
23
from gi.repository import Gtk, Gdk # pylint: disable=E0611
22
24
from gi.repository import GtkChamplain, Clutter, Champlain
297
width = widget.get_allocated_width()
298
height = widget.get_allocated_height()
300
corner_radius = height / 50.0
302
radius = corner_radius / aspect
303
degrees = math.pi / 180.0
305
lg = cairo.LinearGradient(0.0, 0.0, 500.0, 500.0)
306
lg.add_color_stop_rgba(0, 1, 1, 1, 1)
307
lg.add_color_stop_rgba(1, 0.678, 0.678, 0.678, 1)
309
#rg = cairo.RadialGradient(w/2.0, 0.0, 100.6,
311
#rg.add_color_stop_rgba(0, 1, 1, 1, 1)
312
#rg.add_color_stop_rgba(1, 0.678, 0.678, 0.678, 1)
315
#ctx.rectangle(0, 0, width, height)
318
ctx.arc(x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees)
319
ctx.arc(x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees)
320
ctx.arc(x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees)
321
ctx.arc(x + radius, y + radius, radius, 180 * degrees, 270 * degrees)
326
# Fill the background
327
#ctx.set_source_rgb(0.678, 0.678, 0.678)
328
#ctx.rectangle(0, 0, w, h)
330
##ctx.set_line_width(14)
331
#cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER);
332
#ctx.set_source_rgb(1, 0, 1)
333
#ctx.stroke_preserve()
293
336
# Create the QR code
294
337
qr_code = QRCode()
295
338
self.surface = qr_code.encode(text, QRCodeOutput.CAIRO_SURFACE)