summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-02-08 20:59:46 +0000
committerManolo Gouy <Manolo>2011-02-08 20:59:46 +0000
commit5dab14dafa6dba869c55281c214946934eb10aae (patch)
tree10ffe040135c897a376506b6992083e4978beb61
parent95db2790d69fb227e78d307f50c41bdc4bee44d0 (diff)
Fix STR #2558: use more consistently FL_NORMAL_SIZE to define the default font size
of interface elements. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8405 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--FL/Fl_Tooltip.H4
-rw-r--r--src/Fl_File_Chooser2.cxx4
-rw-r--r--src/Fl_Tooltip.cxx4
-rw-r--r--src/fl_ask.cxx11
-rw-r--r--src/fl_font_mac.cxx2
5 files changed, 14 insertions, 11 deletions
diff --git a/FL/Fl_Tooltip.H b/FL/Fl_Tooltip.H
index ef7633c7f..3170fde52 100644
--- a/FL/Fl_Tooltip.H
+++ b/FL/Fl_Tooltip.H
@@ -3,7 +3,7 @@
//
// Tooltip header file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2011 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -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() { return (size_ == -1 ? FL_NORMAL_SIZE : 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 --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index 821126caa..7b9105e00 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -3,7 +3,7 @@
//
// More Fl_File_Chooser routines.
//
-// Copyright 1999-2010 by Michael Sweet.
+// Copyright 1999-2011 by Michael Sweet.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -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 --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx
index f91d9dcbc..2c76d0280 100644
--- a/src/Fl_Tooltip.cxx
+++ b/src/Fl_Tooltip.cxx
@@ -3,7 +3,7 @@
//
// Tooltip source file for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2011 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -39,7 +39,7 @@ Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
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
diff --git a/src/fl_ask.cxx b/src/fl_ask.cxx
index 98bbf3e10..e01b25845 100644
--- a/src/fl_ask.cxx
+++ b/src/fl_ask.cxx
@@ -3,7 +3,7 @@
//
// Standard dialog functions for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2011 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -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_list ap,
}
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 --git a/src/fl_font_mac.cxx b/src/fl_font_mac.cxx
index 5863b233c..b69260808 100644
--- a/src/fl_font_mac.cxx
+++ b/src/fl_font_mac.cxx
@@ -31,7 +31,7 @@
extern unsigned fl_utf8toUtf16(const char* src, unsigned srclen, unsigned short* dst, unsigned dstlen);
// if no font has been selected yet by the user, get one.
-#define check_default_font() {if (!fl_fontsize) fl_font(0, 12);}
+#define check_default_font() {if (!fl_fontsize) fl_font(FL_HELVETICA, FL_NORMAL_SIZE);}
static CGAffineTransform font_mx = { 1, 0, 0, -1, 0, 0 };
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5