summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-12-13 18:37:48 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-12-16 16:21:23 +0100
commit41f37613ec6a14fb8b3357e2dc0323116bf8439b (patch)
treeb6677826b5eadc6571f2ffd582d9a2d858172102 /FL
parent576271fb04e1c2f9ba1f95c0399fef2f73af3b06 (diff)
Derive Fl_Zenity_Native_File_Chooser_Driver from Fl_Kdialog_Native_…
Also add Fl::option(OPTION_FNFC_USES_ZENITY)
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl.H3
-rw-r--r--FL/Fl_Native_File_Chooser.H24
2 files changed, 19 insertions, 8 deletions
diff --git a/FL/Fl.H b/FL/Fl.H
index 9eb4a541f..506dc34ce 100644
--- a/FL/Fl.H
+++ b/FL/Fl.H
@@ -272,6 +272,9 @@ public:
/// value.
/// When switched off, no such window gets displayed.
OPTION_SHOW_SCALING,
+ /// Meaningful for the Wayland/X11 platform only. When switched on (default), the library uses a Zenity-based file dialog.
+ /// When switched off, the GTK file dialog is used instead.
+ OPTION_FNFC_USES_ZENITY,
// don't change this, leave it always as the last element
/// For internal use only.
OPTION_LAST
diff --git a/FL/Fl_Native_File_Chooser.H b/FL/Fl_Native_File_Chooser.H
index ab9516f7c..b920a1565 100644
--- a/FL/Fl_Native_File_Chooser.H
+++ b/FL/Fl_Native_File_Chooser.H
@@ -102,15 +102,23 @@ class Fl_Native_File_Chooser_Driver;
to open files with a non-ASCII name).
<B>Platform Specific Caveats</B>
-
- - Under X windows, and if Fl::OPTION_FNFC_USES_GTK has not been switched off,
- the widget attempts to use standard GTK file chooser dialogs if they are
- available at run-time on the platform, and falls back to use FLTK's Fl_File_Chooser if they are not.
- In the first case, calling fl_register_images() adds a "Preview" button to the GTK chooser dialog.
- In the latter case, it's best if you call Fl_File_Icon::load_system_icons()
+
+ - Under X11/Wayland, what dialog opens is determined as follows:
+ -# If command \p zenity is available at run-time and if \p Fl::option(OPTION_FNFC_USES_ZENITY) is
+ not turned off, the \p zenity -based dialog opens. This is expected to be more appropriate
+ than other dialog forms for sandboxed apps.
+ -# Else if the app runs under the KDE desktop and if command \p kdialog is available at run-time
+ and if the library was not built with <tt>cmake -DOPTION_USE_KDIALOG=Off</tt>, the
+ \p kdialog -based dialog opens.
+ -# Else if the GTK library is available at run-time on the computer and if \p Fl::option(OPTION_FNFC_USES_GTK) is
+ not turned off, the GTK-styled dialog opens. Call fl_register_images() to add a "Preview" button to this dialog.
+ Use the static public attributes of class Fl_File_Chooser to localize the browser.
+ -# Otherwise, FLTK's own dialog produced by the Fl_File_Chooser class opens.
+ Call fl_register_images() to add a "Preview" button to it.
+ It's best if you also call Fl_File_Icon::load_system_icons()
at the start of main(), to enable the nicer looking file browser widgets.
- Use the static public attributes of class Fl_File_Chooser to localize
- the browser.
+ Use the static public attributes of class Fl_File_Chooser to localize the browser.
+
- Some operating systems support certain OS specific options; see
Fl_Native_File_Chooser::options() for a list.