These ToobarItem members are public, not private.
Action * GuiToolbar::addItem(ToolbarItem const & item)
{
Action * GuiToolbar::addItem(ToolbarItem const & item)
{
- QString text = toqstr(item.label_);
+ QString text = toqstr(item.label);
// Get the keys bound to this action, but keep only the
// first one later
// Get the keys bound to this action, but keep only the
// first one later
- KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(*item.func_);
+ KeyMap::Bindings bindings = theTopLevelKeymap().findBindings(*item.func);
if (!bindings.empty())
text += " [" + toqstr(bindings.begin()->print(KeySequence::ForGui)) + "]";
if (!bindings.empty())
text += " [" + toqstr(bindings.begin()->print(KeySequence::ForGui)) + "]";
- Action * act = new Action(item.func_, getIcon(*item.func_, false), text,
+ Action * act = new Action(item.func, getIcon(*item.func, false), text,
- if (item.type_ == ToolbarItem::BIDICOMMAND)
- act->setRtlIcon(getIcon(*item.func_, false, true));
+ if (item.type == ToolbarItem::BIDICOMMAND)
+ act->setRtlIcon(getIcon(*item.func, false, true));
actions_.append(act);
return act;
actions_.append(act);
return act;
PaletteButton(GuiToolbar * bar, ToolbarItem const & item)
: QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false)
{
PaletteButton(GuiToolbar * bar, ToolbarItem const & item)
: QToolButton(bar), bar_(bar), tbitem_(item), initialized_(false)
{
- QString const label = qt_(to_ascii(tbitem_.label_));
+ QString const label = qt_(to_ascii(tbitem_.label));
setToolTip(label);
setStatusTip(label);
setText(label);
connect(bar_, SIGNAL(iconSizeChanged(QSize)),
this, SLOT(setIconSize(QSize)));
setCheckable(true);
setToolTip(label);
setStatusTip(label);
setText(label);
connect(bar_, SIGNAL(iconSizeChanged(QSize)),
this, SLOT(setIconSize(QSize)));
setCheckable(true);
- ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name_);
+ ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name);
if (tbinfo)
// use the icon of first action for the toolbar button
if (tbinfo)
// use the icon of first action for the toolbar button
- setIcon(getIcon(*tbinfo->items.begin()->func_, true));
+ setIcon(getIcon(*tbinfo->items.begin()->func, true));
}
void mousePressEvent(QMouseEvent * e)
}
void mousePressEvent(QMouseEvent * e)
- ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name_);
+ ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name);
- LYXERR0("Unknown toolbar " << tbitem_.name_);
+ LYXERR0("Unknown toolbar " << tbitem_.name);
return;
}
IconPalette * panel = new IconPalette(this);
return;
}
IconPalette * panel = new IconPalette(this);
- QString const label = qt_(to_ascii(tbitem_.label_));
+ QString const label = qt_(to_ascii(tbitem_.label));
panel->setWindowTitle(label);
connect(this, SIGNAL(clicked(bool)), panel, SLOT(setVisible(bool)));
connect(panel, SIGNAL(visible(bool)), this, SLOT(setChecked(bool)));
ToolbarInfo::item_iterator it = tbinfo->items.begin();
ToolbarInfo::item_iterator const end = tbinfo->items.end();
for (; it != end; ++it)
panel->setWindowTitle(label);
connect(this, SIGNAL(clicked(bool)), panel, SLOT(setVisible(bool)));
connect(panel, SIGNAL(visible(bool)), this, SLOT(setChecked(bool)));
ToolbarInfo::item_iterator it = tbinfo->items.begin();
ToolbarInfo::item_iterator const end = tbinfo->items.end();
for (; it != end; ++it)
- if (!getStatus(*it->func_).unknown())
+ if (!getStatus(*it->func).unknown())
panel->addButton(bar_->addItem(*it));
QToolButton::mousePressEvent(e);
panel->addButton(bar_->addItem(*it));
QToolButton::mousePressEvent(e);
: QToolButton(bar), bar_(bar), tbitem_(item)
{
setPopupMode(QToolButton::InstantPopup);
: QToolButton(bar), bar_(bar), tbitem_(item)
{
setPopupMode(QToolButton::InstantPopup);
- QString const label = qt_(to_ascii(tbitem_.label_));
+ QString const label = qt_(to_ascii(tbitem_.label));
setToolTip(label);
setStatusTip(label);
setText(label);
setToolTip(label);
setStatusTip(label);
setText(label);
- QString const name = toqstr(tbitem_.name_);
+ QString const name = toqstr(tbitem_.name);
QStringList imagedirs;
imagedirs << "images/math/" << "images/";
for (int i = 0; i < imagedirs.size(); ++i) {
QStringList imagedirs;
imagedirs << "images/math/" << "images/";
for (int i = 0; i < imagedirs.size(); ++i) {
void StaticMenuButton::initialize()
{
void StaticMenuButton::initialize()
{
- QString const label = qt_(to_ascii(tbitem_.label_));
+ QString const label = qt_(to_ascii(tbitem_.label));
ButtonMenu * m = new ButtonMenu(label, this);
m->setWindowTitle(label);
m->setTearOffEnabled(true);
connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
connect(bar_, SIGNAL(updated()), this, SLOT(updateTriggered()));
ButtonMenu * m = new ButtonMenu(label, this);
m->setWindowTitle(label);
m->setTearOffEnabled(true);
connect(bar_, SIGNAL(updated()), m, SLOT(updateParent()));
connect(bar_, SIGNAL(updated()), this, SLOT(updateTriggered()));
- ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name_);
+ ToolbarInfo const * tbinfo = guiApp->toolbars().info(tbitem_.name);
- LYXERR0("Unknown toolbar " << tbitem_.name_);
+ LYXERR0("Unknown toolbar " << tbitem_.name);
return;
}
ToolbarInfo::item_iterator it = tbinfo->items.begin();
ToolbarInfo::item_iterator const end = tbinfo->items.end();
for (; it != end; ++it)
return;
}
ToolbarInfo::item_iterator it = tbinfo->items.begin();
ToolbarInfo::item_iterator const end = tbinfo->items.end();
for (; it != end; ++it)
- if (!getStatus(*it->func_).unknown())
+ if (!getStatus(*it->func).unknown())
m->add(bar_->addItem(*it));
setMenu(m);
}
m->add(bar_->addItem(*it));
setMenu(m);
}
void DynamicMenuButton::initialize()
{
void DynamicMenuButton::initialize()
{
- QString const label = qt_(to_ascii(tbitem_.label_));
+ QString const label = qt_(to_ascii(tbitem_.label));
ButtonMenu * m = new ButtonMenu(label, this);
m->setWindowTitle(label);
m->setTearOffEnabled(true);
ButtonMenu * m = new ButtonMenu(label, this);
m->setWindowTitle(label);
m->setTearOffEnabled(true);
GuiView const & owner = bar_->owner();
BufferView const * bv = owner.currentBufferView();
GuiView const & owner = bar_->owner();
BufferView const * bv = owner.currentBufferView();
- string const & menutype = tbitem_.name_;
+ string const & menutype = tbitem_.name;
if (menutype == "dynamic-custom-insets" || menutype == "dynamic-char-styles") {
if (!bv) {
m->clear();
if (menutype == "dynamic-custom-insets" || menutype == "dynamic-char-styles") {
if (!bv) {
m->clear();
{
QMenu * m = menu();
m->clear();
{
QMenu * m = menu();
m->clear();
- string const & menutype = tbitem_.name_;
+ string const & menutype = tbitem_.name;
InsetLayout::InsetLyXType ftype;
if (menutype == "dynamic-custom-insets")
ftype = InsetLayout::CUSTOM;
InsetLayout::InsetLyXType ftype;
if (menutype == "dynamic-custom-insets")
ftype = InsetLayout::CUSTOM;
void GuiToolbar::add(ToolbarItem const & item)
{
void GuiToolbar::add(ToolbarItem const & item)
{
case ToolbarItem::SEPARATOR:
addSeparator();
break;
case ToolbarItem::SEPARATOR:
addSeparator();
break;
QToolButton * tb = new QToolButton;
tb->setCheckable(true);
tb->setIcon(getIcon(FuncRequest(LFUN_TABULAR_INSERT), true));
QToolButton * tb = new QToolButton;
tb->setCheckable(true);
tb->setIcon(getIcon(FuncRequest(LFUN_TABULAR_INSERT), true));
- QString const label = qt_(to_ascii(item.label_));
+ QString const label = qt_(to_ascii(item.label));
tb->setToolTip(label);
tb->setStatusTip(label);
tb->setText(label);
tb->setToolTip(label);
tb->setStatusTip(label);
tb->setText(label);
}
case ToolbarItem::DYNAMICMENU: {
// we only handle certain things
}
case ToolbarItem::DYNAMICMENU: {
// we only handle certain things
- if (DynamicMenuButton::isMenuType(item.name_))
+ if (DynamicMenuButton::isMenuType(item.name))
addWidget(new DynamicMenuButton(this, item));
else
addWidget(new DynamicMenuButton(this, item));
else
- LYXERR0("Unknown dynamic menu type: " << item.name_);
+ LYXERR0("Unknown dynamic menu type: " << item.name);
break;
}
case ToolbarItem::BIDICOMMAND: {
break;
}
case ToolbarItem::BIDICOMMAND: {
- if (!getStatus(*item.func_).unknown())
+ if (!getStatus(*item.func).unknown())
addAction(addItem(item));
break;
}
case ToolbarItem::COMMAND: {
addAction(addItem(item));
break;
}
case ToolbarItem::COMMAND: {
- if (!getStatus(*item.func_).unknown())
+ if (!getStatus(*item.func).unknown())
addAction(addItem(item));
break;
}
addAction(addItem(item));
break;
}
//
/////////////////////////////////////////////////////////////////////////
//
/////////////////////////////////////////////////////////////////////////
-ToolbarItem::ToolbarItem(Type type, FuncRequest const & func,
- docstring const & label)
- : type_(type), func_(make_shared<FuncRequest>(func)), label_(label)
+ToolbarItem::ToolbarItem(Type t, FuncRequest const & f,
+ docstring const & l)
+ : type(t), func(make_shared<FuncRequest>(f)), label(l)
{
}
ToolbarItem::ToolbarItem(Type type, string const & name,
docstring const & label)
{
}
ToolbarItem::ToolbarItem(Type type, string const & name,
docstring const & label)
- : type_(type), func_(make_shared<FuncRequest>()), label_(label), name_(name)
+ : type(type), func(make_shared<FuncRequest>()), label(label), name(name)
void ToolbarInfo::add(ToolbarItem const & item)
{
items.push_back(item);
void ToolbarInfo::add(ToolbarItem const & item)
{
items.push_back(item);
- items.back().func_->setOrigin(FuncRequest::TOOLBAR);
+ items.back().func->setOrigin(FuncRequest::TOOLBAR);
docstring const & label = docstring());
/// item type
docstring const & label = docstring());
/// item type
- std::shared_ptr<FuncRequest> func_; // non-null
+ std::shared_ptr<FuncRequest> func; // non-null