diff options
| author | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-01 12:33:11 +0200 |
|---|---|---|
| committer | Albrecht Schlosser <albrechts.fltk@online.de> | 2020-09-01 12:35:48 +0200 |
| commit | b65d3a249d4db1ada6d0bc96031e55459e0d6381 (patch) | |
| tree | cb2d4c2778263df4245b6cb7122ab0bd8826c5c4 /FL | |
| parent | 95799bd3641ebe43400aa85dd8cf84405f26aac8 (diff) | |
Customize corner radius for rounded box/frame (#130)
Make maximum box corner radius and shadow width configurable.
See Fl::box_border_radius_max() and Fl::box_shadow_width().
Documentation: update image of box types.
Fixes #130
Diffstat (limited to 'FL')
| -rw-r--r-- | FL/Fl.H | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -133,6 +133,8 @@ private: static int use_high_res_GL_; static int draw_GL_text_with_textures_; + static int box_shadow_width_; + static int box_border_radius_max_; public: @@ -141,6 +143,34 @@ public: static void reset_marked_text(); // resets marked text static void insertion_point_location(int x, int y, int height); // sets window coordinates & height of insertion point + /** Get the box shadow width of all "shadow" boxtypes in pixels. + \since 1.4.0 + */ + static int box_shadow_width() { return 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 + */ + static void box_shadow_width(int W) { box_shadow_width_ = W < 1 ? 1 : W; } + + /** Get the maximum border radius of all "rounded" boxtypes in pixels. + \since 1.4.0 + */ + static int box_border_radius_max() { return 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 + */ + static void box_border_radius_max(int R) { box_border_radius_max_ = R < 5 ? 5 : R; } + public: // run time information about compile time configuration /** \defgroup cfg_gfx runtime graphics driver configuration */ /** @{ */ |
