]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiCharacter.cpp
do what the FIXME suggested
[lyx.git] / src / frontends / qt4 / GuiCharacter.cpp
index de3be8fd5a47151943abe6619ab77f8335c9fbeb..a5bf25cbe79513870acf4d367e2f535bc849bbd3 100644 (file)
 #include "FuncRequest.h"
 #include "Language.h"
 
-#include <QCloseEvent>
-
-using std::vector;
-using std::string;
 
+using namespace std;
 
 namespace lyx {
 namespace frontend {
@@ -270,12 +267,11 @@ static vector<FamilyPair> const getFamilyData()
 }
 
 
-GuiCharacter::GuiCharacter(LyXView & lv)
-       : GuiDialog(lv, "character"), font_(ignore_font),
+GuiCharacter::GuiCharacter(GuiView & lv)
+       : GuiDialog(lv, "character", qt_("Text Style")), font_(ignore_font),
          toggleall_(false), reset_lang_(false)
 {
        setupUi(this);
-       setViewTitle(_("Text Style"));
 
        connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK()));
        connect(applyPB, SIGNAL(clicked()), this, SLOT(slotApply()));
@@ -290,6 +286,13 @@ GuiCharacter::GuiCharacter(LyXView & lv)
        connect(langCO, SIGNAL(activated(int)), this, SLOT(change_adaptor()));
        connect(toggleallCB, SIGNAL(clicked()), this, SLOT(change_adaptor()));
 
+#ifdef Q_WS_MACX
+       // On Mac it's common to have tool windows which are always in the
+       // foreground and are hidden when the main window is not focused.
+       setWindowFlags(Qt::Tool);
+       autoapplyCB->setChecked(true);
+#endif
+
        family = getFamilyData();
        series = getSeriesData();
        shape  = getShapeData();
@@ -373,17 +376,10 @@ void GuiCharacter::change_adaptor()
 }
 
 
-void GuiCharacter::closeEvent(QCloseEvent * e)
-{
-       slotClose();
-       GuiDialog::closeEvent(e);
-}
-
-
 template<class A, class B>
-static int findPos2nd(vector<std::pair<A, B> > const & vec, B const & val)
+static int findPos2nd(vector<pair<A, B> > const & vec, B const & val)
 {
-       typedef typename vector<std::pair<A, B> >::const_iterator
+       typedef typename vector<pair<A, B> >::const_iterator
                const_iterator;
 
        for (const_iterator cit = vec.begin(); cit != vec.end(); ++cit)
@@ -594,7 +590,7 @@ void GuiCharacter::setLanguage(string const & val)
 }
 
 
-Dialog * createGuiCharacter(LyXView & lv) { return new GuiCharacter(lv); }
+Dialog * createGuiCharacter(GuiView & lv) { return new GuiCharacter(lv); }
 
 
 } // namespace frontend