Ticket #14176: tvfix.diff

File tvfix.diff, 1.5 KB (added by irtusb, 6 years ago)
  • headers/os/interface/TextView.h

    diff --git a/headers/os/interface/TextView.h b/headers/os/interface/TextView.h
    index 6fa15ca118..7017a87b98 100644
    a b public:  
    246246    virtual BSize               MaxSize();
    247247    virtual BSize               PreferredSize();
    248248
    249     virtual bool                HasHeightForWidth();
    250     virtual void                GetHeightForWidth(float width, float* min,
    251                                     float* max, float* preferred);
    252 
    253249private:
    254250    // FBC padding and forbidden methods
    255251    virtual void                _ReservedTextView3();
  • src/kits/interface/TextView.cpp

    diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp
    index 952e29cba0..1eef217fa0 100644
    a b BTextView::PreferredSize()  
    25702570}
    25712571
    25722572
    2573 bool
    2574 BTextView::HasHeightForWidth()
    2575 {
    2576     if (IsEditable())
    2577         return BView::HasHeightForWidth();
    2578 
    2579     // When not editable, we assume that all text is supposed to be visible.
    2580     return true;
    2581 }
    2582 
    2583 
    2584 void
    2585 BTextView::GetHeightForWidth(float width, float* min, float* max,
    2586     float* preferred)
    2587 {
    2588     if (IsEditable()) {
    2589         BView::GetHeightForWidth(width, min, max, preferred);
    2590         return;
    2591     }
    2592 
    2593     // TODO: don't change the actual text rect!
    2594     fTextRect.right = fTextRect.left + width;
    2595     _Refresh(0, TextLength(), false);
    2596 
    2597     if (min != NULL)
    2598         *min = fTextRect.Height();
    2599     if (max != NULL)
    2600         *max = B_SIZE_UNLIMITED;
    2601     if (preferred != NULL)
    2602         *preferred = fTextRect.Height();
    2603 }
    2604 
    2605 
    26062573//  #pragma mark - Layout methods
    26072574
    26082575