DO NOT REPLY TO THIS MESSAGE. INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.
[STR New]
Link: http://www.fltk.org/str.php?L2558
Version: 1.3-current
Some time ago, FL_NORMAL_SIZE was changed from a normal constant into a
variable so that you could override the default font size (which you
_really_ want as the default is a bit large compared to other toolkits).
Unfortunately there were a few places that were overlooked. Prominently
the fl_ask stuff and the tooltips.
Attached patch fixes up those missing parts.
Because of the way Fl_Tooltip is implemented, this involves an ABI change.
So it would be nice if this could be fixed before 1.3.0 is released.
Link: http://www.fltk.org/str.php?L2558
Version: 1.3-current
diff -up fltk-1.3.x-r8365/FL/Fl_Tooltip.H.orig fltk-1.3.x-r8365/FL/Fl_Tooltip.H
--- fltk-1.3.x-r8365/FL/Fl_Tooltip.H.orig 2011-02-08 17:17:36.569519069
+0100
+++ fltk-1.3.x-r8365/FL/Fl_Tooltip.H 2011-02-08 17:17:40.790215898 +0100
@@ -72,7 +72,7 @@ public:
/** Sets the typeface for the tooltip text. */
static void font(Fl_Font i) { font_ = i; }
/** Gets the size of the tooltip text. */
- static Fl_Fontsize size() { return size_; }
+ static Fl_Fontsize size() { if (size_ == -1) return FL_NORMAL_SIZE; return
size_; }
/** Sets the size of the tooltip text. */
static void size(Fl_Fontsize s) { size_ = s; }
/** Gets the background color for tooltips. The default background color is
a pale yellow. */
diff -up fltk-1.3.x-r8365/src/fl_ask.cxx.orig fltk-1.3.x-r8365/src/fl_ask.cxx
--- fltk-1.3.x-r8365/src/fl_ask.cxx.orig 2011-02-08 17:02:42.042811694
+0100
+++ fltk-1.3.x-r8365/src/fl_ask.cxx 2011-02-08 17:09:10.436946779 +0100
@@ -55,7 +55,7 @@ static Fl_Input *input;
static int ret_val;
static const char *iconlabel = "?";
Fl_Font fl_message_font_ = FL_HELVETICA;
-Fl_Fontsize fl_message_size_ = 14;
+Fl_Fontsize fl_message_size_ = -1;
#ifdef __APPLE__
extern "C" void NSBeep(void);
#endif
@@ -127,7 +127,7 @@ void resizeform() {
int x, w, h, max_w, max_h;
const int icon_size = 50;
- fl_font(fl_message_font_, fl_message_size_);
+ fl_font(message->labelfont(), message->labelsize());
message_w = message_h = 0;
fl_measure(message->label(), message_w, message_h);
@@ -211,7 +211,10 @@ static int innards(const char* fmt, va_l
}
message->labelfont(fl_message_font_);
- message->labelsize(fl_message_size_);
+ if (fl_message_size_ == -1)
+ message->labelsize(FL_NORMAL_SIZE);
+ else
+ message->labelsize(fl_message_size_);
if (b0) {button[0]->show(); button[0]->label(b0);
button[1]->position(210,70);}
else {button[0]->hide(); button[1]->position(310,70);}
if (b1) {button[1]->show(); button[1]->label(b1);}
diff -up fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx.orig
fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx
--- fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx.orig 2011-02-08
17:11:05.696980005 +0100
+++ fltk-1.3.x-r8365/src/Fl_File_Chooser2.cxx 2011-02-08 17:11:09.121545514
+0100
@@ -1410,7 +1410,7 @@ Fl_File_Chooser::update_preview()
// Show the first 1k of text...
int size = previewBox->h() / 20;
if (size < 6) size = 6;
- else if (size > 14) size = 14;
+ else if (size > FL_NORMAL_SIZE) size = FL_NORMAL_SIZE;
previewBox->label(preview_text_);
previewBox->align((Fl_Align)(FL_ALIGN_CLIP | FL_ALIGN_INSIDE |
diff -up fltk-1.3.x-r8365/src/fl_font_x.cxx.orig
fltk-1.3.x-r8365/src/fl_font_x.cxx
--- fltk-1.3.x-r8365/src/fl_font_x.cxx.orig 2011-02-08 17:13:13.214037502
+0100
+++ fltk-1.3.x-r8365/src/fl_font_x.cxx 2011-02-08 17:13:19.987155982 +0100
@@ -320,7 +320,7 @@ void fl_text_extents(const char *c, int
void Fl_Xlib_Graphics_Driver::draw(const char* c, int n, int x, int y) {
if (font_gc != fl_gc) {
- if (!current_font) fl_font(FL_HELVETICA, 14);
+ if (!current_font) fl_font(FL_HELVETICA, FL_NORMAL_SIZE);
font_gc = fl_gc;
XSetFont(fl_display, fl_gc, current_font->fid);
}
diff -up fltk-1.3.x-r8365/src/fl_font_xft.cxx.orig
fltk-1.3.x-r8365/src/fl_font_xft.cxx
--- fltk-1.3.x-r8365/src/fl_font_xft.cxx.orig 2011-02-08 17:13:05.014683493
+0100
+++ fltk-1.3.x-r8365/src/fl_font_xft.cxx 2011-02-08 17:13:06.734967573
+0100
@@ -588,7 +588,7 @@ void fl_destroy_xft_draw(Window id) {
void Fl_Xlib_Graphics_Driver::draw(const char *str, int n, int x, int y) {
if ( !current_font ) {
- fl_font(FL_HELVETICA, 14);
+ fl_font(FL_HELVETICA, FL_NORMAL_SIZE);
}
#if USE_OVERLAY
XftDraw*& draw_ = fl_overlay ? draw_overlay : ::draw_;
diff -up fltk-1.3.x-r8365/src/Fl_Tooltip.cxx.orig
fltk-1.3.x-r8365/src/Fl_Tooltip.cxx
--- fltk-1.3.x-r8365/src/Fl_Tooltip.cxx.orig 2011-02-08 17:18:03.193914697
+0100
+++ fltk-1.3.x-r8365/src/Fl_Tooltip.cxx 2011-02-08 17:18:24.696464727 +0100
@@ -39,7 +39,7 @@ Fl_Color Fl_Tooltip::color_ = fl_color_c
FL_NUM_BLUE - 2);
Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK;
Fl_Font Fl_Tooltip::font_ = FL_HELVETICA;
-Fl_Fontsize Fl_Tooltip::size_ = FL_NORMAL_SIZE;
+Fl_Fontsize Fl_Tooltip::size_ = -1;
#define MAX_WIDTH 400
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs