Author: AlbrechtS
Date: 2010-12-18 07:31:44 -0800 (Sat, 18 Dec 2010)
New Revision: 8053
Log:
Fixed Fl_Tabs selection border drawing, if tabs are at the bottom of
the widget (STR #2480). Thanks for the patch.


Modified:
   branches/branch-1.3/CHANGES
   branches/branch-1.3/CREDITS
   branches/branch-1.3/src/Fl_Tabs.cxx

Modified: branches/branch-1.3/CHANGES
===================================================================
--- branches/branch-1.3/CHANGES 2010-12-18 08:32:37 UTC (rev 8052)
+++ branches/branch-1.3/CHANGES 2010-12-18 15:31:44 UTC (rev 8053)
@@ -1,5 +1,7 @@
 CHANGES IN FLTK 1.3.0
 
+       - Fixed Fl_Tabs selection border drawing, if tabs are at the bottom
+         of the widget (STR #2480)
        - Much faster fl_read_image() for Windows (STR #2387).
        - Added general Options dialog (STR #2471)
        - Fixed Compiling with mingw-w64 (STR #2308).

Modified: branches/branch-1.3/CREDITS
===================================================================
--- branches/branch-1.3/CREDITS 2010-12-18 08:32:37 UTC (rev 8052)
+++ branches/branch-1.3/CREDITS 2010-12-18 15:31:44 UTC (rev 8053)
@@ -37,6 +37,7 @@
        Paul Chambers
        Stephen Davies
        Yuri D'Elia
+       Domingo Alvarez Duarte
        Greg Ercolano
        Yuri Fedorchenko
        George Garvey

Modified: branches/branch-1.3/src/Fl_Tabs.cxx
===================================================================
--- branches/branch-1.3/src/Fl_Tabs.cxx 2010-12-18 08:32:37 UTC (rev 8052)
+++ branches/branch-1.3/src/Fl_Tabs.cxx 2010-12-18 15:31:44 UTC (rev 8053)
@@ -40,6 +40,7 @@
 
 #define BORDER 2
 #define EXTRASPACE 10
+#define SELECTION_BORDER 5
 
 // return the left edges of each tab (plus a fake left edge for a tab
 // past the right-hand one).  These position are actually of the left
@@ -311,14 +312,11 @@
     draw_box(box(), x(), y()+(H>=0?H:0), w(), h()-(H>=0?H:-H), c);
 
     if (selection_color() != c) {
-      // Draw the top 5 lines of the tab pane in the selection color so
-      // that the user knows which tab is selected...
-      if (H >= 0) fl_push_clip(x(), y() + H, w(), 5);
-      else fl_push_clip(x(), y() + h() - H - 4, w(), 5);
-
-      draw_box(box(), x(), y()+(H>=0?H:0), w(), h()-(H>=0?H:-H),
-               selection_color());
-
+      // Draw the top or bottom SELECTION_BORDER lines of the tab pane in the
+      // selection color so that the user knows which tab is selected...
+      int clip_y = (H >= 0) ? y() + H : y() + h() + H - SELECTION_BORDER;
+      fl_push_clip(x(), clip_y, w(), SELECTION_BORDER);
+      draw_box(box(), x(), clip_y, w(), SELECTION_BORDER, selection_color());
       fl_pop_clip();
     }
     if (v) draw_child(*v);

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to