[haiku-commits] haiku: hrev45637 - src/kits/tracker

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 6 May 2013 23:26:33 +0200 (CEST)

hrev45637 adds 1 changeset to branch 'master'
old head: c33396629144d09d2efb678e0d7f97290e69b1ac
new head: 13cec3021167821f38dbd64e0bfda69a8c5c3a9c
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=13cec30+%5Ec333966

----------------------------------------------------------------------------

13cec30: Find: set a max width on each of the menu fields
  
  ... instead of the just on the mime type menu now that
  menu field truncation is working. This will prevent the
  volume menu growing too wide as well.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45637
Commit:      13cec3021167821f38dbd64e0bfda69a8c5c3a9c
URL:         http://cgit.haiku-os.org/haiku/commit/?id=13cec30
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Mon May  6 21:23:59 2013 UTC

----------------------------------------------------------------------------

1 file changed, 3 insertions(+), 4 deletions(-)
src/kits/tracker/FindPanel.cpp | 7 +++----

----------------------------------------------------------------------------

diff --git a/src/kits/tracker/FindPanel.cpp b/src/kits/tracker/FindPanel.cpp
index f42c7dd..5179053 100644
--- a/src/kits/tracker/FindPanel.cpp
+++ b/src/kits/tracker/FindPanel.cpp
@@ -862,9 +862,7 @@ FindPanel::FindPanel(BFile* node, FindWindow* parent, bool 
fromTemplate,
        else
                AddByAttributeItems(node);
 
-       fMimeTypeField->SetExplicitSize(
-               BSize(be_control_look->DefaultItemSpacing() * 20, 
B_SIZE_UNSET));
-               // ResizeMenuField() makes fMimeTypeField too wide.
+       ResizeMenuField(fMimeTypeField);
        ResizeMenuField(searchModeField);
        ResizeMenuField(volumeField);
 }
@@ -972,7 +970,8 @@ FindPanel::ResizeMenuField(BMenuField* menuField)
                }
        }
 
-       size.width = width + padding;
+       float maxWidth = be_control_look->DefaultItemSpacing() * 20;
+       size.width = std::min(width + padding, maxWidth);
        menuField->SetExplicitSize(size);
 }
 


Other related posts:

  • » [haiku-commits] haiku: hrev45637 - src/kits/tracker - jscipione