Ticket #749: patch-bug#749.diff
File patch-bug#749.diff, 2.3 KB (added by , 17 years ago) |
---|
-
src/kits/tracker/CountView.h
66 66 BRect BarberPoleInnerRect() const; 67 67 BRect BarberPoleOuterRect() const; 68 68 BRect TextInvalRect() const; 69 BRect TextAndBarberPoleRect() const; 69 70 void TrySpinningBarberPole(); 70 71 71 72 int32 fLastCount; -
src/kits/tracker/CountView.cpp
73 73 if (fStartSpinningAfter && system_time() < fStartSpinningAfter) 74 74 return; 75 75 76 // When the barber pole just starts spinning we need to invalidate 77 // the whole rectangle of text and barber pole. 78 // After this the text needs no updating since only the pole changes. 76 79 if (fStartSpinningAfter) { 77 80 fStartSpinningAfter = 0; 78 Invalidate( BarberPoleOuterRect());81 Invalidate(TextAndBarberPoleRect()); 79 82 } else 80 83 Invalidate(BarberPoleInnerRect()); 81 84 } … … 133 136 { 134 137 BRect result = Bounds(); 135 138 result.InsetBy(4, 2); 136 result.right -= 10;137 139 140 // if the barber pole is not present, use its space for text 141 if(fShowingBarberPole) 142 result.right -= 10; 143 138 144 return result; 139 145 } 140 146 147 BRect 148 BCountView::TextAndBarberPoleRect() const 149 { 150 BRect result = Bounds(); 151 result.InsetBy(4, 2); 152 153 return result; 154 } 155 141 156 void 142 157 BCountView::CheckCount() 143 158 { … … 154 169 BCountView::Draw(BRect) 155 170 { 156 171 BRect bounds(Bounds()); 157 BRect barberPoleRect;158 172 BString itemString; 159 173 if (!IsTypingAhead()) { 160 174 if (fLastCount == 0) … … 166 180 } else 167 181 itemString << TypeAhead(); 168 182 169 170 183 BString string(itemString); 171 184 BRect textRect(TextInvalRect()); 172 185 173 if (fShowingBarberPole && !fStartSpinningAfter) { 174 barberPoleRect = BarberPoleOuterRect(); 175 TruncateString(&string, B_TRUNCATE_END, textRect.Width()); 176 } 186 TruncateString(&string, B_TRUNCATE_END, textRect.Width()); 177 187 178 188 if (IsTypingAhead()) 179 189 // use a muted gray for the typeahead … … 202 212 EndLineArray(); 203 213 return; 204 214 } 215 216 BRect barberPoleRect(BarberPoleOuterRect()); 205 217 206 218 AddLine(barberPoleRect.LeftTop(), barberPoleRect.RightTop(), shadow); 207 219 AddLine(barberPoleRect.LeftTop(), barberPoleRect.LeftBottom(), shadow);