diff options
Diffstat (limited to 'src/drivers')
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.H | 5 | ||||
| -rw-r--r-- | src/drivers/Darwin/Fl_Darwin_System_Driver.cxx | 49 |
2 files changed, 7 insertions, 47 deletions
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H index 776f68738..011bea7ff 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H @@ -64,10 +64,7 @@ public: const char *latin1_to_local(const char *t, int n) FL_OVERRIDE; const char *local_to_mac_roman(const char *t, int n) FL_OVERRIDE; const char *mac_roman_to_local(const char *t, int n) FL_OVERRIDE; - Fl_Pixmap *tree_openpixmap() FL_OVERRIDE; - static const char * const tree_open_xpm_darwin[]; // used by tree_openpixmap() - Fl_Pixmap *tree_closepixmap() FL_OVERRIDE; - static const char * const tree_close_xpm_darwin[]; // used by tree_closepixmap() + void tree_draw_expando_button(int x, int y, bool state, bool active) FL_OVERRIDE; int tree_connector_style() FL_OVERRIDE; const char *filename_name(const char *buf) FL_OVERRIDE; void add_fd(int fd, int when, Fl_FD_Handler cb, void* = 0) FL_OVERRIDE; diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index c44ba34c1..9b6a2a694 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -21,6 +21,7 @@ #include <FL/Fl_Tree_Prefs.H> #include <FL/Fl_Pixmap.H> #include <FL/platform.H> +#include <FL/fl_draw.H> #include "../../flstring.h" #include <string.h> #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 @@ -357,50 +358,12 @@ Fl_Sys_Menu_Bar_Driver *Fl_Darwin_System_Driver::sys_menu_bar_driver() return Fl_MacOS_Sys_Menu_Bar_Driver::driver(); } -const char * const Fl_Darwin_System_Driver::tree_open_xpm_darwin[] = { - "11 11 2 1", - ". c None", - "@ c #000000", - "...@.......", - "...@@......", - "...@@@.....", - "...@@@@....", - "...@@@@@...", - "...@@@@@@..", - "...@@@@@...", - "...@@@@....", - "...@@@.....", - "...@@......", - "...@......." -}; - -const char * const Fl_Darwin_System_Driver::tree_close_xpm_darwin[] = { - "11 11 2 1", - ". c None", - "@ c #000000", - "...........", - "...........", - "...........", - "@@@@@@@@@@@", - ".@@@@@@@@@.", - "..@@@@@@@..", - "...@@@@@...", - "....@@@....", - ".....@.....", - "...........", - "..........." -}; - -Fl_Pixmap *Fl_Darwin_System_Driver::tree_openpixmap() { - static Fl_Pixmap *pixmap = new Fl_Pixmap(tree_open_xpm_darwin); - return pixmap; +// Draw Mac-specific Fl_Tree open/close icons +void Fl_Darwin_System_Driver::tree_draw_expando_button(int x, int y, bool state, bool active) { + fl_color(active ? FL_FOREGROUND_COLOR : FL_INACTIVE_COLOR); + if(state) fl_polygon(x + 3, y, x + 3, y + 11, x + 8, y + 5); // right arrow: ▶ + else fl_polygon(x, y + 3, x + 11, y + 3, x + 5, y + 8); // down arrow: ▼ } - -Fl_Pixmap *Fl_Darwin_System_Driver::tree_closepixmap() { - static Fl_Pixmap *pixmap = new Fl_Pixmap(tree_close_xpm_darwin); - return pixmap; -} - int Fl_Darwin_System_Driver::tree_connector_style() { return FL_TREE_CONNECTOR_NONE; } |
