Page 1 of 1

icon size on MAC

Posted: Thu Apr 30, 2020 9:31 pm
by maximand
Dear wxGuru()
• wxWidgets 3.1.3 (wxMSW 10.0)
win.PNG
win.PNG (25.31 KiB) Viewed 534 times

The same code on MAC 10.15. The visible area is 16x16 but icon behind is 24x24.
mac_ico.png
mac_ico.png (52.27 KiB) Viewed 534 times

Code: Select all

….

    long style = wxTB_FLAT | wxTB_NODIVIDER;

    toolBar_ = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style, "ToolBar");
    
    toolBar_->AddTool(MENU_NEW, _("New"), mmBitmap(png::NEW_DB), _("New Database"));
    toolBar_->AddTool(MENU_OPEN, _("Open"), mmBitmap(png::OPEN), _("Open Database"));
    toolBar_->AddSeparator();
    ......
    
    const wxBitmap mmBitmap(int ref)
{
    int x = Option::instance().getIconSize();

    switch (ref)
    {
    case ABOUT: return x == 16 ? wxBITMAP_PNG_FROM_DATA(about) : x == 24 ? wxBITMAP_PNG_FROM_DATA(about24) : x == 32 ? wxBITMAP_PNG_FROM_DATA(about32)
    .....
What's wrong? Please advise.

Re: icon size on MAC

Posted: Fri May 01, 2020 12:58 am
by doublemax
I don't work under OSX, but there was this post very recently: viewtopic.php?p=198455#p198455
As your fonts look blurry, too, maybe it's a related problem.

Re: icon size on MAC

Posted: Fri May 01, 2020 6:34 am
by maximand
The key is already there.

Re: icon size on MAC

Posted: Fri May 01, 2020 2:48 pm
by ONEEYEMAN
Hi,
Are you testing on the Retina display?
Is there any other bitmaps than the regular ones?

Thank you.

Re: icon size on MAC

Posted: Fri May 01, 2020 3:27 pm
by maximand
I have only MAC Air (2019) for tests. I don't know what is the display are there.
I don't know even any IDE for this platform. I can't build any tests.

I am using VS2017 on Windows.

Re: icon size on MAC

Posted: Fri May 01, 2020 4:51 pm
by ONEEYEMAN
Hi,
You should install an Xcode (it is free) and build everything natively.
So install Xcode, command-line tools and then build wxWidgets and you application.

See if this will resolve it.

If you don't know - Google how to install Xcode and command-line tools on Mac.

Thank you.

Also - make sure you are building an Application Bundle for OSX.

Re: icon size on MAC

Posted: Fri May 01, 2020 9:38 pm
by maximand
I've used this instructions https://github.com/moneymanagerex/money ... h-homebrew
but exclude brew install wxmac gettext.
I've installed wx3.1.3 and gettext from source code.
As result this two command give me a package of my project:

cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target package

I've installed Xcode but don't understand how to open my project and build it.

PS project build from sources on my MAC machine. I don’t think that Xcode will fix something.
PSS Thank you for you attention.

Re: icon size on MAC

Posted: Sat May 02, 2020 5:49 pm
by ONEEYEMAN
Hi,
Can you build the toolbar sample from the wxWidgets distribution and see whether it has the same issue?

Thank you.