annotate audacious/ui_about.c @ 2257:af716dc0cdb9 trunk

[svn] - do not create GtkAccelGroup anymore; use ui_manager_get_accel_group to get accelerator groups from ui_manager
author giacomo
date Thu, 04 Jan 2007 03:58:58 -0800
parents a6010343e979
children 9d8430979580
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2231
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
1 /*
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
2 * Audacious - Cross-platform multimedia player
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
3 * Copyright (C) 2005-2007 Audacious development team
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
4 *
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
5 * Based on BMP:
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
6 * Copyright (C) 2003-2004 BMP development team
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
7 *
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
8 * Based on XMMS:
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
9 * Copyright (C) 1998-2003 XMMS development team
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
10 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
11 * This program is free software; you can redistribute it and/or modify
1460
411b4aaf928b [svn] fine
nemo
parents: 1459
diff changeset
12 * it under the terms of the GNU General Public License as published by
2105
f18a5b617c34 [svn] - move to GPLv2-only. Based on my interpretation of the license, we are
nenolod
parents: 1895
diff changeset
13 * the Free Software Foundation; under version 2 of the License.
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
14 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
15 * This program is distributed in the hope that it will be useful,
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
18 * GNU General Public License for more details.
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
19 *
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
20 * You should have received a copy of the GNU General Public License
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
21 * along with this program; if not, write to the Free Software
1459
705d4c089fce [svn] Fix postal code.
chainsaw
parents: 1458
diff changeset
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23 */
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
24
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
25 #ifdef HAVE_CONFIG_H
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
26 # include "config.h"
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
27 #endif
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
28
2241
a6010343e979 [svn] - about.c -> ui_about.c, credits.c -> ui_credits.c
nenolod
parents: 2231
diff changeset
29 #include "ui_credits.h"
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
30
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
31 #include <glib.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
32 #include <glib/gi18n.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
33 #include <gtk/gtk.h>
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
34
1640
6e477dd65024 [svn] - gtkquartz compatibility, pass 1
nenolod
parents: 1460
diff changeset
35 #include "platform/smartinclude.h"
6e477dd65024 [svn] - gtkquartz compatibility, pass 1
nenolod
parents: 1460
diff changeset
36
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
37 static GtkWidget *about_window = NULL;
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
38 static GdkPixbuf *about_pixbuf = NULL;
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
39 static GdkPixmap *mask_pixmap_window1 = NULL,
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
40 *mask_pixmap_window2 = NULL;
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
41 static GdkBitmap *mask_bitmap_window1 = NULL,
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
42 *mask_bitmap_window2 = NULL;
529
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
43
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
44 static const gchar *audacious_brief = "<big><b>Audacious %s</b></big>\n\n"
2231
86f0443d0de2 [svn] Update some copyrights notices, update po/
kiyoshi
parents: 2105
diff changeset
45 "Copyright (C) 2005-2007 Audacious Development Team";
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
46
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
47 static gboolean
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
48 on_about_window_expose(GtkWidget *widget, GdkEventExpose *expose, gpointer data)
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
49 {
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
50 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
51
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
52 gdk_window_set_back_pixmap(GDK_WINDOW(widget->window), mask_pixmap_window2, 0);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
53 gdk_window_clear(GDK_WINDOW(widget->window));
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
54
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
55 return FALSE;
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
56 }
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
57
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
58 static gboolean
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
59 on_about_window_key_press (GtkWidget *widget, GdkEventKey *event, gpointer data)
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
60 {
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
61 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
62
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
63 if (event->keyval == GDK_Escape)
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
64 {
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
65 gtk_widget_hide(widget);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
66 }
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
67
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
68 return FALSE;
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
69 }
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
70
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
71 static gboolean
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
72 on_close_button_clicked (GtkWidget *widget, gpointer data)
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
73 {
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
74 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
75
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
76 gtk_widget_hide(about_window);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
77
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
78 return FALSE;
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
79 }
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
80
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
81 static gboolean
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
82 on_credits_button_clicked (GtkWidget *widget, gpointer data)
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
83 {
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
84 g_return_val_if_fail(GTK_IS_WIDGET (widget), FALSE);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
85
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
86 show_credits_window();
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
87
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
88 return FALSE;
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
89 }
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
90
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
91 void
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
92 show_about_window(void)
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
93 {
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
94 GtkWidget *about_fixedbox;
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
95 GtkWidget *close_button;
510
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
96 GtkWidget *credits_button , *credits_button_hbox, *credits_button_image, *credits_button_label;
529
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
97 GtkWidget *brief_label;
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
98 gchar *filename = DATA_DIR G_DIR_SEPARATOR_S "images" G_DIR_SEPARATOR_S "about-logo.png";
529
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
99 gchar *text;
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
100 PangoAttrList *brief_label_attrs;
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
101 PangoAttribute *brief_label_foreground;
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
102
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
103 if (about_window != NULL)
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
104 {
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
105 gtk_window_present(GTK_WINDOW(about_window));
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
106 return;
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
107 }
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
108
1895
4ab001eeef36 [svn] - make sure the proper wmclass is being set here.
nenolod
parents: 1754
diff changeset
109 about_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
1086
e2dbacdab58a [svn] - About window should be set to 'always on top'
nhjm449
parents: 945
diff changeset
110
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
111 g_signal_connect(about_window, "destroy",
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
112 G_CALLBACK(gtk_widget_destroyed), &about_window);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
113
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
114 gtk_widget_realize(about_window);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
115
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
116 about_pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
117
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
118 gtk_widget_set_size_request(GTK_WIDGET (about_window),
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
119 gdk_pixbuf_get_width (about_pixbuf),
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
120 gdk_pixbuf_get_height (about_pixbuf));
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
121
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
122 gtk_widget_set_app_paintable(about_window, TRUE);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
123 gtk_window_set_title(GTK_WINDOW(about_window), _("About Audacious"));
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
124 gtk_window_set_position(GTK_WINDOW(about_window), GTK_WIN_POS_CENTER);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
125 gtk_window_set_resizable(GTK_WINDOW(about_window), FALSE);
505
55ec56ecbfad [svn] Make *sure* it's borderless.
nenolod
parents: 504
diff changeset
126 gtk_window_set_decorated(GTK_WINDOW(about_window), FALSE);
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
127
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
128 gdk_pixbuf_render_pixmap_and_mask(about_pixbuf,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
129 &mask_pixmap_window1,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
130 &mask_bitmap_window1,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
131 0);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
132
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
133 gdk_pixbuf_render_pixmap_and_mask(about_pixbuf,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
134 &mask_pixmap_window2,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
135 &mask_bitmap_window2,
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
136 128);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
137
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
138 gtk_widget_add_events(about_window, GDK_ALL_EVENTS_MASK);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
139
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
140 g_signal_connect(about_window, "expose-event",
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
141 G_CALLBACK(on_about_window_expose), &about_window);
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
142
474
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
143 g_signal_connect(about_window, "key-press-event",
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
144 G_CALLBACK(on_about_window_key_press), &about_window);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
145
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
146 gtk_widget_shape_combine_mask(GTK_WIDGET(about_window), mask_bitmap_window2, 0, 0);
f3b46533da81 [svn] Experimental about box stuff... doesnt work right yet. Work in progress!
nenolod
parents: 471
diff changeset
147
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
148 /* GtkFixed hasn't got its GdkWindow, this means that it can be used to
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
149 display widgets while the logo below will be displayed anyway;
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
150 however fixed positions are not that great, cause the button sizes may (will)
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
151 vary depending on the gtk style used, so it's not possible to center
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
152 them unless a fixed width and heigth is forced (and this may bring to cutted
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
153 text if someone, i.e., uses a big font for gtk widgets);
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
154 other types of container most likely have their GdkWindow, this simply
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
155 means that the logo must be drawn on the container widget, instead of the
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
156 window; otherwise, it won't be displayed correctly */
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
157 about_fixedbox = gtk_fixed_new();
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
158 gtk_container_add( GTK_CONTAINER(about_window) , about_fixedbox );
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
159
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
160 close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
161
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
162 g_signal_connect(close_button, "clicked",
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
163 G_CALLBACK(on_close_button_clicked), NULL);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
164
529
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
165 gtk_fixed_put( GTK_FIXED(about_fixedbox) , close_button , 375 , 220 );
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
166 gtk_widget_set_size_request( close_button , 100 , -1 );
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
167
510
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
168 credits_button = gtk_button_new();
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
169 credits_button_hbox = gtk_hbox_new( FALSE , 0 );
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
170 credits_button_image = gtk_image_new_from_stock( GTK_STOCK_DIALOG_INFO , GTK_ICON_SIZE_BUTTON );
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
171 gtk_misc_set_alignment( GTK_MISC(credits_button_image) , 1 , 0.5 );
511
9da0f92ce2ef [svn] make "Credits" translatable.
nenolod
parents: 510
diff changeset
172 credits_button_label = gtk_label_new( _("Credits") );
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
173 gtk_misc_set_alignment( GTK_MISC(credits_button_label) , 0 , 0.5 );
510
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
174 gtk_box_pack_start( GTK_BOX(credits_button_hbox) , credits_button_image ,
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
175 TRUE , TRUE , 2 );
510
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
176 gtk_box_pack_start( GTK_BOX(credits_button_hbox) , credits_button_label ,
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
177 TRUE , TRUE , 2 );
510
d9f6ab166d58 [svn] custom label/images for about.c buttons
giacomo
parents: 505
diff changeset
178 gtk_container_add( GTK_CONTAINER(credits_button) , credits_button_hbox );
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
179
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
180 g_signal_connect(credits_button, "clicked",
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
181 G_CALLBACK(on_credits_button_clicked), NULL);
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
182
529
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
183 gtk_fixed_put( GTK_FIXED(about_fixedbox) , credits_button , 25 , 220 );
513
66cb6c4055c6 [svn] about.c buttons centered and properly sized
giacomo
parents: 511
diff changeset
184 gtk_widget_set_size_request( credits_button , 100 , -1 );
504
9f135663aaee [svn] Credits window is back in action.
nenolod
parents: 503
diff changeset
185
529
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
186 brief_label = gtk_label_new(NULL);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
187 text = g_strdup_printf(_(audacious_brief), VERSION);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
188
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
189 brief_label_foreground = pango_attr_foreground_new(0, 0, 0);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
190 brief_label_attrs = pango_attr_list_new();
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
191 pango_attr_list_insert(brief_label_attrs, brief_label_foreground);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
192
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
193 gtk_label_set_markup(GTK_LABEL(brief_label), text);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
194 gtk_label_set_justify(GTK_LABEL(brief_label), GTK_JUSTIFY_CENTER);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
195 gtk_label_set_attributes(GTK_LABEL(brief_label), brief_label_attrs);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
196 g_free(text);
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
197
547
2d86cb17b5af [svn] centered text in audacious logo window
giacomo
parents: 529
diff changeset
198 gtk_fixed_put(GTK_FIXED(about_fixedbox), brief_label, 20, 145);
2d86cb17b5af [svn] centered text in audacious logo window
giacomo
parents: 529
diff changeset
199 gtk_widget_set_size_request( brief_label , 460 , -1 );
529
91ff72a52821 [svn] About box tweaks.
nenolod
parents: 513
diff changeset
200
502
3399d6a41f16 [svn] initial layout for buttons over the png logo
giacomo
parents: 475
diff changeset
201 gtk_widget_show_all(about_window);
475
cd5793de075c [svn] More progress towards the about window, no more background being overwritten... we were forgetting to tell X that the window was paintable.
nenolod
parents: 474
diff changeset
202 gtk_window_present(GTK_WINDOW(about_window));
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
203 }