FLTK logo

STR #2062

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Return to Bugs & Features | Roadmap 2.0 | Post Text | Post File | SVN ⇄ GIT ]

STR #2062

Application:FLTK Library
Status:5 - New
Priority:3 - Moderate, e.g. unable to compile the software
Scope:3 - Applies to all machines and operating systems
Subsystem:Unassigned
Summary:Zero height tabs show white label text
Version:2.0-current
Created By:johannes.hofmann.gmx
Assigned To:Unassigned
Fix Version:Unassigned
Update Notification:

Receive EMails Don't Receive EMails

Trouble Report Files:

Post File ]
Name/Time/Date Filename/Size  
 
#1 johannes.hofmann.gmx
11:26 Oct 11, 2008
white_letters.png
26k
 
     

Trouble Report Comments:

Post Text ]
Name/Time/Date Text  
 
#1 johannes.hofmann.gmx
11:26 Oct 11, 2008
In a TabGroup we resize the child widget - if it's the only one - to the
full size of the TabGroup to save screen space.
As soon as there are more than one child widgets we resize back
to make the tabs visible.
This works fine, but somtimes when there is just one child widget,
its label text is partly visible in white (see attached screenshot).
The little patch below modifies TabGroup to not draw tabs in case that they
have zero height.

--- src/TabGroup.cxx.orig 2008-10-11 20:09:06 +0200
+++ src/TabGroup.cxx 2008-10-11 20:09:44 +0200
@@ -411,7 +411,7 @@ void TabGroup::draw_tab_background()
 }
 
 void TabGroup::draw_tab(int x1, int x2, int W, int H, Widget* o, int what) {
-  if (x2 <= x1) return; // ignore ones shrunk to zero width
+  if (x2 <= x1 || H <= 0) return; // ignore ones shrunk to zero width or height
   bool drawlabel = true;
   if (x2 < x1+W) {
     if (x2 <= x1+pager_->slope()) drawlabel = false;
 
 
#2 AlbrechtS
03:51 Jan 28, 2009
I just looked at the source file, and I saw that the provided patch is definitely wrong, because H _may_ be negative for tabs at the bottom of the TabGroup area. The following slightly modified patch might be okay:

--- src/TabGroup.cxx.orig 2008-10-11 20:09:06 +0200
+++ src/TabGroup.cxx 2008-10-11 20:09:44 +0200
@@ -411,7 +411,7 @@ void TabGroup::draw_tab_background()
 }
 
 void TabGroup::draw_tab(int x1, int x2, int W, int H, Widget* o, int what) {
-  if (x2 <= x1) return; // ignore ones shrunk to zero width
+  if (x2 <= x1 || H == 0) return; // ignore ones shrunk to zero width or height
   bool drawlabel = true;
   if (x2 < x1+W) {
     if (x2 <= x1+pager_->slope()) drawlabel = false;


I'm not sure if it's really the correct patch, however, and therefore I recommend setting the label text to an empty label as a workaround, if possible.
 
     

Return to Bugs & Features | Post Text | Post File ]

 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.