Discussion:
Scrollbar background redraw on qt
John Ehresman
2013-10-30 14:59:10 UTC
Permalink
Under some qt styles / themes the background of scrollbars aren't
redrawn, leaving whatever was previously drawn in the window to appear
to be "under" the bar. The following seems to fix it:

--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp Thu Oct 17
14:46:43 2013 -0400
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp Tue Oct 29
20:46:00 2013 -0400
@@ -41,7 +41,7 @@
setFrameStyle(QFrame::NoFrame);
setFocusPolicy(Qt::StrongFocus);
setAttribute(Qt::WA_StaticContents);
- setAttribute(Qt::WA_OpaquePaintEvent);
+ viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_KeyCompression);
setAttribute(Qt::WA_InputMethodEnabled);

I tried commenting out the PartialPaint call in the paintEvent method
and no background (or foreground) is drawn so it doesn't look like this
will introduce flickering from the background being drawn before the
text is drawn.

Thanks,

John
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Jason Haslam
2013-10-30 16:59:32 UTC
Permalink
--- a/qt/ScintillaEditBase/ScintillaEditBase.cpp Thu Oct 17 14:46:43 2013 -0400
+++ b/qt/ScintillaEditBase/ScintillaEditBase.cpp Tue Oct 29 20:46:00 2013 -0400
@@ -41,7 +41,7 @@
setFrameStyle(QFrame::NoFrame);
setFocusPolicy(Qt::StrongFocus);
setAttribute(Qt::WA_StaticContents);
- setAttribute(Qt::WA_OpaquePaintEvent);
+ viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
setAttribute(Qt::WA_KeyCompression);
setAttribute(Qt::WA_InputMethodEnabled);
I tried commenting out the PartialPaint call in the paintEvent method and no background (or foreground) is drawn so it doesn't look like this will introduce flickering from the background being drawn before the text is drawn.
This looks good to me FWIW.

Jason
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-10-30 22:34:53 UTC
Permalink
Post by Jason Haslam
This looks good to me FWIW.
Thanks, its helpful to receive confirmations.

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Neil Hodgson
2013-10-30 22:31:54 UTC
Permalink
Committed as
http://sourceforge.net/p/scintilla/code/ci/b19a011031ebdb39f786e45681580a7af65ba037/

Neil
--
You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+***@googlegroups.com.
To post to this group, send email to scintilla-***@googlegroups.com.
Visit this group at http://groups.google.com/group/scintilla-interest.
For more options, visit https://groups.google.com/groups/opt_out.
Loading...