Allow images in higher resolution to be stored in own folder (PR #26003)

16 views
Skip to first unread message

RobertRoeb

unread,
Nov 30, 2025, 11:14:01 AM (3 days ago) Nov 30
to wx-...@googlegroups.com, Subscribed
  • The is an alternative used in other toolkits and I think it is convenient and does not harm

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/26003

Commit Summary

  • c15ee89 Allow images in higher resolution to be stored in own folder

File Changes

(2 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26003@github.com>

VZ

unread,
Nov 30, 2025, 12:39:06 PM (3 days ago) Nov 30
to wx-...@googlegroups.com, Subscribed

@vadz commented on this pull request.

This looks a bit strange to me, if I used subdirectories, I would have 1.0x and 2.0x and not . and 2.0x as now, but if this is an established convention, I guess why not.

I also wonder if we need to add support for this to wxOSX, I think it was using "@2x" explicitly somewhere...


In src/common/bmpbndl.cpp:

> @@ -529,6 +529,12 @@ wxBitmapBundle wxBitmapBundle::FromFiles(const wxString& path, const wxString& f
             fn.SetName(wxString::Format("%s_%dx", filename, dpiFactor));
         }
 
+        if ( !fn.FileExists() && dpiFactor != 1 )

This is minor, but we're now calling FileExists() twice completely unnecessarily when dpiFactor is 1. Let's use a temp var instead, i.e.

bool found = fn.FileExists();
if ( !found && dpiFactor != 1 )
{
    fn.AppendDir(...);
    found = fn.FileExists();
}

if ( found )


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26003/review/3521872861@github.com>

RobertRoeb

unread,
Nov 30, 2025, 3:21:48 PM (3 days ago) Nov 30
to wx-...@googlegroups.com, Subscribed
RobertRoeb left a comment (wxWidgets/wxWidgets#26003)

For reference, here is a description:

.../my_icon.png (mdpi baseline)
.../1.5x/my_icon.png (hdpi)
.../2.0x/my_icon.png (xhdpi)
.../3.0x/my_icon.png (xxhdpi)
.../4.0x/my_icon.png (xxxhdpi)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/26003/c3593288933@github.com>

Reply all
Reply to author
Forward
0 new messages