annotate src/menu.c @ 5:fe4dc2bef842

Broke the configure script on purpose, Added files to note that: THIS_CVS_IS_NOT_UP_TO_DATE
author gqview
date Tue, 19 Sep 2000 15:04:17 +0000
parents c0e337a01cb7
children d907d608745f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
1 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
2 * GQview image viewer
3
gqview
parents: 1
diff changeset
3 * (C)2000 John Ellis
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
4 *
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
5 * Author: John Ellis
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
6 *
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
7 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
8
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
9 #include "gqview.h"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
10
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
11 #include "icons/icon_thumb.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
12 #include "icons/icon_home.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
13 #include "icons/icon_reload.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
14 #include "icons/icon_zoom_in.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
15 #include "icons/icon_zoom_out.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
16 #include "icons/icon_zoom_fit.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
17 #include "icons/icon_zoom_norm.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
18 #include "icons/icon_config.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
19 #include "icons/icon_float.xpm"
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
20
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
21
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
22 static void add_menu_item(GtkWidget *menu, gchar *label, GtkAccelGroup *accel_group,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
23 guint accel_key, guint accel_mods, GtkSignalFunc func, gpointer data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
24
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
25 static void add_edit_items(GtkWidget *menu, GtkSignalFunc func, GtkAccelGroup *accel_grp);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
26
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
27 static void add_button_to_bar(GtkWidget *hbox, gchar **pixmap_data,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
28 GtkTooltips *tooltips, gchar *tip_text,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
29 GtkSignalFunc func, gpointer data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
30
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
31 static void set_thumbnails(gint mode)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
32 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
33 if (thumbnails_enabled == mode) return;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
34 thumbnails_enabled = mode;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
35 gtk_check_menu_item_set_state(GTK_CHECK_MENU_ITEM(thumb_menu_item), thumbnails_enabled);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
36 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(thumb_button), thumbnails_enabled);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
37 filelist_populate_clist();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
38 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
39
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
40 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
41 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
42 * menu and button callbacks (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
43 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
44 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
45
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
46 static void exit_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
47 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
48 exit_gqview();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
49 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
50
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
51 static void about_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
52 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
53 show_about_window();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
54 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
55
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
56 static void create_dir_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
57 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
58 file_util_create_dir(current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
59 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
60
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
61 static void zoom_in_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
62 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
63 image_adjust_zoom(1);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
64 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
65
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
66 static void zoom_out_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
67 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
68 image_adjust_zoom(-1);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
69 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
70
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
71 static void zoom_1_1_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
72 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
73 image_set_zoom(1);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
74 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
75
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
76 static void zoom_fit_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
77 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
78 image_set_zoom(0);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
79 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
80
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
81 static void thumb_menu_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
82 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
83 set_thumbnails(GTK_CHECK_MENU_ITEM(widget)->active);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
84 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
85
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
86 static void thumb_button_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
87 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
88 set_thumbnails(GTK_TOGGLE_BUTTON(widget)->active);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
89 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
90
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
91 static void refresh_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
92 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
93 gchar *buf = g_strdup(current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
94 filelist_change_to(buf);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
95 g_free(buf);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
96 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
97
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
98 static void float_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
99 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
100 toolwindow_float();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
101 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
102
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
103 static void hide_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
104 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
105 toolwindow_hide();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
106 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
107
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
108 static void slideshow_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
109 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
110 slideshow_toggle();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
111 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
112
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
113 static void home_dir_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
114 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
115 gchar *path = homedir();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
116 if (path) filelist_change_to(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
117 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
118
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
119 static void config_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
120 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
121 show_config_window();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
122 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
123
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
124 static void remove_thumb_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
125 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
126 maintain_thumbnail_dir("/", TRUE);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
127 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
128
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
129 static void full_screen_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
130 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
131 full_screen_toggle();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
132 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
133
3
gqview
parents: 1
diff changeset
134 static void wallpaper_image_cb(GtkWidget *widget, gpointer data)
gqview
parents: 1
diff changeset
135 {
gqview
parents: 1
diff changeset
136 image_to_root();
gqview
parents: 1
diff changeset
137 }
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
138
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
139 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
140 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
141 * image menu callbacks (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
142 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
143 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
144
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
145 static void copy_image_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
146 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
147 full_screen_stop();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
148 file_util_copy(image_get_path(), NULL, current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
149 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
150
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
151 static void move_image_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
152 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
153 full_screen_stop();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
154 file_util_move(image_get_path(), NULL, current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
155 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
156
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
157 static void rename_image_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
158 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
159 full_screen_stop();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
160 file_util_rename(image_get_path(), NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
161 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
162
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
163 static void delete_image_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
164 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
165 full_screen_stop();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
166 file_util_delete(image_get_path(), NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
167 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
168
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
169 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
170 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
171 * file menu callbacks (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
172 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
173 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
174
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
175 static void copy_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
176 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
177 file_util_copy(NULL, file_get_selected_list(), current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
178 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
179
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
180 static void move_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
181 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
182 file_util_move(NULL, file_get_selected_list(), current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
183 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
184
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
185 static void rename_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
186 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
187 file_util_rename(NULL, file_get_selected_list());
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
188 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
189
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
190 static void delete_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
191 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
192 file_util_delete(NULL, file_get_selected_list());
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
193 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
194
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
195 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
196 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
197 * filelist popup menu callbacks (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
198 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
199 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
200
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
201 static void popup_copy_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
202 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
203 if (file_clicked_is_selected())
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
204 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
205 file_util_copy(NULL, file_get_selected_list(), current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
206 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
207 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
208 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
209 gchar *path = file_clicked_get_path();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
210 file_util_copy(path, NULL, current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
211 g_free(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
212 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
213 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
214
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
215 static void popup_move_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
216 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
217 if (file_clicked_is_selected())
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
218 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
219 file_util_move(NULL, file_get_selected_list(), current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
220 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
221 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
222 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
223 gchar *path = file_clicked_get_path();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
224 file_util_move(path, NULL, current_path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
225 g_free(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
226 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
227 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
228
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
229 static void popup_rename_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
230 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
231 if (file_clicked_is_selected())
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
232 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
233 file_util_rename(NULL, file_get_selected_list());
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
234 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
235 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
236 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
237 gchar *path = file_clicked_get_path();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
238 file_util_rename(path, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
239 g_free(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
240 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
241 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
242
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
243 static void popup_delete_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
244 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
245 if (file_clicked_is_selected())
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
246 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
247 file_util_delete(NULL, file_get_selected_list());
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
248 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
249 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
250 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
251 gchar *path = file_clicked_get_path();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
252 file_util_delete(path, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
253 g_free(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
254 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
255 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
256
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
257 static void edit_image_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
258 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
259 gint n = GPOINTER_TO_INT(data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
260 start_editor_from_image(n);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
261 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
262
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
263 static void edit_list_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
264 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
265 gint n = GPOINTER_TO_INT(data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
266 start_editor_from_list(n);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
267 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
268
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
269 static void edit_full_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
270 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
271 gint n = GPOINTER_TO_INT(data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
272 full_screen_stop();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
273 start_editor_from_image(n);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
274 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
275
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
276 static void edit_view_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
277 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
278 gint n = GPOINTER_TO_INT(data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
279 view_window_active_edit(n);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
280 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
281
3
gqview
parents: 1
diff changeset
282 static void wallpaper_view_cb(GtkWidget *widget, gpointer data)
gqview
parents: 1
diff changeset
283 {
gqview
parents: 1
diff changeset
284 gint n = GPOINTER_TO_INT(data);
gqview
parents: 1
diff changeset
285 view_window_active_to_root(n);
gqview
parents: 1
diff changeset
286 }
gqview
parents: 1
diff changeset
287
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
288 static void popup_edit_list_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
289 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
290 gint n = GPOINTER_TO_INT(data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
291
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
292 if (file_clicked_is_selected())
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
293 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
294 start_editor_from_list(n);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
295 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
296 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
297 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
298 gchar *path;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
299 start_editor_from_file(n, path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
300 g_free(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
301 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
302 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
303
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
304 static void new_window_file_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
305 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
306 gchar *path = file_clicked_get_path();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
307 view_window_new(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
308 g_free(path);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
309 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
310
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
311 static void new_window_image_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
312 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
313 view_window_new(image_get_path());
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
314 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
315
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
316 static void menu_file_popup_hide_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
317 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
318 file_clist_highlight_unset();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
319 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
320
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
321
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
322 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
323 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
324 * menu addition utilities (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
325 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
326 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
327
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
328 static void add_menu_item(GtkWidget *menu, gchar *label, GtkAccelGroup *accel_group,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
329 guint accel_key, guint accel_mods, GtkSignalFunc func, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
330 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
331 GtkWidget *item;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
332
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
333 item = gtk_menu_item_new_with_label(label);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
334 gtk_widget_add_accelerator (item, "activate", accel_group, accel_key, accel_mods, GTK_ACCEL_VISIBLE);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
335 gtk_signal_connect (GTK_OBJECT (item), "activate",(GtkSignalFunc) func, data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
336 gtk_menu_append(GTK_MENU(menu), item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
337 gtk_widget_show(item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
338 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
339
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
340 void add_menu_popup_item(GtkWidget *menu, gchar *label,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
341 GtkSignalFunc func, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
342 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
343 GtkWidget *item;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
344
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
345 item = gtk_menu_item_new_with_label(label);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
346 gtk_signal_connect (GTK_OBJECT (item), "activate",(GtkSignalFunc) func, data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
347 gtk_menu_append(GTK_MENU(menu), item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
348 gtk_widget_show(item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
349 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
350
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
351 void add_menu_divider(GtkWidget *menu)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
352 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
353 GtkWidget *item = gtk_menu_item_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
354 gtk_menu_append(GTK_MENU(menu),item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
355 gtk_widget_show(item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
356 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
357
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
358 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
359 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
360 * edit menu routines
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
361 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
362 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
363
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
364 static void add_edit_items(GtkWidget *menu, GtkSignalFunc func, GtkAccelGroup *accel_grp)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
365 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
366 gint i;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
367 for (i = 0; i < 8; i++)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
368 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
369 if (editor_command[i] && strlen(editor_command[i]) > 0)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
370 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
371 gchar *text;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
372 if (editor_name[i] && strlen(editor_name[i]) > 0)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
373 text = g_strdup_printf(_("in %s..."), editor_name[i]);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
374 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
375 text = g_strdup(_("in (unknown)..."));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
376 if (accel_grp)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
377 add_menu_item(menu, text, accel_grp, i + 49, GDK_CONTROL_MASK, func, GINT_TO_POINTER(i));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
378 else
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
379 add_menu_popup_item(menu, text, func, GINT_TO_POINTER(i));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
380 g_free(text);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
381 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
382 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
383 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
384
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
385 void update_edit_menus(GtkAccelGroup *accel_grp)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
386 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
387 GtkWidget *menu;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
388
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
389 /* main edit menu */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
390
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
391 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
392 add_edit_items(menu, edit_list_cb, accel_grp);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
393 add_menu_divider(menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
394 add_menu_item(menu, _("Options..."), accel_grp, 'O', GDK_CONTROL_MASK, config_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
395 add_menu_divider(menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
396 add_menu_item(menu, _("Remove old thumbnails"), accel_grp, 'T', GDK_CONTROL_MASK, remove_thumb_cb, NULL);
3
gqview
parents: 1
diff changeset
397 add_menu_divider(menu);
gqview
parents: 1
diff changeset
398 add_menu_item(menu, _("Set as wallpaper"), accel_grp, 'W', GDK_CONTROL_MASK, wallpaper_image_cb, NULL);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
399 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_edit), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
400
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
401 /* file edit popup */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
402 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
403 add_edit_items(menu, popup_edit_list_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
404 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_filelist_edit), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
405
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
406 /* image edit popup */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
407 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
408 add_edit_items(menu, edit_image_cb, NULL);
3
gqview
parents: 1
diff changeset
409 add_menu_divider(menu);
gqview
parents: 1
diff changeset
410 add_menu_popup_item(menu, _("Set as wallpaper"), wallpaper_image_cb, NULL);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
411 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_image_edit), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
412
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
413 /* full screen edit popup */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
414 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
415 add_edit_items(menu, edit_full_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
416 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_window_full_edit), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
417
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
418 /* view edit popup */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
419 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
420 add_edit_items(menu, edit_view_cb, NULL);
3
gqview
parents: 1
diff changeset
421 add_menu_divider(menu);
gqview
parents: 1
diff changeset
422 add_menu_popup_item(menu, _("Set as wallpaper"), wallpaper_view_cb, NULL);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
423 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_window_view_edit), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
424 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
425
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
426 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
427 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
428 * menu bar setup routines
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
429 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
430 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
431
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
432 GtkWidget *create_menu_bar(GtkAccelGroup *accel_grp)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
433 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
434 GtkWidget *bar;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
435 GtkWidget *menu;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
436
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
437 bar = gtk_menu_bar_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
438
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
439 /* file menu */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
440 menu_file = gtk_menu_item_new_with_label(_("File"));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
441 gtk_widget_show(menu_file);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
442
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
443 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
444 add_menu_item(menu, _("Create Dir..."), accel_grp, 'N', GDK_CONTROL_MASK, create_dir_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
445 add_menu_divider(menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
446 add_menu_item(menu, _("Copy..."), accel_grp, 'C', GDK_CONTROL_MASK, copy_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
447 add_menu_item(menu, _("Move..."), accel_grp, 'M', GDK_CONTROL_MASK, move_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
448 add_menu_item(menu, _("Rename..."), accel_grp, 'R', GDK_CONTROL_MASK, rename_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
449 add_menu_item(menu, _("Delete..."), accel_grp, 'D', GDK_CONTROL_MASK, delete_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
450 add_menu_divider(menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
451 add_menu_item(menu, _("Exit"), accel_grp, 'Q', GDK_CONTROL_MASK, exit_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
452
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
453 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_file),menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
454 gtk_menu_bar_append(GTK_MENU_BAR(bar),menu_file);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
455
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
456 /* edit menu */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
457 menu_edit = gtk_menu_item_new_with_label(_("Edit"));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
458 gtk_widget_show(menu_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
459
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
460 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
461
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
462 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_edit), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
463 gtk_menu_bar_append(GTK_MENU_BAR(bar), menu_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
464
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
465 /* view menu */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
466 menu_view = gtk_menu_item_new_with_label(_("View"));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
467 gtk_widget_show(menu_view);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
468
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
469 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
470 add_menu_item(menu, _("Zoom in"), accel_grp, '=', FALSE, zoom_in_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
471 add_menu_item(menu, _("Zoom out"), accel_grp, '-', FALSE, zoom_out_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
472 add_menu_item(menu, _("Zoom 1:1"), accel_grp, 'Z', FALSE, zoom_1_1_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
473 add_menu_item(menu, _("Fit image to window"), accel_grp, 'X', FALSE, zoom_fit_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
474 add_menu_divider(menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
475
3
gqview
parents: 1
diff changeset
476 add_menu_item(menu, _("Full screen"), accel_grp, 'V', FALSE, full_screen_cb, NULL);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
477 thumb_menu_item = gtk_check_menu_item_new_with_label(_("Thumbnails"));
3
gqview
parents: 1
diff changeset
478 gtk_check_menu_item_set_state(GTK_CHECK_MENU_ITEM(thumb_menu_item), thumbnails_enabled);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
479 gtk_widget_add_accelerator (thumb_menu_item, "activate", accel_grp, 'T', FALSE, GTK_ACCEL_VISIBLE);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
480 gtk_signal_connect (GTK_OBJECT (thumb_menu_item), "activate",(GtkSignalFunc) thumb_menu_cb, thumb_menu_item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
481 gtk_menu_append(GTK_MENU(menu), thumb_menu_item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
482 gtk_widget_show(thumb_menu_item);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
483
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
484 add_menu_divider(menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
485 add_menu_item(menu, _("Refresh Lists"), accel_grp, 'R', FALSE, refresh_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
486 add_menu_item(menu, _("(Un)Float file list"), accel_grp, 'F', FALSE, float_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
487 add_menu_item(menu, _("(Un)Hide file list"), accel_grp, 'H', FALSE, hide_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
488
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
489 add_menu_divider(menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
490 add_menu_item(menu, _("Toggle slideshow"), accel_grp, 'S', FALSE, slideshow_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
491
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
492 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_view), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
493 gtk_menu_bar_append(GTK_MENU_BAR(bar), menu_view);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
494
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
495 /* help menu */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
496 menu_help = gtk_menu_item_new_with_label(_("Help"));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
497 gtk_widget_show(menu_help);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
498
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
499 menu = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
500 add_menu_item(menu, _("About"), accel_grp, 'A', GDK_CONTROL_MASK, about_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
501
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
502 gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_help), menu);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
503 gtk_menu_bar_append(GTK_MENU_BAR(bar), menu_help);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
504
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
505 return bar;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
506 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
507
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
508 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
509 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
510 * menu file list routines (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
511 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
512 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
513
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
514 static void create_menu_file_list_popup()
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
515 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
516 menu_file_popup = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
517 gtk_signal_connect(GTK_OBJECT(menu_file_popup), "hide", (GtkSignalFunc) menu_file_popup_hide_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
518
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
519 menu_filelist_edit = gtk_menu_item_new_with_label(_("Edit"));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
520 gtk_menu_append(GTK_MENU(menu_file_popup), menu_filelist_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
521 gtk_widget_show(menu_filelist_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
522
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
523 add_menu_popup_item(menu_file_popup, _("View in new window"), new_window_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
524
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
525 add_menu_divider(menu_file_popup);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
526 add_menu_popup_item(menu_file_popup, _("Copy..."), popup_copy_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
527 add_menu_popup_item(menu_file_popup, _("Move..."), popup_move_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
528 add_menu_popup_item(menu_file_popup, _("Rename..."), popup_rename_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
529 add_menu_popup_item(menu_file_popup, _("Delete..."), popup_delete_file_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
530 add_menu_divider(menu_file_popup);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
531 add_menu_popup_item(menu_file_popup, _("Refresh"), refresh_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
532 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
533
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
534 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
535 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
536 * menu image routines (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
537 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
538 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
539
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
540 static void create_menu_image_popup()
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
541 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
542 menu_image_popup = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
543
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
544 add_menu_popup_item(menu_image_popup, _("Zoom in"), zoom_in_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
545 add_menu_popup_item(menu_image_popup, _("Zoom out"), zoom_out_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
546 add_menu_popup_item(menu_image_popup, _("Zoom 1:1"), zoom_1_1_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
547 add_menu_popup_item(menu_image_popup, _("Fit image to window"), zoom_fit_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
548 add_menu_divider(menu_image_popup);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
549
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
550 menu_image_edit = gtk_menu_item_new_with_label(_("Edit"));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
551 gtk_menu_append(GTK_MENU(menu_image_popup), menu_image_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
552 gtk_widget_show(menu_image_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
553
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
554 add_menu_popup_item(menu_image_popup, _("View in new window"), new_window_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
555
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
556 add_menu_divider(menu_image_popup);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
557 add_menu_popup_item(menu_image_popup, _("Copy..."), copy_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
558 add_menu_popup_item(menu_image_popup, _("Move..."), move_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
559 add_menu_popup_item(menu_image_popup, _("Rename..."), rename_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
560 add_menu_popup_item(menu_image_popup, _("Delete..."), delete_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
561 add_menu_divider(menu_image_popup);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
562 add_menu_popup_item(menu_image_popup, _("(Un)Hide file list"), hide_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
563 add_menu_popup_item(menu_image_popup, _("Full screen"), full_screen_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
564 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
565
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
566 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
567 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
568 * menu full screen routines (private)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
569 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
570 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
571
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
572 /* this re-grabs the keyboard when the menu closes, needed for override redirect */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
573 static void menu_full_popup_hide_cb(GtkWidget *widget, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
574 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
575 if (full_screen_window)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
576 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
577 gdk_keyboard_grab(full_screen_window->window, TRUE, GDK_CURRENT_TIME);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
578 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
579 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
580
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
581 static void create_menu_full_screen_popup()
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
582 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
583 menu_window_full = gtk_menu_new();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
584 add_menu_popup_item(menu_window_full, _("Zoom in"), zoom_in_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
585 add_menu_popup_item(menu_window_full, _("Zoom out"), zoom_out_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
586 add_menu_popup_item(menu_window_full, _("Zoom 1:1"), zoom_1_1_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
587 add_menu_popup_item(menu_window_full, _("Fit image to window"), zoom_fit_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
588 add_menu_divider(menu_window_full);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
589
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
590 menu_window_full_edit = gtk_menu_item_new_with_label(_("Edit"));
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
591 gtk_menu_append(GTK_MENU(menu_window_full), menu_window_full_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
592 gtk_widget_show(menu_window_full_edit);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
593
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
594 add_menu_divider(menu_window_full);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
595 add_menu_popup_item(menu_window_full, _("Copy..."), copy_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
596 add_menu_popup_item(menu_window_full, _("Move..."), move_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
597 add_menu_popup_item(menu_window_full, _("Rename..."), rename_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
598 add_menu_popup_item(menu_window_full, _("Delete..."), delete_image_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
599
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
600 add_menu_divider(menu_window_full);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
601 add_menu_popup_item(menu_window_full, _("Exit full screen"), full_screen_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
602
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
603 gtk_signal_connect(GTK_OBJECT(menu_window_full), "hide", (GtkSignalFunc) menu_full_popup_hide_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
604 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
605
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
606 void create_menu_popups()
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
607 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
608 create_menu_file_list_popup();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
609 create_menu_image_popup();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
610 create_menu_full_screen_popup();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
611 create_menu_view_popup();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
612 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
613
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
614 /*
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
615 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
616 * toolbar routines
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
617 *-----------------------------------------------------------------------------
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
618 */
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
619
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
620 static void add_button_to_bar(GtkWidget *hbox, gchar **pixmap_data,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
621 GtkTooltips *tooltips, gchar *tip_text,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
622 GtkSignalFunc func, gpointer data)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
623 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
624 GtkWidget *button;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
625 GtkStyle *style;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
626 GtkWidget *pixmapwid;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
627 GdkPixmap *pixmap;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
628 GdkBitmap *mask;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
629
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
630 style = gtk_widget_get_style(mainwindow);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
631
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
632 button = gtk_button_new ();
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
633 gtk_signal_connect (GTK_OBJECT (button), "clicked",(GtkSignalFunc) func, thumb_button);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
634 gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
635 gtk_widget_show (button);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
636 gtk_tooltips_set_tip (tooltips, button, tip_text, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
637
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
638 pixmap = gdk_pixmap_create_from_xpm_d(mainwindow->window, &mask,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
639 &style->bg[GTK_STATE_NORMAL], (gchar **)pixmap_data);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
640 pixmapwid = gtk_pixmap_new(pixmap, mask);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
641 gtk_widget_show(pixmapwid);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
642 gtk_container_add(GTK_CONTAINER(button), pixmapwid);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
643 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
644
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
645 GtkWidget *create_button_bar(GtkTooltips *tooltips)
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
646 {
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
647 GtkWidget *hbox;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
648 GtkStyle *style;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
649 GtkWidget *pixmapwid;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
650 GdkPixmap *pixmap;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
651 GdkBitmap *mask;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
652
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
653 style = gtk_widget_get_style(mainwindow);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
654 hbox = gtk_hbox_new(FALSE, 0);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
655
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
656 thumb_button = gtk_toggle_button_new ();
3
gqview
parents: 1
diff changeset
657 gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(thumb_button), thumbnails_enabled);
1
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
658 gtk_signal_connect (GTK_OBJECT (thumb_button), "clicked",(GtkSignalFunc) thumb_button_cb, thumb_button);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
659 gtk_box_pack_start (GTK_BOX (hbox), thumb_button, FALSE, FALSE, 0);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
660 gtk_widget_show (thumb_button);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
661 gtk_tooltips_set_tip (tooltips, thumb_button, _("Create thumbnails"), NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
662
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
663 pixmap = gdk_pixmap_create_from_xpm_d(mainwindow->window, &mask,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
664 &style->bg[GTK_STATE_NORMAL], (gchar **)icon_thumb_xpm );
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
665 pixmapwid = gtk_pixmap_new(pixmap, mask);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
666 gtk_widget_show(pixmapwid);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
667 gtk_container_add(GTK_CONTAINER(thumb_button), pixmapwid);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
668
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
669 add_button_to_bar(hbox, (gchar **)icon_home_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
670 tooltips, _("Change to home directory"), home_dir_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
671 add_button_to_bar(hbox, (gchar **)icon_reload_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
672 tooltips, _("Refresh file list"), refresh_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
673 add_button_to_bar(hbox, (gchar **)icon_zoom_in_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
674 tooltips, _("Zoom in"), zoom_in_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
675 add_button_to_bar(hbox, (gchar **)icon_zoom_out_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
676 tooltips, _("Zoom out"), zoom_out_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
677 add_button_to_bar(hbox, (gchar **)icon_zoom_fit_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
678 tooltips, _("Fit image to window"), zoom_fit_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
679 add_button_to_bar(hbox, (gchar **)icon_zoom_norm_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
680 tooltips, _("Set zoom 1:1"), zoom_1_1_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
681 add_button_to_bar(hbox, (gchar **)icon_config_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
682 tooltips, _("Configure options"), config_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
683 add_button_to_bar(hbox, (gchar **)icon_float_xpm,
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
684 tooltips, _("Float Controls"), float_cb, NULL);
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
685
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
686 return hbox;
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
687 }
b3e0e515fabf Initial revision
gqview
parents:
diff changeset
688