From f814ef6056d4d663772b3bfa0cad6e5b4aefb1b5 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 8 Apr 2003 13:10:34 +0000 Subject: Beter attempt at drawing corner between scrollbars. Still fails but doesn't overdraw vertical scroll bar when horizontal scroll bar turned off. --- gtk/ScintillaGTK.cxx | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 70b790c80..1ce0ba526 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -1160,10 +1160,10 @@ void ScintillaGTK::Resize(int width, int height) { // These allocations should never produce negative sizes as they would wrap around to huge // unsigned numbers inside GTK+ causing warnings. bool showSBHorizontal = horizontalScrollBarVisible && (wrapState == eWrapNone); - int horizontalScrollBarHeight = scrollBarWidth; + int horizontalScrollBarHeight = scrollBarHeight; if (!showSBHorizontal) horizontalScrollBarHeight = 0; - int verticalScrollBarHeight = scrollBarHeight; + int verticalScrollBarHeight = scrollBarWidth; if (!verticalScrollBarVisible) verticalScrollBarHeight = 0; @@ -1573,14 +1573,19 @@ gint ScintillaGTK::Expose(GtkWidget *, GdkEventExpose *ose) { Surface *surfaceWindow = Surface::Allocate(); if (surfaceWindow) { surfaceWindow->Init(PWidget(wMain)->window, PWidget(wMain)); + // Fill the corner between the scrollbars - PRectangle rcCorner = wMain.GetClientPosition(); - if (verticalScrollBarVisible) - rcCorner.left = rcCorner.right - scrollBarWidth + 1; - if (horizontalScrollBarVisible && (wrapState == eWrapNone)) - rcCorner.top = rcCorner.bottom - scrollBarHeight + 1; - surfaceWindow->FillRectangle(rcCorner, - vs.styles[STYLE_LINENUMBER].back.allocated); + if (verticalScrollBarVisible) { + if (horizontalScrollBarVisible && (wrapState == eWrapNone)) { + PRectangle rcCorner = wMain.GetClientPosition(); + rcCorner.left = rcCorner.right - scrollBarWidth + 1; + rcCorner.top = rcCorner.bottom - scrollBarHeight + 1; + //fprintf(stderr, "Corner %0d,%0d %0d,%0d\n", + //rcCorner.left, rcCorner.top, rcCorner.right, rcCorner.bottom); + surfaceWindow->FillRectangle(rcCorner, + vs.styles[STYLE_LINENUMBER].back.allocated); + } + } Paint(surfaceWindow, rcPaint); surfaceWindow->Release(); -- cgit v1.2.3