]> git.lyx.org Git - lyx.git/commitdiff
Move implementation details to constructors. Amend 78f457796c
authorYuriy Skalko <yuriy.skalko@gmail.com>
Sun, 6 Dec 2020 16:01:09 +0000 (18:01 +0200)
committerYuriy Skalko <yuriy.skalko@gmail.com>
Sun, 6 Dec 2020 18:51:11 +0000 (20:51 +0200)
src/frontends/qt/DialogFactory.cpp
src/frontends/qt/FindAndReplace.cpp
src/frontends/qt/GuiProgressView.h
src/frontends/qt/GuiSpellchecker.cpp

index e3848417ac0e6d5dcd12bc9992467547bf0981ce..62f6ab8b9ddafc46f5bc60e3f924703f6c3fb698 100644 (file)
@@ -156,14 +156,8 @@ Dialog * createDialog(GuiView & gv, string const & name)
                return new GuiShowFile(gv);
        if (name == "findreplace")
                return new GuiSearch(gv);
-       if (name == "findreplaceadv") {
-               FindAndReplace * gui = new FindAndReplace(gv, Qt::RightDockWidgetArea);
-#ifdef Q_OS_MAC
-               // On Mac show and floating
-               gui->setFloating(true);
-#endif
-               return gui;
-       }
+       if (name == "findreplaceadv")
+               return new FindAndReplace(gv);
        if (name == "graphics")
                return new GuiGraphics(gv);
        if (name == "include")
@@ -194,14 +188,8 @@ Dialog * createDialog(GuiView & gv, string const & name)
                return new GuiRef(gv);
        if (name == "sendto")
                return new GuiSendTo(gv);
-       if (name == "spellchecker") {
-               GuiSpellchecker * gui = new GuiSpellchecker(gv, Qt::RightDockWidgetArea);
-#ifdef Q_OS_MAC
-               // On Mac show and floating
-               gui->setFloating(true);
-#endif
-               return gui;
-       }
+       if (name == "spellchecker")
+               return new GuiSpellchecker(gv);
        if (name == "symbols")
                return new GuiSymbols(gv);
        if (name == "tabularcreate")
@@ -217,7 +205,7 @@ Dialog * createDialog(GuiView & gv, string const & name)
        if (name == "wrap")
                return new GuiWrap(gv);
        if (name == "progress")
-               return new GuiProgressView(gv, Qt::BottomDockWidgetArea);
+               return new GuiProgressView(gv);
 
        return nullptr;
 }
index fcfa6bda59532b03d5f98b543605868887846599..b378f46c9b2ca06e3ed125899e5ef6af46fdede4 100644 (file)
@@ -588,6 +588,10 @@ FindAndReplace::FindAndReplace(GuiView & parent,
        widget_ = new FindAndReplaceWidget(parent);
        setWidget(widget_);
        setFocusProxy(widget_);
+#ifdef Q_OS_MAC
+       // On Mac show and floating
+       setFloating(true);
+#endif
 
        connect(this, SIGNAL(dockLocationChanged(Qt::DockWidgetArea)),
                widget_, SLOT(dockLocationChanged(Qt::DockWidgetArea)));
index 4ea4efc5045dcdd1d64e30b9c4e5ae56e12193f8..1a722b31b2140f7ad6b8ffe20b969da8f3fbc519 100644 (file)
@@ -46,7 +46,7 @@ class GuiProgressView : public DockView
 public:
        GuiProgressView(
                GuiView & parent, ///< the main window where to dock.
-               Qt::DockWidgetArea area, ///< Position of the dock (and also drawer)
+               Qt::DockWidgetArea area = Qt::BottomDockWidgetArea, ///< Position of the dock (and also drawer)
                Qt::WindowFlags flags = 0);
 
        ~GuiProgressView();
index 7fc1155b1f1d95bc495de238ef0a81dc33cf4e1e..9fcf20cac2b23d7c91d4c1be406df48f8b8111af 100644 (file)
@@ -598,6 +598,10 @@ GuiSpellchecker::GuiSpellchecker(GuiView & parent,
        widget_ = new SpellcheckerWidget(&parent, this);
        setWidget(widget_);
        setFocusProxy(widget_);
+#ifdef Q_OS_MAC
+       // On Mac show and floating
+       setFloating(true);
+#endif
 }