146 GtkDialog *dialog = GTK_DIALOG (annot_dialog);
147 GtkWidget *content_area;
150 const GdkRGBA yellow = { 1., 1., 0., 1. };
152 gtk_window_set_title (GTK_WINDOW (annot_dialog),
_(
"Annotation Properties"));
153 gtk_window_set_destroy_with_parent (GTK_WINDOW (annot_dialog),
TRUE);
154 gtk_container_set_border_width (GTK_CONTAINER (annot_dialog), 5);
155 gtk_dialog_add_buttons (dialog,
156 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
157 GTK_STOCK_APPLY, GTK_RESPONSE_APPLY,
159 gtk_dialog_set_default_response (dialog, GTK_RESPONSE_APPLY);
161 content_area = gtk_dialog_get_content_area (dialog);
162 gtk_box_set_spacing (GTK_BOX (content_area), 12);
164 grid = gtk_grid_new ();
165 annot_dialog->
grid = grid;
166 gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
167 gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
168 gtk_box_pack_start (GTK_BOX (content_area), grid,
FALSE,
FALSE, 0);
169 gtk_widget_show (grid);
171 label = gtk_label_new (
_(
"Author:"));
172 gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
173 gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
174 gtk_widget_show (label);
176 annot_dialog->
author = gtk_entry_new ();
177 gtk_entry_set_text (GTK_ENTRY (annot_dialog->
author), g_get_real_name ());
178 gtk_grid_attach (GTK_GRID (grid), annot_dialog->
author, 1, 0, 1, 1);
179 gtk_widget_set_hexpand (annot_dialog->
author,
TRUE);
180 gtk_widget_show (annot_dialog->
author);
182 label = gtk_label_new (
_(
"Color:"));
183 gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
184 gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
185 gtk_widget_show (label);
187 annot_dialog->
color = gtk_color_button_new_with_rgba (&yellow);
188 gtk_grid_attach (GTK_GRID (grid), annot_dialog->
color, 1, 1, 1, 1);
189 gtk_widget_set_hexpand (annot_dialog->
color,
TRUE);
190 gtk_widget_show (annot_dialog->
color);
192 label = gtk_label_new (
_(
"Opacity:"));
193 gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
194 gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
195 gtk_widget_show (label);
197 annot_dialog->
opacity = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
199 gtk_range_set_value (GTK_RANGE (annot_dialog->
opacity), 100);
200 gtk_grid_attach (GTK_GRID (grid), annot_dialog->
opacity, 1, 2, 1, 1);
201 gtk_widget_set_hexpand (annot_dialog->
opacity,
TRUE);
202 gtk_widget_show (annot_dialog->
opacity);
204 label = gtk_label_new (
_(
"Initial window state:"));
205 gtk_misc_set_alignment (GTK_MISC (label), 0., 0.5);
206 gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
207 gtk_widget_show (label);
209 annot_dialog->
popup_state = gtk_combo_box_text_new ();
210 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (annot_dialog->
popup_state),
_(
"Open"));
211 gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (annot_dialog->
popup_state),
_(
"Close"));
212 gtk_combo_box_set_active (GTK_COMBO_BOX (annot_dialog->
popup_state), 1);
213 gtk_grid_attach (GTK_GRID (grid), annot_dialog->
popup_state, 1, 3, 1, 1);