summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-08-07 14:55:57 +0300
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-08-07 14:55:57 +0300
commit87db47ecdf743d50c99273e76b18d0a47ed68ad8 (patch)
tree8cd414b1abc8463e51cb87341f5d92a78b230365
parentffe7c478426eddbf4f1a0896d2960e2ec2cd4d1b (diff)
Linux: Added app icon
-rw-r--r--CMakeLists.txt6
-rw-r--r--res/lagrange-64.pngbin0 -> 21150 bytes
-rw-r--r--src/ui/window.c10
3 files changed, 9 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index df3ec24f..573bf09b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,9 +26,9 @@ set (EMBED_RESOURCES
26 res/NotoEmoji-Regular.ttf 26 res/NotoEmoji-Regular.ttf
27 res/Symbola.ttf 27 res/Symbola.ttf
28) 28)
29# if (UNIX AND NOT APPLE) 29 if (UNIX AND NOT APPLE)
30# list (APPEND EMBED_RESOURCES res/appicon-64.png) 30 list (APPEND EMBED_RESOURCES res/lagrange-64.png)
31# endif () 31 endif ()
32embed_make (${EMBED_RESOURCES}) 32embed_make (${EMBED_RESOURCES})
33 33
34set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.bin) 34set (EMB_BIN ${CMAKE_CURRENT_BINARY_DIR}/resources.bin)
diff --git a/res/lagrange-64.png b/res/lagrange-64.png
new file mode 100644
index 00000000..dc99134f
--- /dev/null
+++ b/res/lagrange-64.png
Binary files differ
diff --git a/src/ui/window.c b/src/ui/window.c
index 59d6a11a..2661fd3f 100644
--- a/src/ui/window.c
+++ b/src/ui/window.c
@@ -215,7 +215,11 @@ static void setupUserInterface_Window(iWindow *d) {
215 addChild_Widget(navBar, iClob(newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"))), 215 addChild_Widget(navBar, iClob(newIcon_LabelWidget(reloadCStr_, 0, 0, "navigate.reload"))),
216 "reload"); 216 "reload");
217 addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f464", 0, 0, "cert.client"))); 217 addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001f464", 0, 0, "cert.client")));
218 addChild_Widget(navBar, iClob(newIcon_LabelWidget("\U0001d362", 0, 0, "navbar.menu"))); 218
219 iLabelWidget *fileMenu =
220 makeMenuButton_LabelWidget("\U0001d362", fileMenuItems, iElemCount(fileMenuItems));
221 setAlignVisually_LabelWidget(fileMenu, iTrue);
222 addChild_Widget(navBar, iClob(fileMenu));
219 } 223 }
220 224
221 /* Tab bar. */ { 225 /* Tab bar. */ {
@@ -445,9 +449,8 @@ void init_Window(iWindow *d) {
445#endif 449#endif
446#if defined (iPlatformLinux) 450#if defined (iPlatformLinux)
447 /* Load the window icon. */ { 451 /* Load the window icon. */ {
448#if 0
449 int w, h, num; 452 int w, h, num;
450 const iBlock *icon = &imageAppicon64_Embedded; 453 const iBlock *icon = &imageLagrange64_Embedded;
451 stbi_uc *pixels = stbi_load_from_memory(constData_Block(icon), 454 stbi_uc *pixels = stbi_load_from_memory(constData_Block(icon),
452 size_Block(icon), 455 size_Block(icon),
453 &w, 456 &w,
@@ -459,7 +462,6 @@ void init_Window(iWindow *d) {
459 SDL_SetWindowIcon(d->win, surf); 462 SDL_SetWindowIcon(d->win, surf);
460 SDL_FreeSurface(surf); 463 SDL_FreeSurface(surf);
461 stbi_image_free(pixels); 464 stbi_image_free(pixels);
462#endif
463 } 465 }
464#endif 466#endif
465 d->root = new_Widget(); 467 d->root = new_Widget();