X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Ffrontends%2Fxforms%2FToolbar_pimpl.C;h=3785955688390797f3d61a79d8b39733fa9d6b6a;hb=dbd7a961fc46bb10c85bdd8c7fb6626477ae63d8;hp=0440a290ef6cc697fa81bd133fe1b300fce45188;hpb=8b8741cd5d7e960c5663911f8b69972419f6d37b;p=lyx.git diff --git a/src/frontends/xforms/Toolbar_pimpl.C b/src/frontends/xforms/Toolbar_pimpl.C index 0440a290ef..3785955688 100644 --- a/src/frontends/xforms/Toolbar_pimpl.C +++ b/src/frontends/xforms/Toolbar_pimpl.C @@ -130,13 +130,13 @@ int BubblePost(FL_OBJECT *ob, int event, FL_OBJECT * bubble_timer = reinterpret_cast(ob->u_cdata); // We do not test for empty help here, since this can never happen - if (event == FL_ENTER){ + if (event == FL_ENTER) { fl_set_object_callback(bubble_timer, C_Toolbar_BubbleTimerCB, reinterpret_cast(ob)); fl_set_timer(bubble_timer, 1); } - else if (event != FL_MOTION){ + else if (event != FL_MOTION) { fl_set_timer(bubble_timer, 0); fl_hide_oneliner(); } @@ -211,6 +211,11 @@ void Toolbar::Pimpl::update() } else fl_activate_object(p->icon); + } else if (p->action == ToolbarDefaults::LAYOUTS && combox) { + if (owner->getLyXFunc()->getStatus(LFUN_LAYOUT).disabled()) + combox->deactivate(); + else + combox->activate(); } } } @@ -229,8 +234,7 @@ void Toolbar::Pimpl::layoutSelected() { string const & layoutguiname = combox->getline(); LyXTextClass const & tc = - textclasslist.TextClass(owner->buffer()-> - params.textclass); + textclasslist[owner->buffer()->params.textclass]; LyXTextClass::const_iterator end = tc.end(); for (LyXTextClass::const_iterator cit = tc.begin(); @@ -245,12 +249,11 @@ void Toolbar::Pimpl::layoutSelected() } -void Toolbar::Pimpl::setLayout(int layout) +void Toolbar::Pimpl::setLayout(string const & layout) { if (combox) { LyXTextClass const & tc = - textclasslist.TextClass(owner->buffer()-> - params.textclass); + textclasslist[owner->buffer()->params.textclass]; combox->select(_(tc[layout].name())); } } @@ -265,8 +268,7 @@ void Toolbar::Pimpl::updateLayoutList(bool force) if (combox->empty() || force) { combox->clear(); LyXTextClass const & tc = - textclasslist.TextClass(owner->buffer()-> - params.textclass); + textclasslist[owner->buffer()->params.textclass]; LyXTextClass::const_iterator end = tc.end(); for (LyXTextClass::const_iterator cit = tc.begin(); cit != end; ++cit) { @@ -385,7 +387,7 @@ void Toolbar::Pimpl::set(bool doingmain) ToolbarList::iterator item = toollist.begin(); ToolbarList::iterator end = toollist.end(); for (; item != end; ++item) { - switch (item->action){ + switch (item->action) { case ToolbarDefaults::SEPARATOR: xpos += sepspace; break;