mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-16 02:30:19 +00:00
ui: bundle ok/cancel icons; improve emoji fallback, incl PNG/SVG on Windows
This commit is contained in:
@@ -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" },
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user