void GuiApplication::createView(QString const & geometry_arg)
{
+ if (global_menubar_)
+ global_menubar_->releaseKeyboard();
+
+ // create new view
updateIds(views_, view_ids_);
int id = 0;
while (views_.find(id) != views_.end())
id++;
- views_[id] = new GuiView(id);
- updateIds(views_, view_ids_);
+ GuiView * view = new GuiView(id);
+
+ // copy the icon size from old view
+ if (viewCount() > 0)
+ view->setIconSize(current_view_->iconSize());
- GuiView * view = views_[id];
+ // register view
+ views_[id] = view;
+ updateIds(views_, view_ids_);
+
theLyXFunc().setLyXView(view);
-
view->show();
if (!geometry_arg.isEmpty()) {
#ifdef Q_WS_WIN
};
-GuiLayoutBox::GuiLayoutBox(GuiView & owner)
- : owner_(owner), lastSel_(-1), layoutItemDelegate_(new LayoutItemDelegate(this)),
+GuiLayoutBox::GuiLayoutBox(GuiToolbar * bar, GuiView & owner)
+ : owner_(owner), bar_(bar), lastSel_(-1),
+ layoutItemDelegate_(new LayoutItemDelegate(this)),
visibleCategories_(0), inShowPopup_(false)
{
setSizeAdjustPolicy(QComboBox::AdjustToContents);
view()->setItemDelegateForColumn(0, layoutItemDelegate_);
QObject::connect(this, SIGNAL(activated(int)),
- this, SLOT(selected(int)));
+ this, SLOT(selected(int)));
+ QObject::connect(bar_, SIGNAL(iconSizeChanged(QSize)),
+ this, SLOT(setIconSize(QSize)));
+
owner_.setLayoutDialog(this);
updateContents(true);
}
return QComboBox::eventFilter(o, e);
}
+
+void GuiLayoutBox::setIconSize(QSize size)
+{
+ bool small = size.height() < 20;
+ setAttribute(Qt::WA_MacSmallSize, small);
+ setAttribute(Qt::WA_MacNormalSize, !small);
+}
+
void GuiLayoutBox::set(docstring const & layout)
{
addSeparator();
break;
case ToolbarItem::LAYOUTS:
- layout_ = new GuiLayoutBox(owner_);
+ layout_ = new GuiLayoutBox(this, owner_);
addWidget(layout_);
break;
case ToolbarItem::MINIBUFFER:
{
Q_OBJECT
public:
- GuiLayoutBox(GuiView &);
+ GuiLayoutBox(GuiToolbar * bar, GuiView &);
/// select the right layout in the combobox.
void set(docstring const & layout);
private Q_SLOTS:
///
void selected(int index);
+ ///
+ void setIconSize(QSize size);
private:
friend class LayoutItemDelegate;
///
GuiView & owner_;
///
+ GuiToolbar * bar_;
+ ///
DocumentClass const * text_class_;
///
Inset const * inset_;
///
GuiCommandBuffer * commandBuffer() { return command_buffer_; }
+ ///
Action * addItem(ToolbarItem const & item);
Q_SIGNALS:
+ ///
void updated();
private:
-
+ ///
QList<Action *> actions_;
+ ///
GuiView & owner_;
+ ///
GuiLayoutBox * layout_;
+ ///
GuiCommandBuffer * command_buffer_;
};