mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-28 16:20:18 +00:00
UI: Removed unused and un-needed icons.
This commit is contained in:
@@ -148,16 +148,7 @@ gtkutil_button_new_from_stock (const char *stock, const char *label)
|
||||
{
|
||||
GtkWidget *button = label ? gtk_button_new_with_mnemonic (label) : gtk_button_new ();
|
||||
|
||||
if (stock)
|
||||
{
|
||||
GtkWidget *image = gtkutil_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
|
||||
if (image)
|
||||
{
|
||||
gtk_button_set_image (GTK_BUTTON (button), image);
|
||||
gtk_button_set_always_show_image (GTK_BUTTON (button), TRUE);
|
||||
}
|
||||
}
|
||||
(void)stock;
|
||||
|
||||
return button;
|
||||
}
|
||||
@@ -873,21 +864,14 @@ GtkWidget *
|
||||
gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback,
|
||||
void *userdata, char *labeltext)
|
||||
{
|
||||
GtkWidget *wid, *img, *bbox;
|
||||
GtkWidget *wid, *bbox;
|
||||
|
||||
(void)stock;
|
||||
wid = gtk_button_new ();
|
||||
|
||||
if (labeltext)
|
||||
{
|
||||
gtk_button_set_label (GTK_BUTTON (wid), labeltext);
|
||||
img = NULL;
|
||||
if (stock)
|
||||
img = gtkutil_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
if (img)
|
||||
{
|
||||
gtk_button_set_image (GTK_BUTTON (wid), img);
|
||||
gtk_button_set_always_show_image (GTK_BUTTON (wid), TRUE);
|
||||
}
|
||||
gtk_button_set_use_underline (GTK_BUTTON (wid), TRUE);
|
||||
if (box)
|
||||
gtk_container_add (GTK_CONTAINER (box), wid);
|
||||
@@ -897,16 +881,6 @@ gtkutil_button (GtkWidget *box, char *stock, char *tip, void *callback,
|
||||
bbox = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (wid), bbox);
|
||||
gtk_widget_show (bbox);
|
||||
|
||||
img = NULL;
|
||||
if (stock)
|
||||
img = gtkutil_image_new_from_stock (stock, GTK_ICON_SIZE_BUTTON);
|
||||
if (img)
|
||||
{
|
||||
gtk_container_add (GTK_CONTAINER (bbox), img);
|
||||
gtk_widget_show (img);
|
||||
gtk_button_set_always_show_image (GTK_BUTTON (wid), TRUE);
|
||||
}
|
||||
gtk_box_pack_start (GTK_BOX (box), wid, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -297,25 +297,10 @@ resolve_bundled_variant (const IconRegistryEntry *entry, IconResolverThemeVarian
|
||||
const char *variant_name = variant == ICON_RESOLVER_THEME_DARK ? "dark" : "light";
|
||||
char *path;
|
||||
|
||||
if (entry->role == ICON_RESOLVER_ROLE_MENU_ACTION)
|
||||
{
|
||||
path = g_strdup_printf ("/icons/menu/%s/%s.png", variant_name, entry->resource_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
|
||||
path = g_strdup_printf ("/icons/menu/%s/%s.svg", variant_name, entry->resource_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
path = g_strdup_printf ("/icons/%s-%s.png", entry->resource_name, variant_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
}
|
||||
path = g_strdup_printf ("/icons/%s-%s.png", entry->resource_name, variant_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@@ -325,25 +310,10 @@ resolve_bundled_neutral (const IconRegistryEntry *entry)
|
||||
{
|
||||
char *path;
|
||||
|
||||
if (entry->role == ICON_RESOLVER_ROLE_MENU_ACTION)
|
||||
{
|
||||
path = g_strdup_printf ("/icons/menu/light/%s.png", entry->resource_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
|
||||
path = g_strdup_printf ("/icons/menu/light/%s.svg", entry->resource_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
path = g_strdup_printf ("/icons/%s.png", entry->resource_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
}
|
||||
path = g_strdup_printf ("/icons/%s.png", entry->resource_name);
|
||||
if (resource_exists (path))
|
||||
return path;
|
||||
g_free (path);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1772,16 +1772,12 @@ mg_open_quit_dialog (gboolean minimize_button)
|
||||
}
|
||||
|
||||
button = gtk_button_new_with_mnemonic (_("_Cancel"));
|
||||
gtk_button_set_image (GTK_BUTTON (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);
|
||||
gtk_widget_grab_focus (button);
|
||||
|
||||
button = gtk_button_new_with_mnemonic (_("_Quit"));
|
||||
gtk_button_set_image (GTK_BUTTON (button),
|
||||
gtk_image_new_from_icon_name ("application-exit", GTK_ICON_SIZE_BUTTON));
|
||||
gtk_widget_show (button);
|
||||
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, 0);
|
||||
|
||||
|
||||
@@ -66,28 +66,6 @@
|
||||
|
||||
static GSList *submenu_list;
|
||||
|
||||
static gboolean
|
||||
menu_icon_exists_in_resource (const char *icon_name)
|
||||
{
|
||||
char *resource_path;
|
||||
gboolean found;
|
||||
|
||||
if (!icon_name || !g_str_has_prefix (icon_name, "zc-menu-"))
|
||||
return FALSE;
|
||||
|
||||
resource_path = g_strdup_printf ("/icons/menu/light/%s.png", icon_name + strlen ("zc-menu-"));
|
||||
found = g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL);
|
||||
if (!found)
|
||||
{
|
||||
g_free (resource_path);
|
||||
resource_path = g_strdup_printf ("/icons/menu/light/%s.svg", icon_name + strlen ("zc-menu-"));
|
||||
found = g_resources_get_info (resource_path, G_RESOURCE_LOOKUP_FLAGS_NONE, NULL, NULL, NULL);
|
||||
}
|
||||
g_free (resource_path);
|
||||
|
||||
return found;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
menu_icon_widget_new (const char *icon)
|
||||
{
|
||||
@@ -111,14 +89,7 @@ menu_icon_widget_new (const char *icon)
|
||||
}
|
||||
else
|
||||
{
|
||||
char *menu_icon_name = g_strdup_printf ("zc-menu-%s", icon);
|
||||
|
||||
if (menu_icon_exists_in_resource (menu_icon_name))
|
||||
img = gtkutil_image_new_from_stock (menu_icon_name, GTK_ICON_SIZE_MENU);
|
||||
else
|
||||
img = gtkutil_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
|
||||
|
||||
g_free (menu_icon_name);
|
||||
img = gtkutil_image_new_from_stock (icon, GTK_ICON_SIZE_MENU);
|
||||
}
|
||||
|
||||
g_free (path);
|
||||
@@ -1541,24 +1512,6 @@ menu_join (GtkWidget * wid, gpointer none)
|
||||
_("_OK"), GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
theme_manager_attach_window (dialog);
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
||||
button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_HELP);
|
||||
if (button)
|
||||
gtk_button_set_image (GTK_BUTTON (button),
|
||||
gtk_image_new_from_icon_name ("help-browser", GTK_ICON_SIZE_BUTTON));
|
||||
|
||||
button = gtk_dialog_get_widget_for_response (GTK_DIALOG (dialog), GTK_RESPONSE_REJECT);
|
||||
if (button)
|
||||
gtk_button_set_image (GTK_BUTTON (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),
|
||||
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);
|
||||
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
||||
|
||||
@@ -382,12 +382,9 @@ static GtkWidget *
|
||||
servlist_icon_button_new (const char *label, const char *icon_name)
|
||||
{
|
||||
GtkWidget *button;
|
||||
GtkWidget *image;
|
||||
|
||||
(void)icon_name;
|
||||
button = gtk_button_new_with_mnemonic (label);
|
||||
image = gtkutil_image_new_from_stock (icon_name, GTK_ICON_SIZE_BUTTON);
|
||||
gtk_button_set_image (GTK_BUTTON (button), image);
|
||||
gtk_button_set_always_show_image (GTK_BUTTON (button), TRUE);
|
||||
|
||||
return button;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user