View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0038292 | Lazarus | Widgetset | public | 2021-01-02 15:32 | 2021-02-02 17:27 |
Reporter | CudaText man_ | Assigned To | Juha Manninen | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
OS | Ubuntu 20.04 x64 | ||||
Product Version | 2.1 (SVN) | ||||
Summary | 0038292: gtk2: issue with too long TOpenDialog/TSaveDialog.Filter | ||||
Description | run attached demo. on qt5, too long Filter string is cropped and dialog looks OK. on gtk2, too long filter string shows as-is, this gives the dialog huge width (dialog occupies 2 monitors, which are placed left/right). | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
LazTarget | - | ||||
Widgetset | GTK 2 | ||||
Attached Files |
|
|
|
|
|
|
Isn't that just how GTK2 handles that internally I don't see any properties in https://developer.gnome.org/gtk2/stable/GtkFileChooser.html or https://developer.gnome.org/gtk2/stable/GtkFileChooserDialog.html to prevent that from happening? |
|
IMO this is gtk2 problem, by design. |
|
In that case, close as not fixable? (I'm not the GTK expert) |
|
@Bart, someone can make pure gtk2 program (without lcl) and proove this. IMO it's pretty easy, but I have not time to do that atm. |
|
Yes, this is the normal behavior for gtk2 if you set a large filter. I upload a tiny program written in C and a screenshot. However with pure Gtk you add various filters and sets a human-readable name for them (added as items into combobox). test.c (2,304 bytes)
/* gcc -o test test.c $(pkg-config --cflags --libs gtk+-2.0) */ #include <gtk/gtk.h> static void select_file (GtkWidget* sender, gpointer parent) { gchar* filename = NULL; GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN; GtkWidget *dialog; dialog = gtk_file_chooser_dialog_new ("Select...", (GtkWindow*) parent, action, "_Open", GTK_RESPONSE_ACCEPT, "_Cancel", GTK_RESPONSE_CANCEL, NULL); GtkFileFilter *filter = gtk_file_filter_new (); gtk_file_filter_add_pattern (filter, "*"); gtk_file_filter_set_name (filter, "test ******************************************************************************************\ ***********************************************************************************************\ ***********************************************************************************************\ ***********************************************************************************************"); gtk_file_chooser_add_filter ((GtkFileChooser*)dialog, filter); if (gtk_dialog_run ((GtkDialog*) dialog) == ((gint) GTK_RESPONSE_ACCEPT)) filename = gtk_file_chooser_get_filename ((GtkFileChooser*) dialog); gtk_widget_destroy (dialog); if (filename) g_print (filename); } int main(int argc, char *argv[]) { GtkWidget *window; GtkWidget *vbox; GtkWidget *button; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER); gtk_window_resize(GTK_WINDOW(window), 800, 600); gtk_window_set_title(GTK_WINDOW(window), "File Selection"); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(window), vbox); button = gtk_button_new_with_label("Click me"); gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 5); g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(select_file), window); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL); gtk_widget_show_all(window); gtk_main(); return 0; } |
|
Native behavior. No change required. |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-01-02 15:32 | CudaText man_ | New Issue | |
2021-01-02 15:32 | CudaText man_ | Note Added: 0128020 | |
2021-01-02 15:32 | CudaText man_ | File Added: tst-filedialog-long-filter.zip | |
2021-01-02 15:33 | CudaText man_ | Note Added: 0128021 | |
2021-01-02 15:33 | CudaText man_ | File Added: filter_qt5.png | |
2021-01-02 15:33 | CudaText man_ | File Added: filter_gtk2.png | |
2021-01-02 17:45 | Bart Broersma | Note Added: 0128027 | |
2021-01-19 13:48 | Zeljan Rikalo | Note Added: 0128413 | |
2021-01-19 14:51 | Bart Broersma | Note Added: 0128416 | |
2021-01-19 16:35 | Zeljan Rikalo | Note Added: 0128426 | |
2021-01-19 19:37 | August Klein | Note Added: 0128431 | |
2021-01-19 19:37 | August Klein | File Added: screenshot.png | |
2021-01-19 19:37 | August Klein | File Added: test.c | |
2021-01-19 19:42 | August Klein | Note Edited: 0128431 | View Revisions |
2021-02-02 17:27 | Juha Manninen | Assigned To | => Juha Manninen |
2021-02-02 17:27 | Juha Manninen | Status | new => resolved |
2021-02-02 17:27 | Juha Manninen | Resolution | open => no change required |
2021-02-02 17:27 | Juha Manninen | LazTarget | => - |
2021-02-02 17:27 | Juha Manninen | Widgetset | GTK 2 => GTK 2 |
2021-02-02 17:27 | Juha Manninen | Note Added: 0128743 |