diff --git a/src/kits/tracker/TextWidget.cpp b/src/kits/tracker/TextWidget.cpp index 4af28fd791..d22d31e0a5 100644 --- a/src/kits/tracker/TextWidget.cpp +++ b/src/kits/tracker/TextWidget.cpp @@ -639,6 +639,9 @@ BTextWidget::Draw(BRect eraseRect, BRect textRect, BPoseView* view, BView* drawV textRect.OffsetBy(offset); + BRegion textRegion(textRect); + drawView->ConstrainClippingRegion(&textRegion); + // We are only concerned with setting the correct text color. // For active views the selection is drawn as inverse text @@ -784,4 +787,6 @@ BTextWidget::Draw(BRect eraseRect, BRect textRect, BPoseView* view, BView* drawV if (direct && clipboardMode != kMoveSelectionTo) drawView->SetDrawingMode(B_OP_OVER); } + + drawView->ConstrainClippingRegion(NULL); } diff --git a/src/kits/tracker/WidgetAttributeText.cpp b/src/kits/tracker/WidgetAttributeText.cpp index 3b34c3e69c..a6c194f167 100644 --- a/src/kits/tracker/WidgetAttributeText.cpp +++ b/src/kits/tracker/WidgetAttributeText.cpp @@ -300,10 +300,9 @@ WidgetAttributeText::~WidgetAttributeText() const char* WidgetAttributeText::FittingText(const BPoseView* view) { - if (fDirty || fColumn->Width() != fOldWidth || CheckSettingsChanged() - || !fValueIsDefined) { + bool widthChanged = view->ViewMode() == kListMode ? fColumn->Width() != fOldWidth : false; + if (fDirty || widthChanged || CheckSettingsChanged()) CheckViewChanged(view); - } ASSERT(!fDirty); return fText.String(); @@ -649,8 +648,11 @@ PathAttributeText::ReadValue(BString* outString) if (entry.InitCheck() == B_OK && entry.GetPath(&path) == B_OK) { *outString = path.Path(); TruncateLeaf(outString); - } else + fValueIsDefined = true; + } else { *outString = "-"; + fValueIsDefined = false; + } fValueDirty = false; } @@ -674,10 +676,13 @@ OriginalPathAttributeText::ReadValue(BString* outString) BPath path; // get the original path - if (entry.InitCheck() == B_OK && FSGetOriginalPath(&entry, &path) == B_OK) + if (entry.InitCheck() == B_OK && FSGetOriginalPath(&entry, &path) == B_OK) { *outString = path.Path(); - else + fValueIsDefined = true; + } else { *outString = "-"; + fValueIsDefined = false; + } fValueDirty = false; } @@ -709,6 +714,7 @@ KindAttributeText::ReadValue(BString* outString) *outString = fModel->MimeType(); fValueDirty = false; + fValueIsDefined = true; } @@ -746,6 +752,7 @@ NameAttributeText::ReadValue(BString* outString) *outString = fModel->Name(); fValueDirty = false; + fValueIsDefined = true; } @@ -755,7 +762,11 @@ NameAttributeText::FitValue(BString* outString, const BPoseView* view) if (fValueDirty) ReadValue(&fFullValueText); - fOldWidth = fColumn->Width(); + if (view->ViewMode() != kListMode) + fOldWidth = view->StringWidth("M") * 30; + else + fOldWidth = fColumn->Width(); + fTruncatedWidth = TruncString(outString, fFullValueText.String(), fFullValueText.Length(), view, fOldWidth, B_TRUNCATE_MIDDLE); fDirty = false; @@ -839,6 +850,7 @@ RealNameAttributeText::ReadValue(BString* outString) *outString = fModel->EntryRef()->name; fValueDirty = false; + fValueIsDefined = true; } @@ -897,9 +909,11 @@ OwnerAttributeText::ReadValue(BString* outString) user << "root"; } else user << nodeOwner; + *outString = user.String(); fValueDirty = false; + fValueIsDefined = true; } @@ -924,9 +938,11 @@ GroupAttributeText::ReadValue(BString* outString) group << "0"; } else group << nodeGroup; + *outString = group.String(); fValueDirty = false; + fValueIsDefined = true; } #endif // OWNER_GROUP_ATTRIBUTES @@ -971,6 +987,7 @@ ModeAttributeText::ReadValue(BString* outString) *outString = buffer; fValueDirty = false; + fValueIsDefined = true; } @@ -1142,8 +1159,7 @@ GenericAttributeText::CheckAttributeChanged() // fDirty could already be true, in that case we mustn't set it to // false, even if the attribute text hasn't changed - bool changed = fValue.int64t != tmpValue.int64t - || tmpString != fFullValueText; + bool changed = fValue.int64t != tmpValue.int64t || tmpString != fFullValueText; if (changed) fDirty = true; @@ -2063,9 +2079,11 @@ VersionAttributeText::ReadValue(BString* outString) && info.GetVersionInfo(&version, fAppVersion ? B_APP_VERSION_KIND : B_SYSTEM_VERSION_KIND) == B_OK) { *outString = version.short_info; + fValueIsDefined = true; return; } } *outString = "-"; + fValueIsDefined = false; }