diff --git a/file/file_util.cpp b/file/file_util.cpp index c95422841a..30666c86fd 100644 --- a/file/file_util.cpp +++ b/file/file_util.cpp @@ -274,6 +274,7 @@ size_t getFilesInDir(const char *directory, std::vector *files, const info.fullName = std::string(directory) + "/" + virtualName; info.isDirectory = isDirectory(info.fullName); info.exists = true; + info.size = 0; if (!info.isDirectory) { std::string ext = getFileExtension(info.fullName); if (filter) { diff --git a/ui/view.h b/ui/view.h index bbe0b8b374..4d42e9f54d 100644 --- a/ui/view.h +++ b/ui/view.h @@ -185,8 +185,9 @@ public: // This is suggested for use in most cases. Autobinds, allowing for neat syntax. template - void Handle(T *thiz, EventReturn (T::* theCallback)(EventParams &e)) { + T *Handle(T *thiz, EventReturn (T::* theCallback)(EventParams &e)) { Add(std::bind(theCallback, thiz, placeholder::_1)); + return thiz; } // Sometimes you have an already-bound function<>, just use this then. @@ -474,6 +475,7 @@ public: virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const; virtual void Draw(UIContext &dc); virtual void SetText(const std::string &text) { text_ = text; } + private: int font_; std::string text_;