326
325
dtw->hbox = gtk_hbox_new(FALSE, 0);
327
326
gtk_box_pack_end( GTK_BOX (dtw->vbox), dtw->hbox, TRUE, TRUE, 0 );
328
327
gtk_widget_show(dtw->hbox);
330
329
dtw->aux_toolbox = ToolboxFactory::createAuxToolbox();
331
330
gtk_box_pack_end (GTK_BOX (dtw->vbox), dtw->aux_toolbox, FALSE, TRUE, 0);
1511
1510
sp_ruler_set_metric(GTK_RULER (this->vruler), nv->getDefaultMetric());
1512
1511
sp_ruler_set_metric(GTK_RULER (this->hruler), nv->getDefaultMetric());
1514
/* This loops through all the grandchildren of aux toolbox,
1515
* and for each that it finds, it performs an sp_search_by_data_recursive(),
1516
* looking for widgets that hold some "tracker" data (this is used by
1517
* all toolboxes to refer to the unit selector). The default document units
1518
* is then selected within these unit selectors.
1520
* Of course it would be nice to be able to refer to the toolbox and the
1521
* unit selector directly by name, but I don't yet see a way to do that.
1523
* This should solve: https://bugs.launchpad.net/inkscape/+bug/362995
1525
if (GTK_IS_CONTAINER(aux_toolbox)) {
1526
GList *ch = gtk_container_get_children (GTK_CONTAINER(aux_toolbox));
1527
for (GList *i = ch; i != NULL; i = i->next) {
1528
if (GTK_IS_CONTAINER(i->data)) {
1529
GList *grch = gtk_container_get_children (GTK_CONTAINER(i->data));
1530
for (GList *j = grch; j != NULL; j = j->next) {
1531
if (!GTK_IS_WIDGET(j->data)) // wasn't a widget
1534
gpointer t = sp_search_by_data_recursive(GTK_WIDGET(j->data), (gpointer) "tracker");
1535
if (t == NULL) // didn't find any tracker data
1538
UnitTracker *tracker = reinterpret_cast<UnitTracker*>( t );
1539
if (tracker == NULL) // it's null when inkscape is first opened
1542
tracker->setActiveUnit( nv->doc_units );
1544
} // if child is a container
1546
} // if aux_toolbox is a container
1548
1513
gtk_tooltips_set_tip(this->tt, this->hruler_box, gettext(sp_unit_get_plural (nv->doc_units)), NULL);
1549
1514
gtk_tooltips_set_tip(this->tt, this->vruler_box, gettext(sp_unit_get_plural (nv->doc_units)), NULL);