- Change the object ownership semantics to take ownership of unique_ptr's rather than references

- Add helper functions for setting up config
- Add support for dynamically updating more config options (path related ones in particular)
This commit is contained in:
Alfred Reynolds
2021-08-11 14:01:18 +12:00
parent 8ac20f4b43
commit 24a4a07593
7 changed files with 121 additions and 81 deletions

View File

@@ -28,7 +28,7 @@ public:
void setBlurRadius(unsigned int blurRadius);
void setBackgroundOpacity(unsigned int opacity);
void warn(std::string text);
void setOverlay(Overlay* overlay);
void setOverlay(std::unique_ptr<Overlay> &overlay);
void setDebugMode(bool debugModeIn);
void setBaseOptions(const ImageDisplayOptions &baseOptionsIn);
const ImageDisplayOptions &getBaseOptions();
@@ -46,7 +46,7 @@ private:
bool debugMode = false;
QSize lastScreenSize = {0,0};
Overlay* overlay = nullptr;
std::unique_ptr<Overlay> overlay;
ImageSwitcher *switcher = nullptr;
void drawText(QPixmap& image, int margin, int fontsize, QString text, int alignment);