ui/gtk/window.c

changeset 65
48f43130b4a2
parent 58
0d25f15e2625
equal deleted inserted replaced
64:98d0e2516f4e 65:48f43130b4a2
237 adw_alert_dialog_add_response(ADW_ALERT_DIALOG(dialog), "close", args.closebutton_label); 237 adw_alert_dialog_add_response(ADW_ALERT_DIALOG(dialog), "close", args.closebutton_label);
238 adw_alert_dialog_set_close_response(ADW_ALERT_DIALOG(dialog), "close"); 238 adw_alert_dialog_set_close_response(ADW_ALERT_DIALOG(dialog), "close");
239 } 239 }
240 240
241 GtkWidget *entry = NULL; 241 GtkWidget *entry = NULL;
242 if(args.input) { 242 if(args.input || args.password) {
243 entry = gtk_entry_new(); 243 entry = gtk_entry_new();
244 if(args.password) {
245 gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE);
246 }
247 if(args.input_value) {
248 ENTRY_SET_TEXT(entry, args.input_value);
249 }
244 adw_alert_dialog_set_extra_child(ADW_ALERT_DIALOG(dialog), entry); 250 adw_alert_dialog_set_extra_child(ADW_ALERT_DIALOG(dialog), entry);
245 event->customdata = entry; 251 event->customdata = entry;
246 } 252 }
247 253
248 g_signal_connect( 254 g_signal_connect(
311 GtkWidget *label = gtk_label_new(args.content); 317 GtkWidget *label = gtk_label_new(args.content);
312 BOX_ADD(content_area, label); 318 BOX_ADD(content_area, label);
313 } 319 }
314 320
315 GtkWidget *textfield = NULL; 321 GtkWidget *textfield = NULL;
316 if(args.input) { 322 if(args.input || args.password) {
317 textfield = gtk_entry_new(); 323 textfield = gtk_entry_new();
324 if(args.password) {
325 gtk_entry_set_visibility(GTK_ENTRY(textfield), FALSE);
326 }
327 if(args.input_value) {
328 ENTRY_SET_TEXT(textfield, args.input_value);
329 }
318 BOX_ADD(content_area, textfield); 330 BOX_ADD(content_area, textfield);
319 } 331 }
320 332
321 UiEventData *event = malloc(sizeof(UiEventData)); 333 UiEventData *event = malloc(sizeof(UiEventData));
322 event->obj = parent; 334 event->obj = parent;

mercurial