comparison src/win32/winprefs.c @ 4025:0d8b71d0d8f8

[gaim-migrate @ 4229] Initial import committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Sun, 01 Dec 2002 03:04:09 +0000
parents
children
comparison
equal deleted inserted replaced
4024:c97789bb4bbc 4025:0d8b71d0d8f8
1 /*
2 * winprefs.c
3 *
4 * Author: Herman Bloggs <hermanator12002@yahoo.com>
5 * Date: November, 2002
6 * Description: Windows only preferences page
7 */
8 #include <gtk/gtk.h>
9 #include "gaim.h"
10 #include "win32dep.h"
11
12 /*
13 * PROTOS
14 */
15 extern GtkWidget *gaim_button(const char*, guint*, int, GtkWidget*);
16
17 static void im_alpha_change(GtkWidget *w, gpointer data) {
18 int val = gtk_range_get_value(GTK_RANGE(w));
19 wgaim_set_imalpha(val);
20 }
21
22 GtkWidget *wgaim_winprefs_page() {
23 GtkWidget *ret;
24 GtkWidget *vbox;
25 GtkWidget *hbox;
26 GtkWidget *label, *slider;
27 GtkWidget *button;
28 GtkWidget *trans_box;
29
30 ret = gtk_vbox_new(FALSE, 18);
31 gtk_container_set_border_width (GTK_CONTAINER (ret), 12);
32
33 /* transparency options */
34 vbox = make_frame (ret, _("Transparency"));
35 button = gaim_button(_("_IM window transparency"), &wgaim_options, OPT_WGAIM_IMTRANS, vbox);
36 trans_box = gtk_vbox_new(FALSE, 18);
37 if (!(wgaim_options & OPT_WGAIM_IMTRANS))
38 gtk_widget_set_sensitive(GTK_WIDGET(trans_box), FALSE);
39 gtk_widget_show(trans_box);
40 gaim_button(_("_Show slider bar in IM window"), &wgaim_options, OPT_WGAIM_SHOW_IMTRANS, trans_box);
41 gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(toggle_sensitive), trans_box);
42 gtk_box_pack_start(GTK_BOX(vbox), trans_box, FALSE, FALSE, 5);
43
44 /* transparency slider */
45 hbox = gtk_hbox_new(FALSE, 5);
46
47 label = gtk_label_new(_("Default Opacity:"));
48 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5);
49
50 slider = gtk_hscale_new_with_range(50,255,1);
51 gtk_range_set_value(GTK_RANGE(slider), wgaim_get_imalpha());
52 gtk_widget_set_usize(GTK_WIDGET(slider), 200, -1);
53
54 gtk_signal_connect(GTK_OBJECT(slider), "value-changed", GTK_SIGNAL_FUNC(im_alpha_change), NULL);
55 gtk_box_pack_start(GTK_BOX(hbox), slider, FALSE, TRUE, 5);
56
57 gtk_widget_show_all(hbox);
58
59 gtk_box_pack_start(GTK_BOX(trans_box), hbox, FALSE, FALSE, 5);
60
61 /* If this version of Windows dosn't support Transparency, grey out options */
62 if(!wgaim_has_transparency()) {
63 gtk_widget_set_sensitive(GTK_WIDGET(vbox), FALSE);
64 }
65
66 gtk_widget_show_all(ret);
67 return ret;
68 }