windows app icon finished

This commit is contained in:
EinTim23 2024-11-06 13:07:31 +01:00
parent 26c1e8cc8a
commit 12f5239900
2 changed files with 6 additions and 4 deletions

View File

@ -164,11 +164,12 @@ protected:
wxCheckBox* autostartCheckbox; wxCheckBox* autostartCheckbox;
public: public:
PlayerLinkFrame(wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, PlayerLinkFrame(wxWindow* parent, wxIcon& icon, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(300, 200), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize(300, 200),
long style = wxDEFAULT_FRAME_STYLE & ~wxRESIZE_BORDER & ~wxMAXIMIZE_BOX) long style = wxDEFAULT_FRAME_STYLE & ~wxRESIZE_BORDER & ~wxMAXIMIZE_BOX)
: wxFrame(parent, id, title, pos, size, style) { : wxFrame(parent, id, title, pos, size, style) {
this->SetSizeHints(wxDefaultSize, wxDefaultSize); this->SetSizeHints(wxDefaultSize, wxDefaultSize);
this->SetIcon(icon);
wxBoxSizer* mainContainer; wxBoxSizer* mainContainer;
mainContainer = new wxBoxSizer(wxVERTICAL); mainContainer = new wxBoxSizer(wxVERTICAL);
@ -267,7 +268,8 @@ public:
this->SetAppearance(wxAppBase::Appearance::Dark); this->SetAppearance(wxAppBase::Appearance::Dark);
wxInitAllImageHandlers(); wxInitAllImageHandlers();
PlayerLinkFrame* frame = new PlayerLinkFrame(nullptr, wxID_ANY, _("PlayerLink")); wxIcon icon = utils::loadIconFromMemory(icon_png, icon_png_size);
PlayerLinkFrame* frame = new PlayerLinkFrame(nullptr, icon, wxID_ANY, _("PlayerLink"));
trayIcon = new PlayerLinkIcon(frame); trayIcon = new PlayerLinkIcon(frame);
frame->Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent& event) { frame->Bind(wxEVT_CLOSE_WINDOW, [=](wxCloseEvent& event) {
if (event.CanVeto()) { if (event.CanVeto()) {
@ -276,7 +278,7 @@ public:
} else } else
std::exit(0); std::exit(0);
}); });
wxIcon icon = utils::loadIconFromMemory(icon_png, icon_png_size);
trayIcon->SetIcon(icon, _("PlayerLink")); trayIcon->SetIcon(icon, _("PlayerLink"));
return true; return true;
} }

View File

@ -1 +1 @@
IDI_ICON1 ICON "win/icon.ico" IDI_ICON1 ICON "icon.ico"