summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-11-04 11:30:45 +0100
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2023-11-05 19:42:55 +0100
commit0ae927a00e9ecd45a45edf004e939ab2e5ce4813 (patch)
treed2d585d0d6088494b23529fc43dde9a7cdf330b3 /FL
parenta31409f7bbe7db51f63c79b16358d64ae6e2d4bb (diff)
Add Fl_Window::maximize() and Fl_Window::un_maximize()
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_Widget.H2
-rw-r--r--FL/Fl_Window.H8
2 files changed, 9 insertions, 1 deletions
diff --git a/FL/Fl_Widget.H b/FL/Fl_Widget.H
index 3036ea582..55282857a 100644
--- a/FL/Fl_Widget.H
+++ b/FL/Fl_Widget.H
@@ -180,7 +180,7 @@ protected:
IMAGE_BOUND = 1<<21, ///< binding the image to the widget will transfer ownership, so that the widget will delete the image when it is no longer needed
DEIMAGE_BOUND = 1<<22, ///< bind the inactive image to the widget, so the widget deletes the image when it is no longer needed
AUTO_DELETE_USER_DATA = 1<<23, ///< automatically call `delete` on the user_data pointer when destroying this widget; if set, user_data must point to a class derived from the class Fl_Callback_User_Data
-
+ MAXIMIZED = 1<<24, ///< a maximized Fl_Window
// Note to devs: add new FLTK core flags above this line (up to 1<<28).
// Three more flags, reserved for user code
diff --git a/FL/Fl_Window.H b/FL/Fl_Window.H
index 18ff8b201..f0d2f5bb0 100644
--- a/FL/Fl_Window.H
+++ b/FL/Fl_Window.H
@@ -92,6 +92,8 @@ private:
Fl_Window(const Fl_Window&);
Fl_Window& operator=(const Fl_Window&);
+ void is_maximized_(bool b);
+
protected:
/** Stores the last window that was made current. See current() const */
@@ -508,6 +510,12 @@ public:
\see void Fl_Window::fullscreen()
*/
void fullscreen_screens(int top, int bottom, int left, int right);
+
+ void maximize();
+ void un_maximize();
+ /** Returns whether the window is currently maximized */
+ unsigned int maximize_active() const { return flags() & MAXIMIZED; }
+public:
/**
Iconifies the window. If you call this when shown() is false
it will show() it as an icon. If the window is already