I changed the Fl_Tabs drawing routine to only redraw the tabs themsleves on a PUSH event, instead of the whole current group. This also allows for a visual feedback from the clicked tab. (str #1520)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5629 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
parent
30be5f711b
commit
9e79fd13d2
1
CHANGES
1
CHANGES
@ -1,5 +1,6 @@
|
||||
CHANGES IN FLTK 1.1.8
|
||||
|
||||
- Optimized Fl_Tabs drawing for speed (STR #1520)
|
||||
- OS X resource fork now obsolete (STR #1453)
|
||||
- Added chapter 10 about multithreading (STR #1532,
|
||||
1533)
|
||||
|
@ -225,7 +225,7 @@ int Fl_Tabs::handle(int event) {
|
||||
int Fl_Tabs::push(Fl_Widget *o) {
|
||||
if (push_ == o) return 0;
|
||||
if (push_ && !push_->visible() || o && !o->visible())
|
||||
redraw();
|
||||
redraw_tabs();
|
||||
push_ = o;
|
||||
return 1;
|
||||
}
|
||||
@ -309,6 +309,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
|
||||
int sel = (what == SELECTED);
|
||||
int dh = Fl::box_dh(box());
|
||||
int dy = Fl::box_dy(box());
|
||||
Fl_Boxtype bt = (o==push_ &&!sel) ? fl_down(box()) : box();
|
||||
|
||||
// compute offsets to make selected tab look bigger
|
||||
int yofs = sel ? 0 : BORDER;
|
||||
@ -323,7 +324,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
|
||||
|
||||
Fl_Color c = sel ? selection_color() : o->selection_color();
|
||||
|
||||
draw_box(box(), x1, y() + yofs, W, H + 10 - yofs, c);
|
||||
draw_box(bt, x1, y() + yofs, W, H + 10 - yofs, c);
|
||||
|
||||
// Save the previous label color
|
||||
Fl_Color oc = o->labelcolor();
|
||||
@ -349,7 +350,7 @@ void Fl_Tabs::draw_tab(int x1, int x2, int W, int H, Fl_Widget* o, int what) {
|
||||
|
||||
Fl_Color c = sel ? selection_color() : o->selection_color();
|
||||
|
||||
draw_box(box(), x1, y() + h() - H - 10, W, H + 10 - yofs, c);
|
||||
draw_box(bt, x1, y() + h() - H - 10, W, H + 10 - yofs, c);
|
||||
|
||||
// Save the previous label color
|
||||
Fl_Color oc = o->labelcolor();
|
||||
|
Loading…
x
Reference in New Issue
Block a user