]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToolbar.cpp
Amend f441590c
[lyx.git] / src / frontends / qt4 / GuiToolbar.cpp
index 6b5170d481974484e387c7c76c0b5c4274633685..77471c98af384e380cf2d720943aab5d65e901cc 100644 (file)
@@ -196,10 +196,10 @@ MenuButton::MenuButton(GuiToolbar * bar, ToolbarItem const & item, bool const st
        imagedirs << "images/math/" << "images/";
        for (int i = 0; i < imagedirs.size(); ++i) {
                QString imagedir = imagedirs.at(i);
-               FileName const fname = imageLibFileSearch(imagedir, name, "png",
+               FileName const fname = imageLibFileSearch(imagedir, name, "svgz,png",
                        theGuiApp()->imageSearchMode());
                if (fname.exists()) {
-                       setIcon(QIcon(getPixmap(imagedir, name, "png")));
+                       setIcon(QIcon(getPixmap(imagedir, name, "svgz,png")));
                        break;
                }
        }
@@ -321,16 +321,13 @@ void GuiToolbar::add(ToolbarItem const & item)
 }
 
 
-void GuiToolbar::update(bool in_math, bool in_table, bool in_review, 
-       bool in_mathmacrotemplate, bool in_ipa)
+void GuiToolbar::update(int context)
 {
        if (visibility_ & Toolbars::AUTO) {
-               bool show_it = (in_math && (visibility_ & Toolbars::MATH))
-                       || (in_table && (visibility_ & Toolbars::TABLE))
-                       || (in_review && (visibility_ & Toolbars::REVIEW))
-                       || (in_mathmacrotemplate && (visibility_ & Toolbars::MATHMACROTEMPLATE))
-                       || (in_ipa && (visibility_ & Toolbars::IPA));
-               setVisible(show_it);
+               bool const was_visible = isVisible();
+               setVisible(visibility_ & context & Toolbars::ALLOWAUTO);
+               if (isVisible() && !was_visible && commandBuffer())
+                       commandBuffer()->setFocus();
        }
 
        // update visible toolbars only