From e87506af4ddb6467f0fef9f028e5fc06ee596a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 15 Jul 2008 13:55:44 +0000 Subject: [PATCH] * Implement SetFont() and invalidate the layout. More controls should probably do this. * Fix build, appearantly I made a last minute change in Draw()... BTW, confirmed that adding virtuals declared in the base class is ok for binary compatibility. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26425 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/interface/StringView.h | 5 ++--- src/kits/interface/StringView.cpp | 12 +++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/headers/os/interface/StringView.h b/headers/os/interface/StringView.h index 442dd28905..393cf32c67 100644 --- a/headers/os/interface/StringView.h +++ b/headers/os/interface/StringView.h @@ -55,9 +55,8 @@ class BStringView : public BView{ virtual void AllDetached(); virtual status_t GetSupportedSuites(BMessage* data); -// TODO: should be implemented and invalidate the layout -// virtual void SetFont(const BFont* font, -// uint32 mask = B_FONT_ALL); + virtual void SetFont(const BFont* font, + uint32 mask = B_FONT_ALL); virtual void InvalidateLayout(bool descendants = false); diff --git a/src/kits/interface/StringView.cpp b/src/kits/interface/StringView.cpp index 84030d4a20..1aecc0e4b7 100644 --- a/src/kits/interface/StringView.cpp +++ b/src/kits/interface/StringView.cpp @@ -137,7 +137,7 @@ BStringView::AttachedToWindow() void -BStringView::Draw(BRect bounds) +BStringView::Draw(BRect updateRect) { if (!fText) return; @@ -282,6 +282,16 @@ BStringView::GetSupportedSuites(BMessage* message) } +void +BStringView::SetFont(const BFont* font, uint32 mask) +{ + BView::SetFont(font, mask); + + InvalidateLayout(); + Invalidate(); +} + + void BStringView::InvalidateLayout(bool descendants) {