aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx26
1 files changed, 15 insertions, 11 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 59e4e7ab7..04eea0ea5 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -306,21 +306,25 @@ static const char *ControlCharacterString(unsigned char ch) {
}
}
-static void DrawTabArrow(Surface *surface, PRectangle rcTab, int ymid) {
- int ydiff = static_cast<int>(rcTab.bottom - rcTab.top) / 2;
- int xhead = static_cast<int>(rcTab.right) - 1 - ydiff;
- if (xhead <= rcTab.left) {
- ydiff -= static_cast<int>(rcTab.left) - xhead - 1;
- xhead = static_cast<int>(rcTab.left) - 1;
- }
+static void DrawTabArrow(Surface *surface, PRectangle rcTab, int ymid, const ViewStyle &vsDraw) {
if ((rcTab.left + 2) < (rcTab.right - 1))
surface->MoveTo(static_cast<int>(rcTab.left) + 2, ymid);
else
surface->MoveTo(static_cast<int>(rcTab.right) - 1, ymid);
surface->LineTo(static_cast<int>(rcTab.right) - 1, ymid);
- surface->LineTo(xhead, ymid - ydiff);
- surface->MoveTo(static_cast<int>(rcTab.right) - 1, ymid);
- surface->LineTo(xhead, ymid + ydiff);
+
+ // Draw the arrow head if needed
+ if (vsDraw.tabDrawMode == tdLongArrow) {
+ int ydiff = static_cast<int>(rcTab.bottom - rcTab.top) / 2;
+ int xhead = static_cast<int>(rcTab.right) - 1 - ydiff;
+ if (xhead <= rcTab.left) {
+ ydiff -= static_cast<int>(rcTab.left) - xhead - 1;
+ xhead = static_cast<int>(rcTab.left) - 1;
+ }
+ surface->LineTo(xhead, ymid - ydiff);
+ surface->MoveTo(static_cast<int>(rcTab.right) - 1, ymid);
+ surface->LineTo(xhead, ymid + ydiff);
+ }
}
void EditView::RefreshPixMaps(Surface *surfaceWindow, WindowID wid, const ViewStyle &vsDraw) {
@@ -1579,7 +1583,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
PRectangle rcTab(rcSegment.left + 1, rcSegment.top + tabArrowHeight,
rcSegment.right - 1, rcSegment.bottom - vsDraw.maxDescent);
if (customDrawTabArrow == NULL)
- DrawTabArrow(surface, rcTab, static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2));
+ DrawTabArrow(surface, rcTab, static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2), vsDraw);
else
customDrawTabArrow(surface, rcTab, static_cast<int>(rcSegment.top + vsDraw.lineHeight / 2));
}