diff --git a/data/icons/menu/dark/cancel.png b/data/icons/menu/dark/cancel.png new file mode 100644 index 00000000..9f851195 Binary files /dev/null and b/data/icons/menu/dark/cancel.png differ diff --git a/data/icons/menu/dark/cancel.svg b/data/icons/menu/dark/cancel.svg new file mode 100644 index 00000000..d38e65ea --- /dev/null +++ b/data/icons/menu/dark/cancel.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/data/icons/menu/dark/ok.png b/data/icons/menu/dark/ok.png new file mode 100644 index 00000000..b22df7ed Binary files /dev/null and b/data/icons/menu/dark/ok.png differ diff --git a/data/icons/menu/dark/ok.svg b/data/icons/menu/dark/ok.svg new file mode 100644 index 00000000..ff9c330c --- /dev/null +++ b/data/icons/menu/dark/ok.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/data/icons/menu/light/cancel.png b/data/icons/menu/light/cancel.png new file mode 100644 index 00000000..4583575c Binary files /dev/null and b/data/icons/menu/light/cancel.png differ diff --git a/data/icons/menu/light/cancel.svg b/data/icons/menu/light/cancel.svg new file mode 100644 index 00000000..a58fb86e --- /dev/null +++ b/data/icons/menu/light/cancel.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/data/icons/menu/light/ok.png b/data/icons/menu/light/ok.png new file mode 100644 index 00000000..264939da Binary files /dev/null and b/data/icons/menu/light/ok.png differ diff --git a/data/icons/menu/light/ok.svg b/data/icons/menu/light/ok.svg new file mode 100644 index 00000000..472a2cc5 --- /dev/null +++ b/data/icons/menu/light/ok.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/data/zoitechat.gresource.xml b/data/zoitechat.gresource.xml index d7bdfdf2..954df153 100644 --- a/data/zoitechat.gresource.xml +++ b/data/zoitechat.gresource.xml @@ -74,6 +74,10 @@ icons/menu/light/help.svg icons/menu/light/about.png icons/menu/light/about.svg + icons/menu/light/ok.png + icons/menu/light/ok.svg + icons/menu/light/cancel.png + icons/menu/light/cancel.svg icons/menu/light/update.png icons/menu/light/update.svg icons/menu/light/emoji.png @@ -131,6 +135,10 @@ icons/menu/dark/help.svg icons/menu/dark/about.png icons/menu/dark/about.svg + icons/menu/dark/ok.png + icons/menu/dark/ok.svg + icons/menu/dark/cancel.png + icons/menu/dark/cancel.svg icons/menu/dark/update.png icons/menu/dark/update.svg icons/menu/dark/emoji.png diff --git a/src/fe-gtk/icon-resolver.c b/src/fe-gtk/icon-resolver.c index 1a825752..426961da 100644 --- a/src/fe-gtk/icon-resolver.c +++ b/src/fe-gtk/icon-resolver.c @@ -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_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_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_UPDATE, "zc-menu-update", "software-update-available", "update" }, { ICON_RESOLVER_ROLE_MENU_ACTION, ICON_RESOLVER_MENU_ACTION_CHANLIST, "zc-menu-chanlist", "network-workgroup", "chanlist" }, diff --git a/src/fe-gtk/icon-resolver.h b/src/fe-gtk/icon-resolver.h index fa486b30..7b5729a8 100644 --- a/src/fe-gtk/icon-resolver.h +++ b/src/fe-gtk/icon-resolver.h @@ -45,6 +45,8 @@ typedef enum ICON_RESOLVER_MENU_ACTION_NEXT, ICON_RESOLVER_MENU_ACTION_HELP, ICON_RESOLVER_MENU_ACTION_ABOUT, + ICON_RESOLVER_MENU_ACTION_OK, + ICON_RESOLVER_MENU_ACTION_CANCEL, ICON_RESOLVER_MENU_ACTION_EMOJI, ICON_RESOLVER_MENU_ACTION_UPDATE, ICON_RESOLVER_MENU_ACTION_CHANLIST diff --git a/src/fe-gtk/maingui.c b/src/fe-gtk/maingui.c index a5ba248d..8a4fe7c9 100644 --- a/src/fe-gtk/maingui.c +++ b/src/fe-gtk/maingui.c @@ -46,6 +46,7 @@ #include "theme/theme-css.h" #include "banlist.h" #include "gtkutil.h" +#include "icon-resolver.h" #include "joind.h" #include "theme/theme-access.h" #include "theme/theme-palette.h" @@ -1560,7 +1561,7 @@ mg_open_quit_dialog (gboolean minimize_button) button = gtk_button_new_with_mnemonic (_("_Cancel")); 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_dialog_add_action_widget (GTK_DIALOG (dialog), button, 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++) { + int action; + if (gtk_icon_theme_has_icon (theme, 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; diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index e7a0fb2d..b4f41a4d 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -1533,12 +1533,12 @@ menu_join (GtkWidget * wid, gpointer none) button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_REJECT); if (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); if (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)); gtk_box_set_homogeneous (GTK_BOX (content_area), TRUE);