[Xfce-bugs] [Bug 15973] Center action buttons in conflict dialog window

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Thu Sep 19 01:46:27 CEST 2019


https://bugzilla.xfce.org/show_bug.cgi?id=15973

--- Comment #2 from fuank <greob at yahoo.com.sg> ---
Thanks, yes I've been working all day on a patch. So far, I got the buttons to
align as wished, but I need to figure out how to implement the callbacks (?)
for the buttons. See video attached for demonstration.

Here is part of the code so far (without the pointer declarations), I'll keep
hammering on it.

  dialog = gtk_dialog_new();
  gtk_window_set_destroy_with_parent (GTK_WINDOW(dialog), TRUE);
  gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
  gtk_window_set_title (GTK_WINDOW(dialog), _("Confirm to replace files"));

  gtk_dialog_set_default_response (GTK_DIALOG (dialog),
THUNAR_JOB_RESPONSE_YES);
  content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));

  button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);

  // we're missing the actual responses here!
  cancel_button = gtk_button_new_with_mnemonic (_("_Cancel"));
  skipall_button = gtk_button_new_with_mnemonic (_("S_kip All"));
  skip_button = gtk_button_new_with_mnemonic (_("_Skip"));
  replaceall_button = gtk_button_new_with_mnemonic (_("Replace _All"));
  replace_button = gtk_button_new_with_mnemonic (_("_Replace"));

  gtk_container_add (GTK_CONTAINER(button_box), cancel_button); 
  gtk_container_add (GTK_CONTAINER(button_box), skipall_button); 
  gtk_container_add (GTK_CONTAINER(button_box), skip_button); 
  gtk_container_add (GTK_CONTAINER(button_box), replaceall_button); 
  gtk_container_add (GTK_CONTAINER(button_box), replace_button); 
  gtk_container_add (GTK_CONTAINER(content_area), button_box); 
  gtk_widget_set_hexpand (button_box, GTK_ALIGN_CENTER); 
  gtk_widget_set_halign (button_box, GTK_ALIGN_CENTER);
  gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG
(dialog))), button_box, TRUE, FALSE, 0);
  gtk_widget_show (cancel_button); 
  gtk_widget_show (skipall_button); 
  gtk_widget_show (skip_button); 
  gtk_widget_show (replaceall_button); 
  gtk_widget_show (replace_button); 
  gtk_widget_show (button_box);

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Xfce-bugs mailing list