diff options
author | Gary Martin <gary@garycmartin.com> | 2009-09-07 15:10:52 (GMT) |
---|---|---|
committer | Gary Martin <gary@garycmartin.com> | 2009-09-07 15:10:52 (GMT) |
commit | f8e44d57d33faf1d0561319389edc75a8962a058 (patch) | |
tree | e8d5a088c0349dff666b0e84b9df2bb7bda99304 | |
parent | 037792717414c21a7ad5690dceb9de9448917cf2 (diff) |
Added paragraph heading, block text and plain text styles as tools.
-rw-r--r-- | icons/paragraph-blocktext.svg | 12 | ||||
-rw-r--r-- | icons/paragraph-h1.svg | 13 | ||||
-rw-r--r-- | icons/paragraph-h2.svg | 13 | ||||
-rw-r--r-- | icons/paragraph-h3.svg | 13 | ||||
-rw-r--r-- | icons/paragraph-h4.svg | 13 | ||||
-rw-r--r-- | icons/paragraph-plaintext.svg | 18 | ||||
-rw-r--r-- | toolbar.py | 69 |
7 files changed, 145 insertions, 6 deletions
diff --git a/icons/paragraph-blocktext.svg b/icons/paragraph-blocktext.svg new file mode 100644 index 0000000..2f7e3d9 --- /dev/null +++ b/icons/paragraph-blocktext.svg @@ -0,0 +1,12 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]> +<svg enable-background="new 0 0 55 55" height="55px" style="" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px"> + <g display="block" id="paragraph-blocktext"> + <line fill="none" stroke="&fill_color;" stroke-width="3.5" x1="11.16" x2="44.16" y1="14.47" y2="14.47"/> + <line fill="none" stroke="&fill_color;" stroke-width="3.5" x1="11.16" x2="44.16" y1="23.06" y2="23.06"/> + <line fill="none" stroke="&fill_color;" stroke-width="3.5" x1="22.16" x2="44.16" y1="31.64" y2="31.64"/> + <line fill="none" stroke="&fill_color;" stroke-width="3.5" x1="22.16" x2="44.16" y1="40.23" y2="40.23"/> + </g> +</svg>
\ No newline at end of file diff --git a/icons/paragraph-h1.svg b/icons/paragraph-h1.svg new file mode 100644 index 0000000..c2f2bf7 --- /dev/null +++ b/icons/paragraph-h1.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]> +<svg enable-background="new 0 0 55 55" height="55px" style="" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px"> + <g display="block" id="paragraph-h1"> + <text x="10" y="18.5" font-size="10" font-family="Bitstream Vera Sans" font-weight="bold" fill="&fill_color;" stroke="none">H1</text> + <line fill="none" stroke="&fill_color;" stroke-width="5" x1="26.16" x2="44.16" y1="14.47" y2="14.47"/> + <line fill="none" stroke="&fill_color;" stroke-width="5" x1="11.16" x2="44.16" y1="23.06" y2="23.06"/> + <line fill="none" stroke="&fill_color;" stroke-width="5" x1="11.16" x2="44.16" y1="31.64" y2="31.64"/> + <line fill="none" stroke="&fill_color;" stroke-width="5" x1="11.16" x2="44.16" y1="40.23" y2="40.23"/> + </g> +</svg>
\ No newline at end of file diff --git a/icons/paragraph-h2.svg b/icons/paragraph-h2.svg new file mode 100644 index 0000000..183adc3 --- /dev/null +++ b/icons/paragraph-h2.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]> +<svg enable-background="new 0 0 55 55" height="55px" style="" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px"> + <g display="block" id="paragraph-h2"> + <text x="10" y="27.5" font-size="10" font-family="Bitstream Vera Sans" font-weight="bold" fill="&fill_color;" stroke="none">H2</text> + <line fill="none" stroke="&fill_color;" stroke-width="4" x1="11.16" x2="44.16" y1="14.47" y2="14.47"/> + <line fill="none" stroke="&fill_color;" stroke-width="4" x1="26.16" x2="44.16" y1="23.06" y2="23.06"/> + <line fill="none" stroke="&fill_color;" stroke-width="4" x1="11.16" x2="44.16" y1="31.64" y2="31.64"/> + <line fill="none" stroke="&fill_color;" stroke-width="4" x1="11.16" x2="44.16" y1="40.23" y2="40.23"/> + </g> +</svg>
\ No newline at end of file diff --git a/icons/paragraph-h3.svg b/icons/paragraph-h3.svg new file mode 100644 index 0000000..d8a66f9 --- /dev/null +++ b/icons/paragraph-h3.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]> +<svg enable-background="new 0 0 55 55" height="55px" style="" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px"> + <g display="block" id="paragraph-h3"> + <text x="10" y="35.5" font-size="10" font-family="Bitstream Vera Sans" font-weight="bold" fill="&fill_color;" stroke="none">H3</text> + <line fill="none" stroke="&fill_color;" stroke-width="3" x1="11.16" x2="44.16" y1="14.47" y2="14.47"/> + <line fill="none" stroke="&fill_color;" stroke-width="3" x1="11.16" x2="44.16" y1="23.06" y2="23.06"/> + <line fill="none" stroke="&fill_color;" stroke-width="3" x1="26.16" x2="44.16" y1="31.64" y2="31.64"/> + <line fill="none" stroke="&fill_color;" stroke-width="3" x1="11.16" x2="44.16" y1="40.23" y2="40.23"/> + </g> +</svg>
\ No newline at end of file diff --git a/icons/paragraph-h4.svg b/icons/paragraph-h4.svg new file mode 100644 index 0000000..ee163bc --- /dev/null +++ b/icons/paragraph-h4.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]> +<svg enable-background="new 0 0 55 55" height="55px" style="" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px"> + <g display="block" id="paragraph-h4"> + <text x="10" y="44" font-size="10" font-family="Bitstream Vera Sans" font-weight="bold" fill="&fill_color;" stroke="none">H4</text> + <line fill="none" stroke="&fill_color;" stroke-width="2" x1="11.16" x2="44.16" y1="14.47" y2="14.47"/> + <line fill="none" stroke="&fill_color;" stroke-width="2" x1="11.16" x2="44.16" y1="23.06" y2="23.06"/> + <line fill="none" stroke="&fill_color;" stroke-width="2" x1="11.16" x2="44.16" y1="31.64" y2="31.64"/> + <line fill="none" stroke="&fill_color;" stroke-width="2" x1="26.16" x2="44.16" y1="40.23" y2="40.23"/> + </g> +</svg>
\ No newline at end of file diff --git a/icons/paragraph-plaintext.svg b/icons/paragraph-plaintext.svg new file mode 100644 index 0000000..8ecdc60 --- /dev/null +++ b/icons/paragraph-plaintext.svg @@ -0,0 +1,18 @@ +<?xml version="1.0" ?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [ + <!ENTITY stroke_color "#010101"> + <!ENTITY fill_color "#FFFFFF"> +]> +<svg enable-background="new 0 0 55 55" height="55px" style="" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" y="0px"> + <g display="block" id="paragraph-plaintext"> + <text x="8" y="31.5" font-size="28" font-family="Bitstream Vera" font-weight="bold" font-style="italic" fill="&fill_color;" stroke="none">T</text> + <text x="31" y="42.5" font-size="28" font-family="Bitstream Vera Sans" font-weight="normal" fill="&fill_color;" stroke="none">T</text> + <g transform="translate(8,34)"> + <g transform="rotate(-45)"> + <g transform="scale(0.6)"> + <line fill="none" stroke="#FFFFFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5" x1="28.376" x2="28.376" y1="30.664" y2="5.712"/> + <polyline fill="none" points="36.098,21.51 28.376,30.664 20.653,21.51" stroke="#FFFFFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="3.5"/> + </g> + </g> + </g> + </g> +</svg>
\ No newline at end of file @@ -378,6 +378,69 @@ class ParagraphToolbar(gtk.Toolbar): def __init__(self, abi): gtk.Toolbar.__init__(self) + group = widgets.AbiButton(abi, 'style-name', + lambda: abi.set_style('Normal'), + lambda abi, style: + style not in ['Heading 1', + 'Heading 2', + 'Heading 3', + 'Heading 4', + 'Block Text', + 'Plain Text']) + group.props.named_icon = 'list-none' + group.props.tooltip = _('Normal') + self.insert(group, -1) + + button = widgets.AbiButton(abi, 'style-name', + lambda: abi.set_style('Heading 1'), + lambda abi, style: style == 'Heading 1') + button.props.group = group + button.props.named_icon = 'paragraph-h1' + button.props.tooltip = _('Heading 1') + self.insert(button, -1) + + button = widgets.AbiButton(abi, 'style-name', + lambda: abi.set_style('Heading 2'), + lambda abi, style: style == 'Heading 2') + button.props.group = group + button.props.named_icon = 'paragraph-h2' + button.props.tooltip = _('Heading 2') + self.insert(button, -1) + + button = widgets.AbiButton(abi, 'style-name', + lambda: abi.set_style('Heading 3'), + lambda abi, style: style == 'Heading 3') + button.props.group = group + button.props.named_icon = 'paragraph-h3' + button.props.tooltip = _('Heading 3') + self.insert(button, -1) + + button = widgets.AbiButton(abi, 'style-name', + lambda: abi.set_style('Heading 4'), + lambda abi, style: style == 'Heading 4') + button.props.group = group + button.props.named_icon = 'paragraph-h4' + button.props.tooltip = _('Heading 4') + self.insert(button, -1) + + button = widgets.AbiButton(abi, 'style-name', + lambda: abi.set_style('Block Text'), + lambda abi, style: style == 'Block Text') + button.props.group = group + button.props.named_icon = 'paragraph-blocktext' + button.props.tooltip = _('Block Text') + self.insert(button, -1) + + button = widgets.AbiButton(abi, 'style-name', + lambda: abi.set_style('Plain Text'), + lambda abi, style: style == 'Plain Text') + button.props.group = group + button.props.named_icon = 'paragraph-plaintext' + button.props.tooltip = _('Plain Text') + self.insert(button, -1) + + self.insert(gtk.SeparatorToolItem(), -1) + group = widgets.AbiButton(abi, 'left-align', abi.align_left) group.props.named_icon = 'format-justify-left' group.props.tooltip = _('Left justify') @@ -401,12 +464,6 @@ class ParagraphToolbar(gtk.Toolbar): button.props.tooltip = _('Fill justify') self.insert(button, -1) - self.insert(gtk.SeparatorToolItem(), -1) - - #self.insert(gtk.SeparatorToolItem(), -1) - #lists = RadioMenuButton(palette=widgets.ListsPalette(abi)) - #self.insert(lists, -1) - self.show_all() class ListToolbar(gtk.Toolbar): |