Use the new scrcpy icon
Use the new icon designed by @varlesh: <https://github.com/Genymobile/scrcpy/pull/1987#issuecomment-949684080> Attempt to use the SVG, and fallback to PNG.
This commit is contained in:
@@ -151,6 +151,12 @@ executable('scrcpy', src,
|
||||
c_args: [])
|
||||
|
||||
install_man('scrcpy.1')
|
||||
install_data('../data/icon.svg',
|
||||
rename: 'scrcpy.svg',
|
||||
install_dir: 'share/icons/hicolor/scalable/apps')
|
||||
install_data('../data/icon_256x256.png',
|
||||
rename: 'scrcpy.png',
|
||||
install_dir: 'share/icons/hicolor/256x256/apps')
|
||||
|
||||
|
||||
### TESTS
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
|
||||
static const char *const scrcpy_icons[] = {
|
||||
#ifdef PORTABLE
|
||||
NULL, // TODO
|
||||
"icon.svg",
|
||||
"icon.png",
|
||||
#else
|
||||
NULL, // TODO
|
||||
PREFIX "/share/icons/hicolor/scalable/apps/scrcpy.svg"
|
||||
PREFIX "/share/icons/hicolor/256x256/apps/scrcpy.png"
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
#include <SDL2/SDL.h>
|
||||
|
||||
#include "events.h"
|
||||
#include "icon.xpm"
|
||||
#include "icon.h"
|
||||
#include "scrcpy.h"
|
||||
#include "tiny_xpm.h"
|
||||
#include "video_buffer.h"
|
||||
#include "util/log.h"
|
||||
|
||||
@@ -405,10 +404,10 @@ screen_init(struct screen *screen, const struct screen_params *params) {
|
||||
LOGD("Trilinear filtering disabled (not an OpenGL renderer)");
|
||||
}
|
||||
|
||||
SDL_Surface *icon = read_xpm(icon_xpm);
|
||||
SDL_Surface *icon = scrcpy_icon_load();
|
||||
if (icon) {
|
||||
SDL_SetWindowIcon(screen->window, icon);
|
||||
SDL_FreeSurface(icon);
|
||||
scrcpy_icon_destroy(icon);
|
||||
} else {
|
||||
LOGW("Could not load icon");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user