From b10020de0612cf9310ccc6a029bc27a619488dfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 16 Apr 2009 09:48:37 +0000 Subject: [PATCH] Since a BStringView draws the text vertically centered, it should simply use the B_FULL_UPDATE_ON_RESIZE flag. Removed the Invalidate() call accordingly from InvalidateLayout(). Small cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30191 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/StringView.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/StringView.cpp b/src/kits/interface/StringView.cpp index 7ac711df91..001be81f85 100644 --- a/src/kits/interface/StringView.cpp +++ b/src/kits/interface/StringView.cpp @@ -27,7 +27,7 @@ BStringView::BStringView(BRect frame, const char* name, const char* text, uint32 resizeMask, uint32 flags) - : BView(frame, name, resizeMask, flags), + : BView(frame, name, resizeMask, flags | B_FULL_UPDATE_ON_RESIZE), fText(text ? strdup(text) : NULL), fAlign(B_ALIGN_LEFT), fPreferredSize(-1, -1) @@ -36,7 +36,7 @@ BStringView::BStringView(BRect frame, const char* name, const char* text, BStringView::BStringView(const char* name, const char* text, uint32 flags) - : BView(name, flags), + : BView(name, flags | B_FULL_UPDATE_ON_RESIZE), fText(text ? strdup(text) : NULL), fAlign(B_ALIGN_LEFT), fPreferredSize(-1, -1) @@ -60,6 +60,7 @@ BStringView::BStringView(BMessage* data) text = NULL; SetText(text); + SetFlags(Flags() | B_FULL_UPDATE_ON_RESIZE); } @@ -298,7 +299,6 @@ BStringView::SetFont(const BFont* font, uint32 mask) BView::SetFont(font, mask); InvalidateLayout(); - Invalidate(); } @@ -367,7 +367,7 @@ BStringView::Perform(perform_code code, void* _data) BStringView::GetHeightForWidth(data->width, &data->min, &data->max, &data->preferred); return B_OK; -} + } case PERFORM_CODE_SET_LAYOUT: { perform_data_set_layout* data = (perform_data_set_layout*)_data;