Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add application icon #75

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/smallLogo_for_windowicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions include/AppImages.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ namespace AppImages
{
extern const char *logo2_png;
const int logo2_pngSize = 49015;

extern const char *logosmall_png;
const int logosmall_pngSize = 21145;
}
3 changes: 3 additions & 0 deletions src/AppImages.cpp

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions src/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <JuceHeader.h>
#include "ASCIILogFile.hpp"
#include "AppImages.h"
#include "ServerMainComponent.hpp"
#include "isobus/hardware_integration/can_hardware_interface.hpp"
#include "isobus/isobus/can_internal_control_function.hpp"
Expand Down Expand Up @@ -113,6 +114,15 @@ class AgISOVirtualTerminalApplication : public juce::JUCEApplication
centreWithSize(getWidth(), getHeight());
#endif

setIcon(ImageCache::getFromMemory(AppImages::logosmall_png, AppImages::logosmall_pngSize));
#if JUCE_LINUX
// this hack is needed on Linux
ComponentPeer *peer = getPeer();
if (peer)
{
peer->setIcon(ImageCache::getFromMemory(AppImages::logosmall_png, AppImages::logosmall_pngSize));
}
#endif
setVisible(true);
}

Expand Down
Loading