[gtkmm/gtkmm-3-24] Gtk::FileChooserDialog: Allow constructing with use-header-bar



commit 1b1fc7c0ebdeaed9ed2420e6f7461bdf81037c95
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Thu Nov 8 13:17:23 2018 +0100

    Gtk::FileChooserDialog: Allow constructing with use-header-bar
    
    This is a construct-only property, so it must be specified in a constructor.
    Bug #780004 (Daniel Boles)

 gtk/src/filechooserdialog.ccg | 23 +++++++++++++++++++++++
 gtk/src/filechooserdialog.hg  |  7 +++++++
 2 files changed, 30 insertions(+)
---
diff --git a/gtk/src/filechooserdialog.ccg b/gtk/src/filechooserdialog.ccg
index 08b600ec..8e243a95 100644
--- a/gtk/src/filechooserdialog.ccg
+++ b/gtk/src/filechooserdialog.ccg
@@ -35,6 +35,29 @@ FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserActi
 {
 }
 
+FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title,
+  FileChooserAction action, DialogFlags flags)
+:
+  _CONSTRUCT("transient-for", parent.gobj(),
+             "title", title.c_str(),
+             "action", static_cast<GtkFileChooserAction>(action),
+             "use-header-bar", (flags & DIALOG_USE_HEADER_BAR) != 0,
+             "modal", (flags & DIALOG_MODAL) != 0,
+             "destroy-with-parent", (flags & DIALOG_DESTROY_WITH_PARENT) != 0)
+{
+}
+
+FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action,
+  DialogFlags flags)
+:
+  _CONSTRUCT("title", title.c_str(),
+             "action", static_cast<GtkFileChooserAction>(action),
+             "use-header-bar", (flags & DIALOG_USE_HEADER_BAR) != 0,
+             "modal", (flags & DIALOG_MODAL) != 0,
+             "destroy-with-parent", (flags & DIALOG_DESTROY_WITH_PARENT) != 0)
+{
+}
+
 _DEPRECATE_IFDEF_START
 FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action, const 
Glib::ustring& backend)
 :
diff --git a/gtk/src/filechooserdialog.hg b/gtk/src/filechooserdialog.hg
index cc1a26a5..953d5b9a 100644
--- a/gtk/src/filechooserdialog.hg
+++ b/gtk/src/filechooserdialog.hg
@@ -44,6 +44,13 @@ public:
   FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction action = 
FILE_CHOOSER_ACTION_OPEN);
   explicit FileChooserDialog(const Glib::ustring& title, FileChooserAction action = 
FILE_CHOOSER_ACTION_OPEN);
 
+  /** @newin{3,24}
+   */
+  FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction action, DialogFlags 
flags);
+  /** @newin{3,24}
+   */
+  FileChooserDialog(const Glib::ustring& title, FileChooserAction action, DialogFlags flags);
+
 _DEPRECATE_IFDEF_START
   /// @deprecated Use a constructor without the @a backend parameter.
   FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction action, const 
Glib::ustring& backend);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]