Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Martin <gary@garycmartin.com>2009-09-07 03:32:18 (GMT)
committer Gary Martin <gary@garycmartin.com>2009-09-07 03:32:18 (GMT)
commit04d3c0a50f47713f9cb280811893595eb47075a8 (patch)
treee73ef9fb3467b290d75b6cfad90d7ba81cca2a29
parent6e7f6fbe973a6a13b3f954053373f5edf71d5e3b (diff)
Added a list style ToolbarButton, and made the list styles regular buttons (rather than a separate palette).
-rw-r--r--AbiWordActivity.py12
-rw-r--r--toolbar.py67
2 files changed, 74 insertions, 5 deletions
diff --git a/AbiWordActivity.py b/AbiWordActivity.py
index eec6606..8401df9 100644
--- a/AbiWordActivity.py
+++ b/AbiWordActivity.py
@@ -80,11 +80,20 @@ class AbiWordActivity (activity.Activity):
view_toolbar.props.label = _('View')
toolbar_box.toolbar.insert(view_toolbar, -1)
+ separator = gtk.SeparatorToolItem()
+ toolbar_box.toolbar.insert(separator, -1)
+
para_toolbar = ToolbarButton()
para_toolbar.props.page = ParagraphToolbar(self.abiword_canvas)
para_toolbar.props.icon_name = 'paragraph-bar'
para_toolbar.props.label = _('Paragraph')
toolbar_box.toolbar.insert(para_toolbar, -1)
+
+ list_toolbar = ToolbarButton()
+ list_toolbar.props.page = ListToolbar(self.abiword_canvas)
+ list_toolbar.props.icon_name = 'toolbar-bulletlist'
+ list_toolbar.props.label = _('List')
+ toolbar_box.toolbar.insert(list_toolbar, -1)
text_toolbar = ToolbarButton()
text_toolbar.props.page = TextToolbar(self.abiword_canvas)
@@ -125,6 +134,9 @@ class AbiWordActivity (activity.Activity):
self._setToggleButtonState(underline, b, underline_id))
toolbar_box.toolbar.insert(underline, -1)
+ separator = gtk.SeparatorToolItem()
+ toolbar_box.toolbar.insert(separator, -1)
+
color = ColorToolButton()
color.connect('color-set', self._text_color_cb, self.abiword_canvas)
tool_item = gtk.ToolItem()
diff --git a/toolbar.py b/toolbar.py
index b5a467e..cdeebe6 100644
--- a/toolbar.py
+++ b/toolbar.py
@@ -378,9 +378,6 @@ class ParagraphToolbar(gtk.Toolbar):
def __init__(self, abi):
gtk.Toolbar.__init__(self)
- self.insert(ToolComboBox(widgets.StyleCombo(abi)), -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')
@@ -405,7 +402,67 @@ class ParagraphToolbar(gtk.Toolbar):
self.insert(button, -1)
self.insert(gtk.SeparatorToolItem(), -1)
- lists = RadioMenuButton(palette=widgets.ListsPalette(abi))
- self.insert(lists, -1)
+
+ #self.insert(gtk.SeparatorToolItem(), -1)
+ #lists = RadioMenuButton(palette=widgets.ListsPalette(abi))
+ #self.insert(lists, -1)
+
+ self.show_all()
+
+class ListToolbar(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 ['Bullet List',
+ 'Dashed List',
+ 'Numbered List',
+ 'Lower Case List',
+ 'Upper Case List'])
+ group.props.named_icon = 'list-none'
+ group.props.tooltip = _('Normal')
+ self.insert(group, -1)
+
+ button = widgets.AbiButton(abi, 'style-name',
+ lambda: abi.set_style('Bullet List'),
+ lambda abi, style: style == 'Bullet List')
+ button.props.group = group
+ button.props.named_icon = 'list-bullet'
+ button.props.tooltip = _('Bullet List')
+ self.insert(button, -1)
+
+ button = widgets.AbiButton(abi, 'style-name',
+ lambda: abi.set_style('Dashed List'),
+ lambda abi, style: style == 'Dashed List')
+ button.props.group = group
+ button.props.named_icon = 'list-dashed'
+ button.props.tooltip = _('Dashed List')
+ self.insert(button, -1)
+
+ button = widgets.AbiButton(abi, 'style-name',
+ lambda: abi.set_style('Numbered List'),
+ lambda abi, style: style == 'Numbered List')
+ button.props.group = group
+ button.props.named_icon = 'list-numbered'
+ button.props.tooltip = _('Numbered List')
+ self.insert(button, -1)
+
+ button = widgets.AbiButton(abi, 'style-name',
+ lambda: abi.set_style('Lower Case List'),
+ lambda abi, style: style == 'Lower Case List')
+ button.props.group = group
+ button.props.named_icon = 'list-lower-case'
+ button.props.tooltip = _('Lower Case List')
+ self.insert(button, -1)
+
+ button = widgets.AbiButton(abi, 'style-name',
+ lambda: abi.set_style('Upper Case List'),
+ lambda abi, style: style == 'Upper Case List')
+ button.props.group = group
+ button.props.named_icon = 'list-upper-case'
+ button.props.tooltip = _('Upper Case List')
+ self.insert(button, -1)
self.show_all()