diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 4e81bcbe3f..8a4d0b2c20 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -58,6 +58,7 @@ #include "mathed/MathRow.h" #include "frontends/alert.h" +#include "frontends/Application.h" #include "frontends/CaretGeometry.h" #include "frontends/Delegates.h" #include "frontends/FontMetrics.h" @@ -592,7 +593,7 @@ void BufferView::processUpdateFlags(Update::flags flags) flags = (flags & ~Update::FitCursor) | Update::ForceDraw; } - if (lyxrc.draw_strategy == LyXRC::DS_FULL) + if (theApp()->drawStrategy() == DrawStrategy::Full) flags = flags | Update::ForceDraw; // Add flags to the the update flags. These will be reset to None diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp index edd9a58240..feda5110c0 100644 --- a/src/LyXRC.cpp +++ b/src/LyXRC.cpp @@ -1144,11 +1144,11 @@ LyXRC::ReturnValues LyXRC::read(Lexer & lexrc, bool check_format) if (lexrc.next()) { string const tmp = lexrc.getString(); if (tmp == "partial") - draw_strategy = DS_PARTIAL; + draw_strategy = DrawStrategy::Partial; else if (tmp == "backingstore") - draw_strategy = DS_BACKINGSTORE; + draw_strategy = DrawStrategy::Backingstore; else if (tmp == "full") - draw_strategy = DS_FULL; + draw_strategy = DrawStrategy::Full; else { LYXERR0("Unrecognized draw strategy " << tmp <<'"'); } @@ -2056,13 +2056,13 @@ void LyXRC::write(ostream & os, bool ignore_system_lyxrc, string const & name) c draw_strategy != system_lyxrc.draw_strategy) { string status; switch (draw_strategy) { - case DS_FULL: + case DrawStrategy::Full: status = "full"; break; - case DS_PARTIAL: + case DrawStrategy::Partial: status = "partial"; break; - case DS_BACKINGSTORE: + case DrawStrategy::Backingstore: status = "backingstore"; break; } diff --git a/src/LyXRC.h b/src/LyXRC.h index 753a6f4f61..e0c2da3178 100644 --- a/src/LyXRC.h +++ b/src/LyXRC.h @@ -19,6 +19,7 @@ #define LYXRC_H #include "LyX.h" +#include "update_flags.h" #include "support/Length.h" #include "support/strfwd.h" @@ -579,16 +580,8 @@ public: /// BookmarksVisibility bookmarks_visibility = BMK_NONE; - enum DrawStrategy { - // draw all - DS_FULL, - // draw only what has changed - DS_PARTIAL, - // draw in backing store (only what has changed) - DS_BACKINGSTORE - }; /// - DrawStrategy draw_strategy = DS_PARTIAL; + DrawStrategy draw_strategy = DrawStrategy::Partial; }; diff --git a/src/frontends/Application.h b/src/frontends/Application.h index 75298ca67a..4d2d249b23 100644 --- a/src/frontends/Application.h +++ b/src/frontends/Application.h @@ -13,6 +13,7 @@ #include "ColorCode.h" #include "FuncCode.h" +#include "update_flags.h" #include "support/strfwd.h" @@ -203,6 +204,11 @@ public: /// Like getRgbColor(), but static and slower static bool getRgbColorUncached(ColorCode col, RGBColor & rgbcol); + /// \returns the draw strategy used by the application + virtual DrawStrategy drawStrategy() const = 0; + /// \returns the description of the draw strategy used by the application + virtual docstring drawStrategyDescription() const = 0; + /** * @return true if LyX uses a dark theme */ diff --git a/src/frontends/qt/GuiAbout.cpp b/src/frontends/qt/GuiAbout.cpp index 0a585f0eac..5ad435952d 100644 --- a/src/frontends/qt/GuiAbout.cpp +++ b/src/frontends/qt/GuiAbout.cpp @@ -298,6 +298,11 @@ static QString version(bool const plain = false) out << "
"; #endif out << toqstr(bformat(_("Python detected: %1$s"), from_utf8(os::python_info()))); + if (plain) + out << '\n'; + else + out << "
"; + out << toqstr(bformat(_("Draw strategy: %1$s"), guiApp->drawStrategyDescription())); if (!plain) out << toqstr("