Update Fl_Tabs to draw selected tabs using labelcolor() of the Fl_Tabs

widget instead of using fl_contrast.

Draw round plastic buttons round...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4357 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2005-05-19 12:13:35 +00:00
parent 6f946ecfc5
commit 296efbe092
3 changed files with 15 additions and 21 deletions

View File

@ -288,16 +288,13 @@ 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(), W, H, c);
// Make sure that the label contrasts the tab color...
c = fl_contrast(o->labelcolor(), c);
draw_box(box(), x1, y(), W, H + 10, c);
// Save the previous label color
Fl_Color oc = o->labelcolor();
// Draw the label using the contrast color...
o->labelcolor(c);
// Draw the label using the current color...
o->labelcolor(sel ? labelcolor() : o->labelcolor());
o->draw_label(x1, y(), W, H, FL_ALIGN_CENTER);
// Restore the original label color...
@ -317,16 +314,13 @@ 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, W, H, c);
// Make sure that the label contrasts the tab color...
c = fl_contrast(o->labelcolor(), c);
draw_box(box(), x1, y() + h() - H - 10, W, H + 10, c);
// Save the previous label color
Fl_Color oc = o->labelcolor();
// Draw the label using the contrast color...
o->labelcolor(c);
// Draw the label using the current color...
o->labelcolor(sel ? labelcolor() : o->labelcolor());
o->draw_label(x1, y() + h() - H, W, H, FL_ALIGN_CENTER);
// Restore the original label color...

View File

@ -267,8 +267,8 @@ static void thin_up_box(int x, int y, int w, int h, Fl_Color c) {
static void up_round(int x, int y, int w, int h, Fl_Color c) {
if (w != h) up_box(x, y, w, h, c);
else {
shade_round(x + 1, y + 1, w - 2, h - 3, "RVQNOPQRSTUVWVQ", c);
frame_round(x, y, w, h - 1, "IJLM", c);
shade_round(x + 1, y + 1, w - 2, h - 2, "RVQNOPQRSTUVWVQ", c);
frame_round(x, y, w, h, "IJLM", c);
}
}
@ -287,8 +287,8 @@ static void down_box(int x, int y, int w, int h, Fl_Color c) {
static void down_round(int x, int y, int w, int h, Fl_Color c) {
if (w != h) down_box(x, y, w, h, c);
else {
shade_round(x + 2, y + 2, w - 4, h - 5, "STUVWWWVT", c);
frame_round(x, y, w, h - 1, "MLJI", c);
shade_round(x + 2, y + 2, w - 4, h - 4, "STUVWWWVT", c);
frame_round(x, y, w, h, "MLJI", c);
}
}

View File

@ -1,14 +1,14 @@
# data file for the Fltk User Interface Designer (fluid)
version 1.0100
version 1.0107
header_name {.h}
code_name {.cxx}
Function {} {open
} {
Fl_Window foo_window {open
xywh {733 489 321 324} resizable visible
xywh {733 489 320 320} type Double resizable visible
} {
Fl_Tabs {} {open
xywh {10 10 300 200} selection_color 7 resizable
Fl_Tabs {} {open selected
xywh {10 10 300 200} selection_color 4 labelcolor 7 resizable
} {
Fl_Group {} {
label Label1 open
@ -48,7 +48,7 @@ Function {} {open
}
Fl_Button {} {
label {Test event blocking by modal window}
callback {fl_message("Make sure you cannot change the tabs while this modal window is up");} selected
callback {fl_message("Make sure you cannot change the tabs while this modal window is up");}
xywh {30 170 260 30}
code0 {\#include <FL/fl_ask.H>}
}