Commit 6c438cf8 authored by Jesse van den Kieboom's avatar Jesse van den Kieboom

Implement file chooser hiding

parent ff3bba1c
......@@ -204,6 +204,12 @@ chooser_show (GeditFileChooserDialog *dialog)
gtk_widget_show (GTK_WIDGET (dialog));
}
static void
chooser_hide (GeditFileChooserDialog *dialog)
{
gtk_widget_hide (GTK_WIDGET (dialog));
}
static void
chooser_destroy (GeditFileChooserDialog *dialog)
{
......@@ -262,6 +268,7 @@ gedit_file_chooser_dialog_gtk_chooser_init (gpointer g_iface,
iface->get_files = chooser_get_files;
iface->set_do_overwrite_confirmation = chooser_set_do_overwrite_confirmation;
iface->show = chooser_show;
iface->hide = chooser_hide;
iface->destroy = chooser_destroy;
iface->set_modal = chooser_set_modal;
iface->get_window = chooser_get_window;
......
......@@ -751,6 +751,19 @@ chooser_show (GeditFileChooserDialog *dialog)
}
}
static void
chooser_hide (GeditFileChooserDialog *dialog)
{
GeditFileChooserDialogOSXPrivate *priv = GEDIT_FILE_CHOOSER_DIALOG_OSX (dialog)->priv;
if (!priv->is_running || priv->panel == NULL)
{
return;
}
[priv->panel orderOut:nil];
}
static void
chooser_destroy (GeditFileChooserDialog *dialog)
{
......@@ -785,6 +798,7 @@ gedit_file_chooser_dialog_osx_chooser_init (gpointer g_iface,
iface->get_files = chooser_get_files;
iface->set_do_overwrite_confirmation = chooser_set_do_overwrite_confirmation;
iface->show = chooser_show;
iface->hide = chooser_hide;
iface->destroy = chooser_destroy;
iface->set_modal = chooser_set_modal;
}
......
......@@ -261,6 +261,19 @@ gedit_file_chooser_dialog_show (GeditFileChooserDialog *dialog)
iface->show (dialog);
}
void
gedit_file_chooser_dialog_hide (GeditFileChooserDialog *dialog)
{
GeditFileChooserDialogInterface *iface;
g_return_if_fail (GEDIT_IS_FILE_CHOOSER_DIALOG (dialog));
iface = GEDIT_FILE_CHOOSER_DIALOG_GET_IFACE (dialog);
g_return_if_fail (iface->hide != NULL);
iface->hide (dialog);
}
void
gedit_file_chooser_dialog_destroy (GeditFileChooserDialog *dialog)
{
......
......@@ -73,6 +73,7 @@ struct _GeditFileChooserDialogInterface
gboolean overwrite_confirmation);
void (*show) (GeditFileChooserDialog *dialog);
void (*hide) (GeditFileChooserDialog *dialog);
void (*destroy) (GeditFileChooserDialog *dialog);
......@@ -144,6 +145,7 @@ void gedit_file_chooser_dialog_set_do_overwrite_confirmation (
gboolean overwrite_confirmation);
void gedit_file_chooser_dialog_show (GeditFileChooserDialog *dialog);
void gedit_file_chooser_dialog_hide (GeditFileChooserDialog *dialog);
void gedit_file_chooser_dialog_set_modal (GeditFileChooserDialog *dialog,
gboolean is_modal);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment