aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorUnknown <nyamatongwe@gmail.com>2013-06-18 16:18:59 +1000
committerUnknown <nyamatongwe@gmail.com>2013-06-18 16:18:59 +1000
commitaf990b1bab20dc44269a828d35179aec4c2f38bd (patch)
tree3776332b3076e9ab5132796a349bc18a3e21a329
parent6422e1d673310be995dd580f14a03020e4e56bb8 (diff)
downloadscintilla-mirror-af990b1bab20dc44269a828d35179aec4c2f38bd.tar.gz
Bug: [#1488] Simplify gtk scrollbar resize code.
From Todd Whiteman at ActiveState.
-rw-r--r--gtk/ScintillaGTK.cxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx
index 49cf2c8cd..2d82d5af6 100644
--- a/gtk/ScintillaGTK.cxx
+++ b/gtk/ScintillaGTK.cxx
@@ -1693,9 +1693,6 @@ 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 = scrollBarHeight;
- if (!showSBHorizontal)
- horizontalScrollBarHeight = 0;
GtkAllocation alloc;
if (showSBHorizontal) {
@@ -1703,10 +1700,11 @@ void ScintillaGTK::Resize(int width, int height) {
alloc.x = 0;
alloc.y = height - scrollBarHeight;
alloc.width = Platform::Maximum(1, width - scrollBarWidth);
- alloc.height = horizontalScrollBarHeight;
+ alloc.height = scrollBarHeight;
gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarh)), &alloc);
} else {
gtk_widget_hide(GTK_WIDGET(PWidget(scrollbarh)));
+ scrollBarHeight = 0; // in case horizontalScrollBarVisible is true.
}
if (verticalScrollBarVisible) {
@@ -1715,11 +1713,10 @@ void ScintillaGTK::Resize(int width, int height) {
alloc.y = 0;
alloc.width = scrollBarWidth;
alloc.height = Platform::Maximum(1, height - scrollBarHeight);
- if (!showSBHorizontal)
- alloc.height += scrollBarWidth-1;
gtk_widget_size_allocate(GTK_WIDGET(PWidget(scrollbarv)), &alloc);
} else {
gtk_widget_hide(GTK_WIDGET(PWidget(scrollbarv)));
+ scrollBarWidth = 0;
}
if (IS_WIDGET_MAPPED(PWidget(wMain))) {
ChangeSize();
@@ -1729,10 +1726,6 @@ void ScintillaGTK::Resize(int width, int height) {
alloc.y = 0;
alloc.width = Platform::Maximum(1, width - scrollBarWidth);
alloc.height = Platform::Maximum(1, height - scrollBarHeight);
- if (!showSBHorizontal)
- alloc.height += scrollBarHeight;
- if (!verticalScrollBarVisible)
- alloc.width += scrollBarWidth;
gtk_widget_size_allocate(GTK_WIDGET(PWidget(wText)), &alloc);
}