From 318b5ed2ccb3a72aeeee3da777fe390aee8265ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 8 Mar 2006 14:48:08 +0000 Subject: [PATCH] SetFontAndColor() now ignores the offset when the text view is not stylable. This fixes BTextControl's text staying gray when it was once disabled. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16646 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/BTextView/TextView.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kits/interface/BTextView/TextView.cpp b/src/kits/interface/BTextView/TextView.cpp index 057109c007..d003a36303 100644 --- a/src/kits/interface/BTextView/TextView.cpp +++ b/src/kits/interface/BTextView/TextView.cpp @@ -1523,6 +1523,13 @@ BTextView::SetFontAndColor(int32 startOffset, int32 endOffset, const BFont* font NormalizeFont(&newFont); } + if (!fStylable) { + // When the text view is not stylable, we always set the whole text's + // style and ignore the offsets + startOffset = 0; + endOffset = fText->Length(); + } + // add the style to the style buffer fStyles->SetStyleRange(startOffset, endOffset, fText->Length(), fontMode, &newFont, color);