Modified: trunk/lib/toolbar.class.php (125 => 126)
--- trunk/lib/toolbar.class.php 2007-01-15 13:10:13 UTC (rev 125)
+++ trunk/lib/toolbar.class.php 2007-01-24 21:20:49 UTC (rev 126)
@@ -385,7 +385,7 @@
$filter = new GtkTreeModelFilter($this->model);
$filter->set_visible_column(4);
$view->set_model($filter);
- $list = array_diff($this->options, $this->current);
+ $list = array_diff($this->options,(array) $this->current);
$view->set_pixbuf_column(2);
$view->set_text_column(3);
@@ -829,7 +829,9 @@
$model = $this->model = new GtkListStore(Gtk::TYPE_STRING, Gtk::TYPE_STRING,
GdkPixbuf::gtype, Gtk::TYPE_STRING, Gtk::TYPE_BOOLEAN, Gtk::TYPE_PHP_VALUE);
}
- $list = array_diff($this->options, $this->current);
+ //print_r((array) $this->current);
+ //print_r($this->options);
+ $list = array_diff((array) $this->options,(array) $this->current);
// add separator
$model->append(array('', 'separator', $this->create_pixbuf('', 'separator'),
CC::i18n('Separator'), 1, new GtkSeparatorToolItem()));
@@ -853,7 +855,7 @@
$pixbuf = $this->create_pixbuf($group, $action);
$label = preg_replace('/(?<!_)_|\.\.\./', '',
CC::i18n($actions->get_action($group, $action)->get_property('label')));
- $show = in_array($item, $this->current) ? false : true;
+ $show = in_array($item,(array) $this->current) ? false : true;
$model->append(array($group, $action, $pixbuf, $label, $show, $actions->create_tool_item($group, $action)));
}
return;
@@ -868,63 +870,6 @@
*
* @return void
*/
- /*protected function create_pixbuf($group, $action)
-{
-
- // default icon width/height
- list($icon_width, $icon_height) = Gtk::icon_size_lookup($this->get_icon_size());
-
-$temp = new GtkWindow();
-
- // create toolbar widget and show in window
- $temp->add($tool = new GtkToolbar());
- $tool->set_toolbar_style($this->get_toolbar_style());
- $tool->set_icon_size($this->get_icon_size());
- // create widget
- if ($action === 'separator')
- {
- $widget = new GtkSeparatorToolItem();
- }
- elseif ($action === 'space')
- {
- $widget = new GtkSeparatorToolItem();
- $widget->set_draw(false);
- }
- elseif ($action === 'expander')
- {
- $widget = new GtkSeparatorToolItem();
- $widget->set_expand(true);
- $widget->set_draw(false);
- }
- else
- {
- $widget = CC_Actions::instance()->create_tool_item($group, $action);
- }
-
-$temp->realize();
-$tool->show_all();
-$tool->realize();
-$tool->map();
-
-$temp->set_default_size($icon_width, $icon_height);
-list($icon_width, $icon_height) = $temp->get_size();
-$temp->size_request();
-$visual = $tool->window->get_visual();
-$pixmap = new GdkPixmap(null, $icon_width, $icon_height, $visual->depth);
-$pixmap->set_colormap($temp->get_colormap());
-
-$temp->ensure_style();
-
-$this->fake_expose_widget($temp, $pixmap);
-$this->fake_expose_widget($tool, $pixmap);
-$this->fake_expose_widget($widget, $pixmap);
-
-$pixbuf = new GdkPixbuf(Gdk::COLORSPACE_RGB, TRUE, 8, $icon_width, $icon_height);
-$pixbuf->get_from_drawable($pixmap, $pixmap->get_colormap(),
- 0, 0, 0, 0, $icon_width, $icon_height);
-$temp->destroy();
- return $pixbuf;
-}*/
function create_pixbuf($group, $action)
{
// create temporary window
@@ -975,23 +920,5 @@
return $pixbuf;
}
- /*function fake_expose_widget( GtkWidget $widget, GdkPixmap &$pixmap = null){
- //GdkWindow *tmp_window;
- //GdkEventExpose event;
-
- $event = new GdkEvent(GDK::EXPOSE); //event.type = GDK_EXPOSE;
- $event->window = $pixmap; //event.window = pixmap;
- $event->send_event = false; //event.send_event = FALSE;
- $event->area = $widget->allocation; //event.area = widget->allocation;
- $event->region = null; //event.region = NULL;
- $event->count = 0; //event.count = 0;
-
- $tmp_window = $widget->window; //tmp_window = widget->window;
- $widget->window = $pixmap; //widget->window = pixmap;
- $widget->realize();
- $widget->send_expose($event); //gtk_widget_send_expose (widget, (GdkEvent *) &event);
- $widget->window = $tmp_window; //widget->window = tmp_window;
-}*/
-
}
?>
\ No newline at end of file