diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-05-27 11:34:34 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2024-05-27 11:39:27 +0200 |
| commit | f3f69b892d0755d3674502e1de8cd7c4abb43755 (patch) | |
| tree | bf393458e8cbd93aaccf80399575234e040309b1 /src/drivers/Cocoa | |
| parent | c1333a2dec3616dbd6a53089885b48aee1d11a8d (diff) | |
Remove useless Fl_Window_Driver accessors after new member Fl_Window::get_size_range()
Diffstat (limited to 'src/drivers/Cocoa')
| -rw-r--r-- | src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 8e52988c9..15983032f 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -89,23 +89,26 @@ void Fl_Cocoa_Window_Driver::draw_end() { // on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right // corner. This code draws a little ribbed triangle for dragging. - if (fl_mac_os_version < 100700 && !parent() && is_resizable() && - (!size_range_set() || minh() != maxh() || minw() != maxw())) { - int dx = Fl::box_dw(pWindow->box())-Fl::box_dx(pWindow->box()); - int dy = Fl::box_dh(pWindow->box())-Fl::box_dy(pWindow->box()); - if (dx<=0) dx = 1; - if (dy<=0) dy = 1; - int x1 = w()-dx-1, x2 = x1, y1 = h()-dx-1, y2 = y1; - Fl_Color c[4] = { - pWindow->color(), - fl_color_average(pWindow->color(), FL_WHITE, 0.7f), - fl_color_average(pWindow->color(), FL_BLACK, 0.6f), - fl_color_average(pWindow->color(), FL_BLACK, 0.8f), - }; - int i; - for (i=dx; i<12; i++) { - fl_color(c[i&3]); - fl_line(x1--, y1, x2, y2--); + if (fl_mac_os_version < 100700 && !parent() && is_resizable()) { + int minw, minh, maxw, maxh, set; + set = pWindow->get_size_range(&minw, &minh, &maxw, &maxh, NULL, NULL, NULL); + if (!set || minh != maxh || minw != maxw) { + int dx = Fl::box_dw(pWindow->box())-Fl::box_dx(pWindow->box()); + int dy = Fl::box_dh(pWindow->box())-Fl::box_dy(pWindow->box()); + if (dx<=0) dx = 1; + if (dy<=0) dy = 1; + int x1 = w()-dx-1, x2 = x1, y1 = h()-dx-1, y2 = y1; + Fl_Color c[4] = { + pWindow->color(), + fl_color_average(pWindow->color(), FL_WHITE, 0.7f), + fl_color_average(pWindow->color(), FL_BLACK, 0.6f), + fl_color_average(pWindow->color(), FL_BLACK, 0.8f), + }; + int i; + for (i=dx; i<12; i++) { + fl_color(c[i&3]); + fl_line(x1--, y1, x2, y2--); + } } } # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 |
