ui: bundle ok/cancel icons; improve emoji fallback, incl PNG/SVG on Windows

This commit is contained in:
2026-03-13 12:39:55 -06:00
parent 7e113cdec2
commit a8a879f2a0
13 changed files with 77 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 583 B

View File

@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<defs>
<filter id="shadow" x="-25%" y="-25%" width="150%" height="150%">
<feDropShadow dx="0" dy="0.5" stdDeviation="0.45" flood-color="#000000" flood-opacity="0.18"/>
</filter>
</defs>
<g filter="url(#shadow)">
<circle cx="8" cy="8" r="6.5" fill="#ff6b81" stroke="#d9485f" stroke-width="1"/>
<path d="M3.8 4.0A5.2 5.2 0 0 1 8 2.8c1.4 0 2.7 0.45 3.8 1.2" stroke="rgba(255,255,255,0.25)" stroke-width="0.9" stroke-linecap="round"/>
</g>
<path d="M5.0 5.0l6.0 6.0M11.0 5.0l-6.0 6.0" stroke="#ffffff" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 700 B

BIN
data/icons/menu/dark/ok.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 669 B

View File

@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<defs>
<filter id="shadow" x="-25%" y="-25%" width="150%" height="150%">
<feDropShadow dx="0" dy="0.5" stdDeviation="0.45" flood-color="#000000" flood-opacity="0.18"/>
</filter>
</defs>
<g filter="url(#shadow)">
<circle cx="8" cy="8" r="6.5" fill="#37d67a" stroke="#1f9d57" stroke-width="1"/>
<path d="M3.8 4.0A5.2 5.2 0 0 1 8 2.8c1.4 0 2.7 0.45 3.8 1.2" stroke="rgba(255,255,255,0.25)" stroke-width="0.9" stroke-linecap="round"/>
</g>
<path d="M4.1 8.2l2.1 2.2L11.9 4.8" stroke="#ffffff" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 691 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 639 B

View File

@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<defs>
<filter id="shadow" x="-25%" y="-25%" width="150%" height="150%">
<feDropShadow dx="0" dy="0.5" stdDeviation="0.45" flood-color="#000000" flood-opacity="0.18"/>
</filter>
</defs>
<g filter="url(#shadow)">
<circle cx="8" cy="8" r="6.5" fill="#d9485f" stroke="#b02a37" stroke-width="1"/>
<path d="M3.8 4.0A5.2 5.2 0 0 1 8 2.8c1.4 0 2.7 0.45 3.8 1.2" stroke="rgba(255,255,255,0.35)" stroke-width="0.9" stroke-linecap="round"/>
</g>
<path d="M5.0 5.0l6.0 6.0M11.0 5.0l-6.0 6.0" stroke="#ffffff" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 700 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 676 B

View File

@@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none">
<defs>
<filter id="shadow" x="-25%" y="-25%" width="150%" height="150%">
<feDropShadow dx="0" dy="0.5" stdDeviation="0.45" flood-color="#000000" flood-opacity="0.18"/>
</filter>
</defs>
<g filter="url(#shadow)">
<circle cx="8" cy="8" r="6.5" fill="#22a05a" stroke="#157347" stroke-width="1"/>
<path d="M3.8 4.0A5.2 5.2 0 0 1 8 2.8c1.4 0 2.7 0.45 3.8 1.2" stroke="rgba(255,255,255,0.35)" stroke-width="0.9" stroke-linecap="round"/>
</g>
<path d="M4.1 8.2l2.1 2.2L11.9 4.8" stroke="#ffffff" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

After

Width:  |  Height:  |  Size: 691 B

View File

@@ -74,6 +74,10 @@
<file alias="menu/light/help.svg">icons/menu/light/help.svg</file> <file alias="menu/light/help.svg">icons/menu/light/help.svg</file>
<file alias="menu/light/about.png" preprocess="to-pixdata">icons/menu/light/about.png</file> <file alias="menu/light/about.png" preprocess="to-pixdata">icons/menu/light/about.png</file>
<file alias="menu/light/about.svg">icons/menu/light/about.svg</file> <file alias="menu/light/about.svg">icons/menu/light/about.svg</file>
<file alias="menu/light/ok.png" preprocess="to-pixdata">icons/menu/light/ok.png</file>
<file alias="menu/light/ok.svg">icons/menu/light/ok.svg</file>
<file alias="menu/light/cancel.png" preprocess="to-pixdata">icons/menu/light/cancel.png</file>
<file alias="menu/light/cancel.svg">icons/menu/light/cancel.svg</file>
<file alias="menu/light/update.png" preprocess="to-pixdata">icons/menu/light/update.png</file> <file alias="menu/light/update.png" preprocess="to-pixdata">icons/menu/light/update.png</file>
<file alias="menu/light/update.svg">icons/menu/light/update.svg</file> <file alias="menu/light/update.svg">icons/menu/light/update.svg</file>
<file alias="menu/light/emoji.png" preprocess="to-pixdata">icons/menu/light/emoji.png</file> <file alias="menu/light/emoji.png" preprocess="to-pixdata">icons/menu/light/emoji.png</file>
@@ -131,6 +135,10 @@
<file alias="menu/dark/help.svg">icons/menu/dark/help.svg</file> <file alias="menu/dark/help.svg">icons/menu/dark/help.svg</file>
<file alias="menu/dark/about.png" preprocess="to-pixdata">icons/menu/dark/about.png</file> <file alias="menu/dark/about.png" preprocess="to-pixdata">icons/menu/dark/about.png</file>
<file alias="menu/dark/about.svg">icons/menu/dark/about.svg</file> <file alias="menu/dark/about.svg">icons/menu/dark/about.svg</file>
<file alias="menu/dark/ok.png" preprocess="to-pixdata">icons/menu/dark/ok.png</file>
<file alias="menu/dark/ok.svg">icons/menu/dark/ok.svg</file>
<file alias="menu/dark/cancel.png" preprocess="to-pixdata">icons/menu/dark/cancel.png</file>
<file alias="menu/dark/cancel.svg">icons/menu/dark/cancel.svg</file>
<file alias="menu/dark/update.png" preprocess="to-pixdata">icons/menu/dark/update.png</file> <file alias="menu/dark/update.png" preprocess="to-pixdata">icons/menu/dark/update.png</file>
<file alias="menu/dark/update.svg">icons/menu/dark/update.svg</file> <file alias="menu/dark/update.svg">icons/menu/dark/update.svg</file>
<file alias="menu/dark/emoji.png" preprocess="to-pixdata">icons/menu/dark/emoji.png</file> <file alias="menu/dark/emoji.png" preprocess="to-pixdata">icons/menu/dark/emoji.png</file>

View File

@@ -46,6 +46,8 @@ static const IconRegistryEntry icon_registry[] = {
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_NEXT, "zc-menu-next", "go-next", "next" }, { ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_NEXT, "zc-menu-next", "go-next", "next" },
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_HELP, "zc-menu-help", "help-browser", "help" }, { ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_HELP, "zc-menu-help", "help-browser", "help" },
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_ABOUT, "zc-menu-about", "help-about", "about" }, { ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_ABOUT, "zc-menu-about", "help-about", "about" },
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_OK, "zc-menu-ok", "dialog-ok", "ok" },
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_CANCEL, "zc-menu-cancel", "dialog-cancel", "cancel" },
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_EMOJI, "zc-menu-emoji", "face-smile", "emoji" }, { ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_EMOJI, "zc-menu-emoji", "face-smile", "emoji" },
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_UPDATE, "zc-menu-update", "software-update-available", "update" }, { ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_UPDATE, "zc-menu-update", "software-update-available", "update" },
{ ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_CHANLIST, "zc-menu-chanlist", "network-workgroup", "chanlist" }, { ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_CHANLIST, "zc-menu-chanlist", "network-workgroup", "chanlist" },

View File

@@ -45,6 +45,8 @@ typedef enum
ICON_RESOLVER_MENU_ACTION_NEXT, ICON_RESOLVER_MENU_ACTION_NEXT,
ICON_RESOLVER_MENU_ACTION_HELP, ICON_RESOLVER_MENU_ACTION_HELP,
ICON_RESOLVER_MENU_ACTION_ABOUT, ICON_RESOLVER_MENU_ACTION_ABOUT,
ICON_RESOLVER_MENU_ACTION_OK,
ICON_RESOLVER_MENU_ACTION_CANCEL,
ICON_RESOLVER_MENU_ACTION_EMOJI, ICON_RESOLVER_MENU_ACTION_EMOJI,
ICON_RESOLVER_MENU_ACTION_UPDATE, ICON_RESOLVER_MENU_ACTION_UPDATE,
ICON_RESOLVER_MENU_ACTION_CHANLIST ICON_RESOLVER_MENU_ACTION_CHANLIST

View File

@@ -46,6 +46,7 @@
#include "theme/theme-css.h" #include "theme/theme-css.h"
#include "banlist.h" #include "banlist.h"
#include "gtkutil.h" #include "gtkutil.h"
#include "icon-resolver.h"
#include "joind.h" #include "joind.h"
#include "theme/theme-access.h" #include "theme/theme-access.h"
#include "theme/theme-palette.h" #include "theme/theme-palette.h"
@@ -1560,7 +1561,7 @@ mg_open_quit_dialog (gboolean minimize_button)
button = gtk_button_new_with_mnemonic (_("_Cancel")); button = gtk_button_new_with_mnemonic (_("_Cancel"));
gtk_button_set_image (GTK_BUTTON (button), gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("dialog-cancel", GTK_ICON_SIZE_BUTTON)); gtkutil_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_BUTTON));
gtk_widget_show (button); gtk_widget_show (button);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button,
GTK_RESPONSE_CANCEL); GTK_RESPONSE_CANCEL);
@@ -3261,8 +3262,21 @@ mg_find_available_icon_name (const char *const *icon_names)
for (i = 0; icon_names[i] != NULL; i++) for (i = 0; icon_names[i] != NULL; i++)
{ {
int action;
if (gtk_icon_theme_has_icon (theme, icon_names[i])) if (gtk_icon_theme_has_icon (theme, icon_names[i]))
return icon_names[i]; return icon_names[i];
if (icon_resolver_menu_action_from_name (icon_names[i], &action))
{
char *resource_path = icon_resolver_resolve_path (ICON_RESOLVER_ROLE_MENU_ACTION, action, GTK_ICON_SIZE_MENU, "menu", ICON_RESOLVER_THEME_SYSTEM, NULL);
if (resource_path)
{
g_free (resource_path);
return icon_names[i];
}
}
} }
return NULL; return NULL;

View File

@@ -1533,12 +1533,12 @@ menu_join (GtkWidget * wid, gpointer none)
button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_REJECT); button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_REJECT);
if (button) if (button)
gtk_button_set_image (GTK_BUTTON (button), gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("dialog-cancel", GTK_ICON_SIZE_BUTTON)); gtkutil_image_new_from_stock ("gtk-cancel", GTK_ICON_SIZE_BUTTON));
button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT); button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);
if (button) if (button)
gtk_button_set_image (GTK_BUTTON (button), gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name ("dialog-ok", GTK_ICON_SIZE_BUTTON)); gtkutil_image_new_from_stock ("gtk-ok", GTK_ICON_SIZE_BUTTON));
} }
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_box_set_homogeneous (GTK_BOX (content_area), TRUE); gtk_box_set_homogeneous (GTK_BOX (content_area), TRUE);