Mercurial > pidgin.yaz
comparison pidgin/gtkutils.c @ 21646:2a2496044eef
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
may be other windows that need this.
The buttons at the bottom don't quite line up properly. That needs to be fixed.
Closes #2137.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 26 Nov 2007 08:47:08 +0000 |
parents | 665e04562de0 |
children | eb2d5ba2a50d |
comparison
equal
deleted
inserted
replaced
21645:d0ea3a86add5 | 21646:2a2496044eef |
---|---|
130 gtk_widget_modify_font(imhtml, desc); | 130 gtk_widget_modify_font(imhtml, desc); |
131 pango_font_description_free(desc); | 131 pango_font_description_free(desc); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 GtkWidget * | 135 static |
136 pidgin_create_window(const char *title, guint border_width, const char *role, gboolean resizable) | 136 void pidgin_window_init(GtkWindow *wnd, const char *title, guint border_width, const char *role, gboolean resizable) |
137 { | 137 { |
138 GtkWindow *wnd = NULL; | |
139 | |
140 wnd = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | |
141 if (title) | 138 if (title) |
142 gtk_window_set_title(wnd, title); | 139 gtk_window_set_title(wnd, title); |
143 #ifdef _WIN32 | 140 #ifdef _WIN32 |
144 else | 141 else |
145 gtk_window_set_title(wnd, PIDGIN_ALERT_TITLE); | 142 gtk_window_set_title(wnd, PIDGIN_ALERT_TITLE); |
146 #endif | 143 #endif |
147 gtk_container_set_border_width(GTK_CONTAINER(wnd), border_width); | 144 gtk_container_set_border_width(GTK_CONTAINER(wnd), border_width); |
148 if (role) | 145 if (role) |
149 gtk_window_set_role(wnd, role); | 146 gtk_window_set_role(wnd, role); |
150 gtk_window_set_resizable(wnd, resizable); | 147 gtk_window_set_resizable(wnd, resizable); |
148 } | |
149 | |
150 GtkWidget * | |
151 pidgin_create_window(const char *title, guint border_width, const char *role, gboolean resizable) | |
152 { | |
153 GtkWindow *wnd = NULL; | |
154 | |
155 wnd = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | |
156 pidgin_window_init(wnd, title, border_width, role, resizable); | |
151 | 157 |
152 return GTK_WIDGET(wnd); | 158 return GTK_WIDGET(wnd); |
159 } | |
160 | |
161 GtkWidget * | |
162 pidgin_create_dialog(const char *title, guint border_width, const char *role, gboolean resizable) | |
163 { | |
164 GtkWindow *wnd = NULL; | |
165 | |
166 wnd = GTK_WINDOW(gtk_dialog_new()); | |
167 pidgin_window_init(wnd, title, border_width, role, resizable); | |
168 g_object_set(G_OBJECT(wnd), "has-separator", FALSE, NULL); | |
169 | |
170 return GTK_WIDGET(wnd); | |
171 } | |
172 | |
173 GtkWidget * | |
174 pidgin_dialog_get_vbox_with_properties(GtkDialog *dialog, gboolean homogeneous, gint spacing) | |
175 { | |
176 GtkBox *vbox = GTK_BOX(GTK_DIALOG(dialog)->vbox); | |
177 gtk_box_set_homogeneous(vbox, homogeneous); | |
178 gtk_box_set_spacing(vbox, spacing); | |
179 return GTK_WIDGET(vbox); | |
180 } | |
181 | |
182 GtkWidget *pidgin_dialog_get_vbox(GtkDialog *dialog) | |
183 { | |
184 return GTK_DIALOG(dialog)->vbox; | |
185 } | |
186 | |
187 GtkWidget *pidgin_dialog_get_action_area(GtkDialog *dialog) | |
188 { | |
189 return GTK_DIALOG(dialog)->action_area; | |
153 } | 190 } |
154 | 191 |
155 GtkWidget * | 192 GtkWidget * |
156 pidgin_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret) | 193 pidgin_create_imhtml(gboolean editable, GtkWidget **imhtml_ret, GtkWidget **toolbar_ret, GtkWidget **sw_ret) |
157 { | 194 { |