/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * GUI utility functions * * Authors: * Miguel de Icaza (miguel@ximian.com) * Chris Toshok (toshok@ximian.com) * * Copyright (C) 1999 Miguel de Icaza * Copyright (C) 2000-2003 Ximian, Inc. */ #ifdef HAVE_CONFIG_H #include #endif #include #include "e-gui-utils.h" #include #include #include #include #include #include #include #include #include #include GtkWidget *e_create_image_widget(gchar *name, gchar *string1, gchar *string2, gint int1, gint int2) { GtkWidget *alignment = NULL; GdkPixbuf *pixbuf; GtkWidget *w; if (string1) { pixbuf = e_icon_factory_get_icon (string1, E_ICON_SIZE_DIALOG); w = gtk_image_new_from_pixbuf (pixbuf); g_object_unref (pixbuf); gtk_misc_set_alignment (GTK_MISC (w), 0.5, 0.5); alignment = gtk_widget_new(gtk_alignment_get_type(), "child", w, "xalign", (double) 0, "yalign", (double) 0, "xscale", (double) 0, "yscale", (double) 0, NULL); gtk_widget_show_all (alignment); } return alignment; } GtkWidget * e_button_new_with_stock_icon (const char *label_str, const char *stockid) { GtkWidget *button, *hbox, *label, *align, *image; button = gtk_button_new (); label = gtk_label_new_with_mnemonic (label_str); gtk_label_set_mnemonic_widget (GTK_LABEL (label), button); image = gtk_image_new_from_stock (stockid, GTK_ICON_SIZE_BUTTON); hbox = gtk_hbox_new (FALSE, 2); align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); gtk_box_pack_end (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (button), align); gtk_container_add (GTK_CONTAINER (align), hbox); gtk_widget_show_all (align); return button; } /** * e_icon_for_mime_type: * @mime_type: a MIME type * @size_hint: the size the caller plans to display the icon at * * Tries to find an icon representing @mime_type that will display * nicely at @size_hint by @size_hint pixels. The returned icon * may or may not actually be that size. * * Return value: a pixbuf, which the caller must unref when it is done **/ GdkPixbuf * e_icon_for_mime_type (const char *mime_type, int size_hint) { static GnomeIconTheme *icon_theme = NULL; char *icon_name, *icon_path = NULL; GdkPixbuf *pixbuf = NULL; /* Try the icon theme. (GNOME 2.2 or Sun GNOME 2.0). * This will also look in GNOME VFS. */ if (!icon_theme) icon_theme = gnome_icon_theme_new (); icon_name = gnome_icon_lookup (icon_theme, NULL, NULL, NULL, NULL, mime_type, 0, NULL); if (icon_name) { /* FIXME: should we take size_hint as being the same * as e-icon-factory.c? or should we just leave this * as pixel size? */ icon_path = gnome_icon_theme_lookup_icon ( icon_theme, icon_name, size_hint, NULL, NULL); g_free (icon_name); } if (icon_path == NULL) return NULL; pixbuf = gdk_pixbuf_new_from_file (icon_path, NULL); g_free (icon_path); return pixbuf; } >dependabot/npm_and_yarn/devel/electron6/files/elliptic-6.5.4 FreeBSD GNOME current development ports (https://github.com/freebsd/freebsd-ports-gnome)
aboutsummaryrefslogtreecommitdiffstats
Commit message (Expand)AuthorAgeFilesLines
* Support for ISO-8859-2 fonts should be enabled with --enable-latin2demon2004-11-171-1/+1
* This patch was integrated into rrdtool.demon2004-08-092-15/+0
* Update to version 1.0.49demon2004-08-086-37/+27
* Upgrade to version 1.0.48.demon2004-07-262-4/+4
* Add fix for perl <= 5.005_03vs2004-07-222-2/+17
* BROKEN on amd64: Does not build (needs to build shared libraries with -fPIC)kris2004-05-301-1/+7
* Avoid coredump in 'rrdtool graph -X <param>'demon2004-05-111-0/+11
* This port does not require libtool to build.demon2004-04-191-1/+1
* Use a copy of libpng shipped with rrdtool. This fixes build with ancientdemon2004-04-161-3/+1
* Update to version 1.0.47.demon2004-04-068-58/+37
* Add size data, approved by maintainers.trevor2004-03-191-0/+1
* Whoa there, boy, that's a mighty big commit y'all have there...ade2004-03-141-1/+1
* Remove redundant USE_GMAKE.demon2003-12-221-1/+0
* Correct pkg-plist.demon2003-10-301-1/+1
* Update to version 1.0.45.demon2003-10-294-22/+33
* utilize SITE_PERLijliao2003-10-241-9/+9
* De-pkg-comment.demon2003-02-222-1/+1
* Update to 1.0.41;demon2003-02-203-6/+3
* Fixes for 64-bit platforms.demon2003-02-111-0/+20
* Update to 1.0.40.demon2002-10-182-5/+2
* Upgrade to 1.0.39.demon2002-08-312-2/+5
* Upgrade to version 1.0.38.demon2002-05-253-3/+6
* Upgrade to 1.0.37demon2002-05-05