Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Bender <walter@walter-laptop.(none)>2010-02-21 20:11:18 (GMT)
committer Walter Bender <walter@walter-laptop.(none)>2010-02-21 20:11:18 (GMT)
commit652ab5bdc7f66d07a7f5997ad224421bd4b73c33 (patch)
tree3909564e7b9cfaa6e522a49054303d1dd0c25afe
parent411b3936b4afc7d6ce85db938e8e8115506633cc (diff)
added palette next button
-rw-r--r--images/palettehorizontal.svg4
-rw-r--r--images/palettenext.svg30
-rw-r--r--images/palettevertical.svg4
-rw-r--r--tawindow.py44
4 files changed, 70 insertions, 12 deletions
diff --git a/images/palettehorizontal.svg b/images/palettehorizontal.svg
index bd0e0e6..6cc62bf 100644
--- a/images/palettehorizontal.svg
+++ b/images/palettehorizontal.svg
@@ -14,12 +14,12 @@
d="m 18.983051,7.5932202 a 10.915255,10.169492 0 1 1 -21.8305089,0 10.915255,10.169492 0 1 1 21.8305089,0 z"
transform="matrix(0.68421284,0,0,0.73438846,2.4799099,2.4236267)"
id="path2819"
- style="fill:#ffd000;fill-opacity:1;fill-rule:nonzero;stroke:#a08000;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ style="fill:#00000f;fill-opacity:0.94117647;fill-rule:nonzero;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
width="5.3145914"
height="11.314592"
x="5.3427043"
y="2.3427038"
id="rect5"
- style="fill:#000000;stroke:#000000;stroke-width:0.68540835" />
+ style="fill:#ffd000;fill-opacity:1;stroke:none" />
</svg>
diff --git a/images/palettenext.svg b/images/palettenext.svg
new file mode 100644
index 0000000..ccecdfa
--- /dev/null
+++ b/images/palettenext.svg
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ version="1.0"
+ width="16"
+ height="16"
+ id="svg2">
+ <defs
+ id="defs9" />
+ <path
+ d="m 18.983051,7.5932202 a 10.915255,10.169492 0 1 1 -21.8305089,0 10.915255,10.169492 0 1 1 21.8305089,0 z"
+ transform="matrix(0.68421284,0,0,0.73438846,2.4799099,2.4236267)"
+ id="path2819"
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <rect
+ width="5.3145914"
+ height="11.314592"
+ x="5.3427043"
+ y="-11.314592"
+ transform="matrix(0,1,-1,0,0,0)"
+ id="rect5"
+ style="fill:#00fe00;fill-opacity:1;stroke:none" />
+ <path
+ d="M 15.5,8 L 10,2 10,14 15.5,8 z"
+ id="path2816"
+ style="fill:#00fe00;fill-opacity:1;stroke:#00fe00;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+</svg>
diff --git a/images/palettevertical.svg b/images/palettevertical.svg
index a7c96dd..552ecdf 100644
--- a/images/palettevertical.svg
+++ b/images/palettevertical.svg
@@ -14,7 +14,7 @@
d="m 18.983051,7.5932202 a 10.915255,10.169492 0 1 1 -21.8305089,0 10.915255,10.169492 0 1 1 21.8305089,0 z"
transform="matrix(0.68421284,0,0,0.73438846,2.4799099,2.4236267)"
id="path2819"
- style="fill:#ffd000;fill-opacity:1;fill-rule:nonzero;stroke:#a08000;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.5;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
<rect
width="5.3145914"
height="11.314592"
@@ -22,5 +22,5 @@
y="2.3427038"
transform="matrix(0,-1,1,0,0,0)"
id="rect5"
- style="fill:#000000;stroke:#000000;stroke-width:0.68540835" />
+ style="fill:#ffd000;fill-opacity:1;stroke:none" />
</svg>
diff --git a/tawindow.py b/tawindow.py
index ea40f95..5e9538a 100644
--- a/tawindow.py
+++ b/tawindow.py
@@ -391,6 +391,7 @@ class TurtleArtWindow():
def show_palette(self, n=0):
self._show_toolbar_palette(n)
self.palette_button[self.orientation].set_layer(TAB_LAYER)
+ self.palette_button[2].set_layer(TAB_LAYER)
if self.activity is None or not self.activity.new_sugar_system:
self.toolbar_spr.set_layer(CATEGORY_LAYER)
self.palette = True
@@ -401,6 +402,7 @@ class TurtleArtWindow():
def hide_palette(self):
self._hide_toolbar_palette()
self.palette_button[self.orientation].hide()
+ self.palette_button[2].hide()
if self.activity is None or not self.activity.new_sugar_system:
self.toolbar_spr.hide()
self.palette = False
@@ -509,6 +511,14 @@ class TurtleArtWindow():
self.palette_button[self.orientation].set_layer(TAB_LAYER)
self.palette_button[1-self.orientation].hide()
+ # Create the palette next button
+ self.palette_button.append(Sprite(self.sprite_list, 16,
+ self.toolbar_offset, svg_str_to_pixbuf(svg_from_file(
+ "%s/images/palettenext.svg" %(self.path)))))
+ self.palette_button[2].name = 'next'
+ self.palette_button[2].type = 'palette'
+ self.palette_button[2].set_layer(TAB_LAYER)
+
if init_only:
return
@@ -674,13 +684,14 @@ class TurtleArtWindow():
svg = SVG()
self.palette_sprs[n][self.orientation].set_shape(
svg_str_to_pixbuf(svg.palette(_w, PALETTE_HEIGHT)))
+ self.palette_button[2].move((_w-20, 0))
else:
_x, _y = 5, self.toolbar_offset+15
_x, _y, _max = self._vertical_layout(_x, _y, self.palettes[n])
if n == PALETTE_NAMES.index('trash'):
_x, _y, _max = self._vertical_layout(_x, _y+_max,
self.trash_stack)
- _h = _y+_max+25-ICON_SIZE
+ _h = _y+_max+25-self.toolbar_offset
if self.palette_sprs[n][self.orientation] is None:
svg = SVG()
self.palette_sprs[n][self.orientation] =\
@@ -691,6 +702,7 @@ class TurtleArtWindow():
svg = SVG()
self.palette_sprs[n][self.orientation].set_shape(
svg_str_to_pixbuf(svg.palette(PALETTE_WIDTH, _h)))
+ self.palette_button[2].move((PALETTE_WIDTH-20, 0))
self.palette_sprs[n][self.orientation].set_layer(CATEGORY_LAYER)
"""
@@ -770,13 +782,29 @@ class TurtleArtWindow():
if self._hide_button_hit(spr, x, y):
self.hideshow_palette(False)
elif spr.type == 'palette':
- self.orientation = 1-self.orientation
- self.palette_button[self.orientation].set_layer(TAB_LAYER)
- self.palette_button[1-self.orientation].hide()
- self.palette_sprs[self.selected_palette][
- 1-self.orientation].hide()
- self._layout_palette(self.selected_palette)
- self.show_palette(self.selected_palette)
+ if spr.name == 'next':
+ i = self.selected_palette+1
+ if i == len(PALETTE_NAMES):
+ i = 0
+ if self.activity is None or\
+ not self.activity.new_sugar_system:
+ self._select_category(self.selectors[i])
+ else:
+ if self.selected_palette is not None:
+ self.activity.palette_buttons[
+ self.selected_palette].set_icon(
+ PALETTE_NAMES[self.selected_palette]+'off')
+ self.activity.palette_buttons[i].set_icon(
+ PALETTE_NAMES[i]+'on')
+ self.show_palette(i)
+ else:
+ self.orientation = 1-self.orientation
+ self.palette_button[self.orientation].set_layer(TAB_LAYER)
+ self.palette_button[1-self.orientation].hide()
+ self.palette_sprs[self.selected_palette][
+ 1-self.orientation].hide()
+ self._layout_palette(self.selected_palette)
+ self.show_palette(self.selected_palette)
elif spr.type == 'toolbar':
self._select_toolbar_button(spr)
return True