diff options
| author | Matthias Melcher <git@matthiasm.com> | 2019-02-02 23:22:40 +0100 |
|---|---|---|
| committer | Matthias Melcher <git@matthiasm.com> | 2019-02-02 23:22:40 +0100 |
| commit | f4dd9c51993a0ea0141a6663d55b4c08d3506390 (patch) | |
| tree | 0b64f93d86605f85653782d8cc20c855e414aa4e /fluid | |
| parent | c97990e517adca2d0a8c287bddbdd4761f5965f2 (diff) | |
Added widget visibilit indicator to Fluid (STR #2669).
Diffstat (limited to 'fluid')
| -rw-r--r-- | fluid/Fl_Type.cxx | 8 | ||||
| -rw-r--r-- | fluid/Fl_Widget_Type.cxx | 5 | ||||
| -rw-r--r-- | fluid/pixmaps/invisible.xpm | 29 |
3 files changed, 40 insertions, 2 deletions
diff --git a/fluid/Fl_Type.cxx b/fluid/Fl_Type.cxx index 7c7e96235..f8cdfa121 100644 --- a/fluid/Fl_Type.cxx +++ b/fluid/Fl_Type.cxx @@ -41,10 +41,12 @@ #include <FL/Fl_Pixmap.H> #include "pixmaps/lock.xpm" #include "pixmaps/protected.xpm" +#include "pixmaps/invisible.xpm" //#include "pixmaps/unlock.xpm" static Fl_Pixmap lock_pixmap(lock_xpm); -static Fl_Pixmap protected_pixmap(protected_xpm); +static Fl_Pixmap protected_pixmap(protected_xpm); +static Fl_Pixmap invisible_pixmap(invisible_xpm); //static Fl_Pixmap unlock_pixmap(unlock_xpm); #include "pixmaps/flWindow.xpm" @@ -389,6 +391,10 @@ void Widget_Browser::item_draw(void *v, int X, int Y, int, int) const { case 0: lock_pixmap.draw(X - 17, Y); break; case 2: protected_pixmap.draw(X - 17, Y); break; } + + if (l->is_widget() && ((Fl_Widget_Type*)l)->o && !((Fl_Widget_Type*)l)->o->visible()) { + invisible_pixmap.draw(X - 17, Y); + } // Indent=12 per level: Now write the text that comes after the graphics representation Y += comment_incr; diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 2123074c4..655aa7257 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -940,7 +940,10 @@ void visible_cb(Fl_Light_Button* i, void* v) { } } } - if (mod) set_modflag(1); + if (mod) { + set_modflag(1); + redraw_browser(); + } } } diff --git a/fluid/pixmaps/invisible.xpm b/fluid/pixmaps/invisible.xpm new file mode 100644 index 000000000..7a5fa216a --- /dev/null +++ b/fluid/pixmaps/invisible.xpm @@ -0,0 +1,29 @@ +/* XPM */ +static const char *invisible_xpm[] = { +/* width height ncolors chars_per_pixel */ +"16 16 6 1", +/* colors */ +"` c #000000", +"a c #80c080", +"b c #c0ffc0", +"c c none", +"M c #e0e0e0", +"e c #408040", +/* pixels */ +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"cccccccccccccccc", +"ccMMMccccccccccc", +"ccM`Mccccccccccc", +"MMMMMccccccccccc", +"M```Mccccccccccc", +"MMM`Mccccccccccc", +"ccM`Mccccccccccc", +"MMM`MMMccccccccc", +"M`````Mccccccccc", +"MMMMMMMccccccccc", +"cccccccccccccccc" +}; |
