Use fltk 1.3's ability to draw rotated text

This removes a huge and quite obsolete kludge that worked with
X bitmap fonts only. Looks a lot nicer.
This commit is contained in:
Bill Spitzak
2014-11-26 18:20:35 -08:00
parent 11e88c7fc9
commit 3938480dc1
5 changed files with 9 additions and 587 deletions

14
Frame.C
View File

@ -7,8 +7,6 @@
#include <string.h>
#include <stdio.h>
#include <FL/fl_draw.H>
#include "Rotated.H"
static Atom wm_state = 0;
static Atom wm_change_state;
@ -1257,6 +1255,7 @@ void Frame::draw() {
fl_frame("AAAAWWJJTTNN",0,0,w(),h());
#endif
if (!flag(THIN_BORDER) && label_h > 3) {
fl_push_clip(1, label_y, left, label_h);
#ifdef SHOW_CLOCK
if (active()) {
int clkw = int(fl_width(clock_buf));
@ -1275,8 +1274,9 @@ void Frame::draw() {
// and the window height is short enough. For now, we'll
// assume this is not enough of a problem to be concerned
// about.
draw_rotated90(clock_buf, 1, label_y+3, left-1, label_h-6,
Fl_Align(FL_ALIGN_BOTTOM|FL_ALIGN_CLIP));
fl_draw(90, clock_buf,
(left + fl_height() + 1)/2 - fl_descent(),
label_y+label_h-3);
} else
// Only show the clock on the active frame.
XClearArea(fl_display, fl_xid(this), 1, label_y+3,
@ -1284,8 +1284,10 @@ void Frame::draw() {
#endif
fl_color(labelcolor());
fl_font(TITLE_FONT_SLOT, TITLE_FONT_SIZE);
draw_rotated90(label(), 1, label_y+3, left-1, label_h-3,
Fl_Align(FL_ALIGN_TOP|FL_ALIGN_CLIP));
fl_draw(90, label(),
(left + fl_height() + 1)/2 - fl_descent(),
label_y+3+fl_width(label()));
fl_pop_clip();
}
}
}