From 6ca3f173eed5fe0260a346952e07fe35212834fa Mon Sep 17 00:00:00 2001 From: Reupen Shah Date: Fri, 6 Mar 2020 19:57:48 +0000 Subject: [PATCH] Correct loading of images with relative paths in the buttons toolbar This fixes a regression in 09be8e50007a49b24b579cc6885d8c3d427a317b where relative paths of custom images in the buttons toolbar were not resolved. This may have caused them to fail to load if the current working directory wasn't the one expected. This only affected image file extensions other than `bmp` and `ico`. --- CHANGELOG.md | 6 ++++++ foo_ui_columns/buttons_button_image.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f84b18698..65e5c1d42 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change log +## 1.4.1 + +### Bug fixes + +* A regression in the buttons toolbar, which may have caused the loading of custom images with relative paths to fail, was fixed. [[#298](https://github.com/reupen/columns_ui/pull/298)] + ## 1.4.0 ### Bug fixes diff --git a/foo_ui_columns/buttons_button_image.cpp b/foo_ui_columns/buttons_button_image.cpp index 27375b522..98af5ec1b 100644 --- a/foo_ui_columns/buttons_button_image.cpp +++ b/foo_ui_columns/buttons_button_image.cpp @@ -34,7 +34,7 @@ void ButtonsToolbar::ButtonImage::load(const Button::CustomImage& p_image) GetSystemMetrics(SM_CYSMICON), LR_LOADFROMFILE); else { try { - m_bm = cui::wic::create_hbitmap_from_path(p_image.m_path).release(); + m_bm = cui::wic::create_hbitmap_from_path(fullPath).release(); } catch (const std::exception& ex) { fbh::print_to_console(u8"Buttons toolbar – loading image failed: ", ex.what()); m_bm = nullptr;