Remove unnecessary map-event callback in wxGTK wxFileDialog
Calling gtk_file_chooser_set_show_hidden() directly from Create() works just as well and is simpler and shorter. See https://github.com/wxWidgets/wxWidgets/pull/1413
This commit is contained in:
@@ -151,21 +151,6 @@ static void gtk_filedialog_update_preview_callback(GtkFileChooser *chooser,
|
|||||||
|
|
||||||
} // extern "C"
|
} // extern "C"
|
||||||
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
static gboolean gtk_frame_map_callback( GtkFileChooser *file_chooser,
|
|
||||||
GdkEvent * WXUNUSED(event),
|
|
||||||
wxFileDialog *dlg )
|
|
||||||
{
|
|
||||||
/* if ( dlg->GetWindowStyle() & wxFD_SHOW_HIDDEN )
|
|
||||||
gtk_file_chooser_set_show_hidden( file_chooser, TRUE );
|
|
||||||
else
|
|
||||||
gtk_file_chooser_set_show_hidden( file_chooser, FALSE );*/
|
|
||||||
gtk_file_chooser_set_show_hidden(file_chooser, dlg->HasFlag(wxFD_SHOW_HIDDEN));
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxFileDialog::AddChildGTK(wxWindowGTK* child)
|
void wxFileDialog::AddChildGTK(wxWindowGTK* child)
|
||||||
{
|
{
|
||||||
// allow dialog to be resized smaller horizontally
|
// allow dialog to be resized smaller horizontally
|
||||||
@@ -290,8 +275,6 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
|
|||||||
g_signal_connect (m_widget, "selection-changed",
|
g_signal_connect (m_widget, "selection-changed",
|
||||||
G_CALLBACK (gtk_filedialog_selchanged_callback), this);
|
G_CALLBACK (gtk_filedialog_selchanged_callback), this);
|
||||||
|
|
||||||
g_signal_connect (m_widget, "map_event",
|
|
||||||
G_CALLBACK (gtk_frame_map_callback), this);
|
|
||||||
// deal with extensions/filters
|
// deal with extensions/filters
|
||||||
SetWildcard(wildCard);
|
SetWildcard(wildCard);
|
||||||
|
|
||||||
@@ -367,6 +350,9 @@ bool wxFileDialog::Create(wxWindow *parent, const wxString& message,
|
|||||||
previewImage);
|
previewImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gtk_file_chooser_set_show_hidden(file_chooser,
|
||||||
|
style & wxFD_SHOW_HIDDEN ? TRUE : FALSE);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user