mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Fix bug #8069: View/Update other formats button disabled with non-TeX fonts
This commit is contained in:
parent
b1bb04d244
commit
f50edc8673
@ -204,6 +204,7 @@ void MenuButton::mousePressEvent(QMouseEvent * e)
|
||||
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_);
|
||||
if (!tbinfo) {
|
||||
LYXERR0("Unknown toolbar " << tbitem_.name_);
|
||||
@ -227,6 +228,28 @@ void MenuButton::actionTriggered(QAction * action)
|
||||
}
|
||||
|
||||
|
||||
void MenuButton::updateTriggered()
|
||||
{
|
||||
if (!menu())
|
||||
return;
|
||||
|
||||
bool enabled = false;
|
||||
QList<QAction *> acts = menu()->actions();
|
||||
for (int i = 0; i < acts.size(); ++i)
|
||||
if (acts[i]->isEnabled()) {
|
||||
enabled = true;
|
||||
break;
|
||||
}
|
||||
// Enable the MenuButton if at least one menu item is enabled
|
||||
setEnabled(enabled);
|
||||
// If a disabled item is default, switch to InstantPopup
|
||||
// (this can happen if a user selects e.g. DVI and then
|
||||
// turns non-TeX fonts on)
|
||||
if (defaultAction() && !defaultAction()->isEnabled())
|
||||
setPopupMode(QToolButton::InstantPopup);
|
||||
}
|
||||
|
||||
|
||||
void GuiToolbar::add(ToolbarItem const & item)
|
||||
{
|
||||
switch (item.type_) {
|
||||
|
@ -59,6 +59,8 @@ private:
|
||||
private Q_SLOTS:
|
||||
///
|
||||
void actionTriggered(QAction * action);
|
||||
///
|
||||
void updateTriggered();
|
||||
};
|
||||
|
||||
|
||||
|
@ -76,6 +76,9 @@ What's new
|
||||
|
||||
* USER INTERFACE
|
||||
|
||||
- Do not disable View/Update Other Formats button when "Use non-TeX fonts"
|
||||
is active (bug 8069).
|
||||
|
||||
- Do not allow to add a citation in the citation dialog using the
|
||||
<Enter> key if the Add button is disabled.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user