From 78e05360d70542d343401241ff9ddddfed18c5cd Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 26 Nov 2016 13:38:02 +0200 Subject: [PATCH] Add a datafile statement to set an icon for an Image --- source/image.cpp | 7 +++++++ source/image.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/source/image.cpp b/source/image.cpp index 0102a47..1da782d 100644 --- a/source/image.cpp +++ b/source/image.cpp @@ -129,5 +129,12 @@ void Image::on_reparent() update_icon(); } + +Image::Loader::Loader(Image &img): + DataFile::DerivedObjectLoader(img) +{ + add("icon", &Image::icon_name); +} + } // namespace GLtk } // namespace Msp diff --git a/source/image.h b/source/image.h index 1855610..8b857f4 100644 --- a/source/image.h +++ b/source/image.h @@ -12,6 +12,13 @@ A widget for displaying images. */ class Image: public Widget { +public: + class Loader: public Msp::DataFile::DerivedObjectLoader + { + public: + Loader(Image &); + }; + private: const GL::Texture2D *image; std::string icon_name; -- 2.45.2