aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/ScintillaGTK.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-04-04 07:45:59 +0000
committernyamatongwe <unknown>2002-04-04 07:45:59 +0000
commit2ffc5af90180e0bbf09359bfde77780e4e26715b (patch)
tree8692569d58a4b15a7b3f07608a44069663c677f8 /gtk/ScintillaGTK.cxx
parenta3e1c4d6f23dabf63c029a2ea31869e17be215fb (diff)
downloadscintilla-mirror-2ffc5af90180e0bbf09359bfde77780e4e26715b.tar.gz
Change to horizontal scrolling to allow the assumed document width to be set.
Diffstat (limited to 'gtk/ScintillaGTK.cxx')
-rw-r--r--gtk/ScintillaGTK.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 95139f318..386a0bff4 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -717,10 +717,15 @@ bool ScintillaGTK::ModifyScrollBars(int nMax, int nPage) {
modified = true;
}
- if (GTK_ADJUSTMENT(adjustmenth)->upper != 2000 ||
- GTK_ADJUSTMENT(adjustmenth)->page_size != 200) {
- GTK_ADJUSTMENT(adjustmenth)->upper = 2000;
- GTK_ADJUSTMENT(adjustmenth)->page_size = 200;
+ PRectangle rcText = GetTextRectangle();
+ int horizEndPreferred = scrollWidth;
+ if (horizEndPreferred < 0)
+ horizEndPreferred = 0;
+ unsigned int pageWidth = rcText.Width();
+ if (GTK_ADJUSTMENT(adjustmenth)->upper != horizEndPreferred ||
+ GTK_ADJUSTMENT(adjustmenth)->page_size != pageWidth) {
+ GTK_ADJUSTMENT(adjustmenth)->upper = horizEndPreferred;
+ GTK_ADJUSTMENT(adjustmenth)->page_size = pageWidth;
gtk_adjustment_changed(GTK_ADJUSTMENT(adjustmenth));
modified = true;
}