diff options
| author | Matthias Melcher <github@matthiasm.com> | 2025-11-16 01:58:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-16 01:58:54 +0100 |
| commit | 646bd5576497078f327f931ac5b5452d24866d2a (patch) | |
| tree | 7a6060bc43cd9443639e8f3069151e224f918aa9 /src/fl_boxtype.cxx | |
| parent | 9afe9400bd8ce79f1c96b856539d91887e0d2bb1 (diff) | |
Refactor large static class Fl into an expandable namespace Fl (#1325)
* Change class Fl into namespace Fl.
* Untangle Fl namespace into themed headers.
* cut line count of FL/Fl.H in half
* FL/core subdirectory now holds short headers
grouped by functionality.
Diffstat (limited to 'src/fl_boxtype.cxx')
| -rw-r--r-- | src/fl_boxtype.cxx | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/src/fl_boxtype.cxx b/src/fl_boxtype.cxx index a78c74b4a..1569e58bd 100644 --- a/src/fl_boxtype.cxx +++ b/src/fl_boxtype.cxx @@ -23,7 +23,7 @@ // boxtypes. Other box types are in separate files so they are not // linked in if not used. -#include <FL/Fl.H> +#include "src/Fl_Private.H" #include <FL/Fl_Widget.H> #include <FL/fl_draw.H> #include <config.h> @@ -46,8 +46,47 @@ static const uchar inactive_ramp[24] = { 51, 51, 52, 52}; static int draw_it_active = 1; -int Fl::box_border_radius_max_ = 15; -int Fl::box_shadow_width_ = 3; +int Fl::Private::box_border_radius_max_ = 15; + +/** Get the maximum border radius of all "rounded" boxtypes in pixels. + \since 1.4.0 +*/ +int Fl::box_border_radius_max() { + return Private::box_border_radius_max_; +} + +/** Set the maximum border radius of all "rounded" boxtypes in pixels. + Must be at least 5, default = 15. + + \note This does \b not apply to the "round" boxtypes which have really round sides + (i.e. composed of half circles) as opposed to "rounded" boxtypes that have only + rounded corners with a straight border between corners. + + The box border radius of "rounded" boxtypes is typically calculated as about 2/5 of + the box height or width, whichever is smaller. The upper limit can be set by this + method for all "rounded" boxtypes. + \since 1.4.0 +*/ +void Fl::box_border_radius_max(int R) { + Private::box_border_radius_max_ = R < 5 ? 5 : R; +} + +int Fl::Private::box_shadow_width_ = 3; + +/** Get the box shadow width of all "shadow" boxtypes in pixels. + \since 1.4.0 +*/ +int Fl::box_shadow_width() { + return Private::box_shadow_width_; +} + +/** Set the box shadow width of all "shadow" boxtypes in pixels. + Must be at least 1, default = 3. There is no upper limit. + \since 1.4.0 +*/ +void Fl::box_shadow_width(int W) { + Private::box_shadow_width_ = W < 1 ? 1 : W; +} /** Determines if the currently drawn box is active or inactive. |
