bool small = size.height() < 20;
setAttribute(Qt::WA_MacSmallSize, small);
setAttribute(Qt::WA_MacNormalSize, !small);
+#else
+ (void)size; // suppress warning
#endif
}
if (!text_class_)
return;
- QString const & name = toqstr((*text_class_)[layout].name());
+ Layout const & lay = (*text_class_)[layout];
+ QString const & name = toqstr(lay.name() + (lay.isUnknown() ? " (unknown)" : ""));
if (name == currentText())
return;
for (; lit != len; ++lit) {
docstring const & name = lit->name();
- bool const useEmpty = inset_->forceEmptyLayout() || inset_->useEmptyLayout();
+ bool const useEmpty = inset_->forcePlainLayout() || inset_->usePlainLayout();
// if this inset requires the empty layout, we skip the default
// layout
if (name == text_class_->defaultLayoutName() && inset_ && useEmpty)
// if it doesn't require the empty layout, we skip it
if (name == text_class_->emptyLayoutName() && inset_ && !useEmpty)
continue;
- addItemSort(name, lit->category(), lyxrc.sort_layouts, lyxrc.group_layouts);
+ addItemSort(name + (lit->isUnknown() ? " (unknown)" : ""),
+ lit->category(), lyxrc.sort_layouts, lyxrc.group_layouts);
}
set(owner_.view()->cursor().innerParagraph().layout().name());
{
// get selection
QModelIndex mindex = filterModel_->mapToSource(filterModel_->index(index, 1));
- docstring const layoutName =
- qstring_to_ucs4(model_->itemFromIndex(mindex)->text());
+ docstring const layoutName = rtrim(
+ qstring_to_ucs4(model_->itemFromIndex(mindex)->text()), " (unknown)");
owner_.setFocus();
resetFilter();
return;
}
- lyxerr << "ERROR (layoutSelected): layout not found!" << endl;
+ LYXERR0("ERROR (layoutSelected): layout not found!");
}
allowauto_(false), owner_(owner), layout_(0), command_buffer_(0),
tbinfo_(tbinfo), filled_(false)
{
+ setIconSize(owner.iconSize());
+ connect(&owner, SIGNAL(iconSizeChanged(QSize)), this,
+ SLOT(setIconSize(QSize)));
+
// Toolbar dragging is allowed.
setMovable(true);
// This is used by QMainWindow::restoreState for proper main window state
// restauration.
setObjectName(toqstr(tbinfo.name));
-
restoreSession();
}
ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name_);
if (!tbinfo) {
- lyxerr << "Unknown toolbar " << tbitem_.name_ << endl;
+ LYXERR0("Unknown toolbar " << tbitem_.name_);
return;
}
IconPalette * panel = new IconPalette(this);
connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name_);
if (!tbinfo) {
- lyxerr << "Unknown toolbar " << tbitem_.name_ << endl;
+ LYXERR0("Unknown toolbar " << tbitem_.name_);
return;
}
ToolbarInfo::item_iterator it = tbinfo->items.begin();