Skip to content

Commit 8b1c013

Browse files
committed
Add application icon
1 parent 41a2e7f commit 8b1c013

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

doc/smallLogo_for_windowicon.png

20.6 KB
Loading

include/AppImages.h

+3
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,7 @@ namespace AppImages
66
{
77
extern const char *logo2_png;
88
const int logo2_pngSize = 49015;
9+
10+
extern const char *logosmall_png;
11+
const int logosmall_pngSize = 21145;
912
}

src/AppImages.cpp

+3
Large diffs are not rendered by default.

src/Main.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#include <JuceHeader.h>
99
#include "ASCIILogFile.hpp"
10+
#include "AppImages.h"
1011
#include "ServerMainComponent.hpp"
1112
#include "isobus/hardware_integration/can_hardware_interface.hpp"
1213
#include "isobus/isobus/can_internal_control_function.hpp"
@@ -113,6 +114,15 @@ class AgISOVirtualTerminalApplication : public juce::JUCEApplication
113114
centreWithSize(getWidth(), getHeight());
114115
#endif
115116

117+
setIcon(ImageCache::getFromMemory(AppImages::logosmall_png, AppImages::logosmall_pngSize));
118+
#if JUCE_LINUX
119+
// this hack is needed on Linux
120+
ComponentPeer *peer = getPeer();
121+
if (peer)
122+
{
123+
peer->setIcon(ImageCache::getFromMemory(AppImages::logosmall_png, AppImages::logosmall_pngSize));
124+
}
125+
#endif
116126
setVisible(true);
117127
}
118128

0 commit comments

Comments
 (0)