Code

bulk whitespace removal patch #1198588 by gigaclon
[inkscape.git] / src / widgets / desktop-widget.cpp
index f9a8b8f62e1e9fe6fcf24c56bf7f27ec8e419f5c..2cd6f13d399dccd0e59e2dcaaee27e5d851f0114 100644 (file)
@@ -46,6 +46,7 @@
 #include "ui/widget/selected-style.h"
 #include "sp-item.h"
 #include "dialogs/swatches.h"
+#include "conn-avoid-ref.h"
 
 #ifdef WITH_INKBOARD
 #endif
@@ -165,9 +166,6 @@ sp_desktop_widget_init (SPDesktopWidget *dtw)
 
     widget = GTK_WIDGET (dtw);
 
-    Gtk::VPaned* pane = manage( new Gtk::VPaned() );
-    pane->show_all();
-
     dtw->window = 0;
     
     dtw->desktop = NULL;
@@ -176,11 +174,7 @@ sp_desktop_widget_init (SPDesktopWidget *dtw)
 
     /* Main table */
     dtw->vbox = gtk_vbox_new (FALSE, 0);
-    gtk_container_add( GTK_CONTAINER(dtw), GTK_WIDGET(pane->gobj()) );
-
-    Gtk::VBox* tmp = Glib::wrap( GTK_VBOX(dtw->vbox) );
-    Gtk::VBox* boxWrap = manage( tmp );
-    pane->pack1( *boxWrap, true, true );
+    gtk_container_add( GTK_CONTAINER(dtw), GTK_WIDGET(dtw->vbox) );
 
     dtw->statusbar = gtk_hbox_new (FALSE, 0);
     //gtk_widget_set_usize (dtw->statusbar, -1, BOTTOM_BAR_HEIGHT);
@@ -189,9 +183,9 @@ sp_desktop_widget_init (SPDesktopWidget *dtw)
     {
         using Inkscape::UI::Dialogs::SwatchesPanel;
 
-        SwatchesPanel* swatches = manage( new SwatchesPanel() );
+        SwatchesPanel* swatches = new SwatchesPanel();
         dtw->panels = GTK_WIDGET(swatches->gobj());
-        pane->pack2( *swatches, false, true );
+        gtk_box_pack_end( GTK_BOX( dtw->vbox ), dtw->panels, FALSE, TRUE, 0 );
     }
 
     hbox = gtk_hbox_new (FALSE, 0);
@@ -326,6 +320,9 @@ sp_desktop_widget_init (SPDesktopWidget *dtw)
 
     dtw->select_status_eventbox = gtk_event_box_new ();
     dtw->select_status = gtk_label_new (NULL);
+#if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 6
+    gtk_label_set_ellipsize (GTK_LABEL(dtw->select_status), PANGO_ELLIPSIZE_END);
+#endif
     gtk_misc_set_alignment (GTK_MISC (dtw->select_status), 0.0, 0.5);
     gtk_widget_set_size_request (dtw->select_status, 1, -1);
     // display the initial welcome message in the statusbar
@@ -912,6 +909,10 @@ sp_desktop_widget_new (SPNamedView *namedview)
     dtw->desktop->init (namedview, dtw->canvas);
     inkscape_add_desktop (dtw->desktop);
 
+    // Add the shape geometry to libavoid for autorouting connectors.
+    // This needs desktop set for its spacing preferences.
+    init_avoided_shape_geometry(dtw->desktop);
+    
     dtw->selected_style->setDesktop(dtw->desktop);
 
     /* Once desktop is set, we can update rulers */