summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2014-01-21 10:22:53 +0000
committerManolo Gouy <Manolo>2014-01-21 10:22:53 +0000
commitc4576badb8c5a84829ba85f10330e1435c28b559 (patch)
treeea3c03ef3704b22b667d6ecfe8255cd8aacfce28 /src
parent9ba8793018114e7625ba27bfb25486a66b020977 (diff)
Mac OS: improved window printing when window title is longer than the window width.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10073 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 06dcdc378..5e2c38282 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -3457,7 +3457,12 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset)
if (title) { // print the window title
fl_font(FL_HELVETICA, 14); // the exact font is LucidaGrande 13 pts
fl_color(FL_BLACK);
- fl_draw(title, x_offset+win->w()/2-fl_width(title)/2, y_offset+bt/2+4);
+ const int skip = 68; // about the width of the zone of the 3 window control buttons
+ int x = x_offset + win->w()/2 - fl_width(title)/2;
+ if (x < x_offset+skip) x = x_offset+skip;
+ fl_push_clip(x_offset, y_offset, win->w(), bt);
+ fl_draw(title, x, y_offset+bt/2+4);
+ fl_pop_clip();
}
this->print_widget(win, x_offset, y_offset + bt); // print the window inner part
}