moo_window_set_parent()
parent
49bc1b1191
commit
ff227e3431
|
@ -182,6 +182,7 @@ moo_edit_save_changes_dialog (MooEdit *edit)
|
|||
|
||||
gtk_dialog_set_default_response (dialog, GTK_RESPONSE_YES);
|
||||
|
||||
moo_window_set_parent (GTK_WIDGET (dialog), GTK_WIDGET (edit));
|
||||
response = gtk_dialog_run (dialog);
|
||||
if (response == GTK_RESPONSE_DELETE_EVENT)
|
||||
response = GTK_RESPONSE_CANCEL;
|
||||
|
@ -380,7 +381,7 @@ moo_edit_save_multiple_changes_dialog (GSList *docs,
|
|||
xml = moo_glade_xml_new_from_buf (MOO_EDIT_SAVE_MULTIPLE_GLADE_UI, -1, "dialog");
|
||||
dialog = moo_glade_xml_get_widget (xml, "dialog");
|
||||
|
||||
moo_position_window (dialog, docs->data, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, docs->data);
|
||||
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
|
||||
MOO_STOCK_SAVE_NONE, GTK_RESPONSE_NO,
|
||||
|
@ -606,7 +607,7 @@ moo_text_nothing_found_dialog (GtkWidget *parent,
|
|||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_INFO, GTK_BUTTONS_NONE,
|
||||
msg_text);
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE,
|
||||
GTK_RESPONSE_CANCEL, NULL);
|
||||
|
@ -637,7 +638,7 @@ moo_text_search_from_start_dialog (GtkWidget *widget,
|
|||
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE,
|
||||
msg);
|
||||
moo_position_window (dialog, widget, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, widget);
|
||||
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
|
||||
GTK_STOCK_NO, GTK_RESPONSE_CANCEL,
|
||||
|
@ -689,7 +690,7 @@ moo_text_regex_error_dialog (GtkWidget *parent,
|
|||
GTK_DIALOG_MODAL,
|
||||
GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE,
|
||||
msg_text);
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (dialog), GTK_STOCK_CLOSE,
|
||||
GTK_RESPONSE_CANCEL, NULL);
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
|
||||
|
@ -712,7 +713,7 @@ moo_text_prompt_on_replace_dialog (GtkWidget *parent)
|
|||
dialog = moo_glade_xml_get_widget (xml, "prompt_on_replace_dialog");
|
||||
g_object_unref (xml);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
|
|
@ -356,7 +356,7 @@ moo_find_setup (MooFind *find,
|
|||
g_return_if_fail (MOO_IS_FIND (find));
|
||||
g_return_if_fail (GTK_IS_TEXT_VIEW (view));
|
||||
|
||||
moo_position_window (GTK_WIDGET (find), GTK_WIDGET (view), FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (GTK_WIDGET (find), GTK_WIDGET (view));
|
||||
|
||||
buffer = gtk_text_view_get_buffer (view);
|
||||
search_entry = moo_glade_xml_get_widget (find->xml, "search_entry");
|
||||
|
@ -1355,7 +1355,7 @@ moo_text_view_run_goto_line (GtkTextView *view)
|
|||
g_signal_connect (scale, "value-changed", G_CALLBACK (update_spin_value), spin);
|
||||
g_signal_connect (spin, "value-changed", G_CALLBACK (update_scale_value), scale);
|
||||
|
||||
moo_position_window (dialog, GTK_WIDGET (view), FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, GTK_WIDGET (view));
|
||||
|
||||
g_object_unref (xml);
|
||||
|
||||
|
|
|
@ -1320,7 +1320,7 @@ _moo_edit_print_options_dialog (GtkWidget *parent)
|
|||
dialog = moo_glade_xml_get_widget (xml, "dialog");
|
||||
g_return_if_fail (dialog != NULL);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
set_options (xml);
|
||||
|
||||
|
|
|
@ -330,7 +330,7 @@ create_new_file_dialog (GtkWidget *parent,
|
|||
dialog = moo_glade_xml_get_widget (*xml, "new_file_dialog");
|
||||
g_return_val_if_fail (dialog != NULL, NULL);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
entry = moo_glade_xml_get_widget (*xml, "entry");
|
||||
gtk_entry_set_text (entry, start_text);
|
||||
|
@ -753,7 +753,7 @@ create_save_as_dialog (GtkWidget *parent,
|
|||
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), title);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
entry = moo_glade_xml_get_widget (*xml, "entry");
|
||||
|
||||
|
|
|
@ -319,7 +319,7 @@ create_grep_dialog (MooEditWindow *window,
|
|||
GTK_RESPONSE_OK);
|
||||
gtk_dialog_set_response_sensitive (GTK_DIALOG (stuff->grep_dialog),
|
||||
GTK_RESPONSE_OK, FALSE);
|
||||
moo_position_window (stuff->grep_dialog, GTK_WIDGET (window), FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (stuff->grep_dialog, GTK_WIDGET (window));
|
||||
|
||||
g_signal_connect (stuff->grep_dialog, "delete-event",
|
||||
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
||||
|
@ -364,7 +364,7 @@ create_find_dialog (MooEditWindow *window,
|
|||
GTK_RESPONSE_OK);
|
||||
gtk_dialog_set_response_sensitive (GTK_DIALOG (stuff->find_dialog),
|
||||
GTK_RESPONSE_OK, FALSE);
|
||||
moo_position_window (stuff->find_dialog, GTK_WIDGET (window), FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (stuff->find_dialog, GTK_WIDGET (window));
|
||||
|
||||
g_signal_connect (stuff->find_dialog, "delete-event",
|
||||
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
||||
|
|
|
@ -275,9 +275,7 @@ static void moo_accel_button_clicked (MooAccelButton *button)
|
|||
if (button->title)
|
||||
gtk_window_set_title (GTK_WINDOW (dialog), button->title);
|
||||
|
||||
moo_position_window (dialog,
|
||||
gtk_widget_get_toplevel (GTK_WIDGET (button)),
|
||||
FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, GTK_WIDGET (button));
|
||||
|
||||
ok_button = moo_glade_xml_get_widget (xml, "ok");
|
||||
cancel_button = moo_glade_xml_get_widget (xml, "cancel");
|
||||
|
|
|
@ -140,13 +140,13 @@ on_hide (GtkWindow *window)
|
|||
#endif
|
||||
|
||||
|
||||
void
|
||||
moo_position_window (GtkWidget *window,
|
||||
GtkWidget *parent,
|
||||
gboolean at_mouse,
|
||||
gboolean at_coords,
|
||||
int x,
|
||||
int y)
|
||||
static void
|
||||
moo_position_window_real (GtkWidget *window,
|
||||
GtkWidget *parent,
|
||||
gboolean at_mouse,
|
||||
gboolean at_coords,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
GtkWidget *toplevel = NULL;
|
||||
|
||||
|
@ -205,6 +205,32 @@ moo_position_window (GtkWidget *window,
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
moo_position_window (GtkWidget *window,
|
||||
GtkWidget *parent,
|
||||
int x,
|
||||
int y)
|
||||
{
|
||||
moo_position_window_real (window, parent, FALSE, TRUE, x, y);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moo_position_window_at_pointer (GtkWidget *window,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
moo_position_window_real (window, parent, TRUE, FALSE, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moo_window_set_parent (GtkWidget *window,
|
||||
GtkWidget *parent)
|
||||
{
|
||||
moo_position_window_real (window, parent, FALSE, FALSE, 0, 0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
moo_message_dialog (GtkWidget *parent,
|
||||
GtkMessageType type,
|
||||
|
@ -226,7 +252,7 @@ moo_message_dialog (GtkWidget *parent,
|
|||
type, text, secondary_text);
|
||||
g_return_if_fail (dialog != NULL);
|
||||
|
||||
moo_position_window (dialog, parent, at_mouse, at_coords, x, y);
|
||||
moo_position_window_real (dialog, parent, at_mouse, at_coords, x, y);
|
||||
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
|
@ -311,7 +337,7 @@ moo_overwrite_file_dialog (GtkWidget *parent,
|
|||
|
||||
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CANCEL);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
response = gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
|
@ -339,7 +365,7 @@ moo_font_dialog (GtkWidget *parent,
|
|||
gtk_font_selection_dialog_set_font_name (
|
||||
GTK_FONT_SELECTION_DIALOG (dialog), start_font);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
if (GTK_RESPONSE_OK == gtk_dialog_run (GTK_DIALOG (dialog)))
|
||||
fontname = gtk_font_selection_dialog_get_font_name (
|
||||
|
|
|
@ -37,12 +37,15 @@ void moo_message_dialog (GtkWidget *parent,
|
|||
gboolean at_coords,
|
||||
int x,
|
||||
int y);
|
||||
|
||||
void moo_position_window (GtkWidget *window,
|
||||
GtkWidget *parent,
|
||||
gboolean at_mouse,
|
||||
gboolean at_coords,
|
||||
int x,
|
||||
int y);
|
||||
void moo_position_window_at_pointer (GtkWidget *window,
|
||||
GtkWidget *parent);
|
||||
void moo_window_set_parent (GtkWidget *window,
|
||||
GtkWidget *parent);
|
||||
|
||||
void moo_error_dialog (GtkWidget *parent,
|
||||
const char *text,
|
||||
|
|
|
@ -523,8 +523,7 @@ moo_file_dialog_run (MooFileDialog *dialog)
|
|||
filechooser = moo_file_dialog_create_widget (dialog);
|
||||
|
||||
if (dialog->priv->parent)
|
||||
moo_position_window (filechooser, dialog->priv->parent,
|
||||
FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (filechooser, dialog->priv->parent);
|
||||
|
||||
switch (dialog->priv->type)
|
||||
{
|
||||
|
|
|
@ -297,7 +297,7 @@ _moo_file_props_dialog_new (GtkWidget *parent)
|
|||
|
||||
dialog = g_object_new (MOO_TYPE_FILE_PROPS_DIALOG, NULL);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
return dialog;
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ _moo_file_view_create_folder_dialog (GtkWidget *parent,
|
|||
dialog = moo_glade_xml_get_widget (xml, "dialog");
|
||||
g_return_val_if_fail (dialog != NULL, NULL);
|
||||
|
||||
moo_position_window (dialog, parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, parent);
|
||||
|
||||
label = moo_glade_xml_get_widget (xml, "label");
|
||||
path = g_filename_display_name (_moo_folder_get_path (folder));
|
||||
|
@ -424,7 +424,7 @@ _moo_file_view_save_drop_dialog (GtkWidget *parent,
|
|||
dialog = moo_glade_xml_get_widget (xml, "save_drop_dialog");
|
||||
g_return_val_if_fail (dialog != NULL, NULL);
|
||||
|
||||
moo_position_window (dialog, parent, TRUE, FALSE, 0, 0);
|
||||
moo_position_window_at_pointer (dialog, parent);
|
||||
|
||||
entry = moo_glade_xml_get_widget (xml, "entry");
|
||||
|
||||
|
|
|
@ -2941,7 +2941,7 @@ file_view_delete_selected (MooFileView *fileview)
|
|||
GTK_MESSAGE_WARNING,
|
||||
GTK_BUTTONS_NONE,
|
||||
"%s", message);
|
||||
moo_position_window (dialog, GTK_WIDGET (fileview), FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, GTK_WIDGET (fileview));
|
||||
|
||||
gtk_dialog_add_buttons (GTK_DIALOG (dialog),
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
|
@ -2968,7 +2968,7 @@ file_view_delete_selected (MooFileView *fileview)
|
|||
MOO_FILE_IS_DIR (l->data) ? "folder" : "file",
|
||||
path);
|
||||
|
||||
moo_position_window (dialog, GTK_WIDGET (fileview), FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, GTK_WIDGET (fileview));
|
||||
|
||||
if (error)
|
||||
{
|
||||
|
@ -3402,7 +3402,7 @@ edit_bookmarks (MooFileView *fileview)
|
|||
G_CALLBACK (gtk_widget_hide_on_delete), NULL);
|
||||
}
|
||||
|
||||
moo_position_window (dialog, GTK_WIDGET (fileview), FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (dialog, GTK_WIDGET (fileview));
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
|
||||
|
|
|
@ -326,7 +326,7 @@ moo_prefs_dialog_run (MooPrefsDialog *dialog,
|
|||
{
|
||||
g_return_if_fail (MOO_IS_PREFS_DIALOG (dialog));
|
||||
|
||||
moo_position_window (GTK_WIDGET (dialog), parent, FALSE, FALSE, 0, 0);
|
||||
moo_window_set_parent (GTK_WIDGET (dialog), parent);
|
||||
|
||||
dialog->running = TRUE;
|
||||
g_signal_emit_by_name (dialog, "init");
|
||||
|
|
Loading…
Reference in New Issue