diff --git a/ui/res/go_ul.png b/ui/res/go_corner.png similarity index 100% rename from ui/res/go_ul.png rename to ui/res/go_corner.png diff --git a/ui/res/go_d.png b/ui/res/go_d.png deleted file mode 100644 index f14f6b1..0000000 Binary files a/ui/res/go_d.png and /dev/null differ diff --git a/ui/res/go_dl.png b/ui/res/go_dl.png deleted file mode 100644 index ce5e48d..0000000 Binary files a/ui/res/go_dl.png and /dev/null differ diff --git a/ui/res/go_dr.png b/ui/res/go_dr.png deleted file mode 100644 index fd529dc..0000000 Binary files a/ui/res/go_dr.png and /dev/null differ diff --git a/ui/res/go_u.png b/ui/res/go_edge.png similarity index 100% rename from ui/res/go_u.png rename to ui/res/go_edge.png diff --git a/ui/res/go_l.png b/ui/res/go_l.png deleted file mode 100644 index fb4ea55..0000000 Binary files a/ui/res/go_l.png and /dev/null differ diff --git a/ui/res/go_r.png b/ui/res/go_r.png deleted file mode 100644 index 0baa335..0000000 Binary files a/ui/res/go_r.png and /dev/null differ diff --git a/ui/res/go_ur.png b/ui/res/go_ur.png deleted file mode 100644 index de238a1..0000000 Binary files a/ui/res/go_ur.png and /dev/null differ diff --git a/widgets/gogame.py b/widgets/gogame.py index 6fd6755..bb4af9c 100644 --- a/widgets/gogame.py +++ b/widgets/gogame.py @@ -221,14 +221,27 @@ def _build_img_res(): height = ret['bT'].get_height() triangle.composite(ret['bT'], 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, 255) - for d in ('u', 'd', 'l', 'r', 'm', 'dl', 'dr', 'ul', 'ur', 'h', 'w', 'b'): + base = _load_png('go_corner.png') + ret['ul'] = base + ret['dl'] = base.copy().rotate_simple(90) + ret['dr'] = base.copy().rotate_simple(180) + ret['ur'] = base.copy().rotate_simple(270) + + base = _load_png('go_edge.png') + ret['u'] = base + ret['l'] = base.copy().rotate_simple(90) + ret['d'] = base.copy().rotate_simple(180) + ret['r'] = base.copy().rotate_simple(270) + + for d in ('m', 'h', 'w', 'b'): ret[d] = _load_png('go_' + d + '.png') - ret[d + 'C'] = _load_png('go_' + d + '.png') + for d in ('u', 'd', 'l', 'r', 'm', 'dl', 'dr', 'ul', 'ur', 'h', 'w', 'b'): + ret[d + 'C'] = ret[d].copy() width = ret[d + 'C'].get_width() height = ret[d + 'C'].get_height() circle.composite(ret[d + 'C'], 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, 255) - + return ret @@ -237,30 +250,4 @@ def _load_png(name): fullname = os.path.join('ui/res/', name) image = gtk.gdk.pixbuf_new_from_file(fullname) - # if alpha is not None: - # image = _set_alpha(image, alpha) - return image - - -# _trans_png = None - -# def _set_alpha(image, alpha): -# """ -# change_opacity - changes the opacity of pixbuf by combining -# the pixbuf with a pixbuf derived from a transparent .png - -# returns: a pixbuf of image made alpha more composite -# """ - -# global _trans_png - -# if _trans_png == None: -# _trans_png = _load_png('transparent.png') - -# width = image.get_width() -# height = image.get_height() - -# trans= _trans_png.scale_simple(width,height,gtk.gdk.INTERP_NEAREST) -# trans.composite(image, 0, 0, width, height, 0, 0, 1, 1, gtk.gdk.INTERP_NEAREST, alpha) -# return trans