From 85db8e8380db5cb0c6df6eeb6fbab8947608cf8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 19 Jul 2008 12:39:14 +0000 Subject: [PATCH] In my BSlider changes, I changed the behavior of GetPreferredSize(), which previously did never shrink the slider horizontally. This broke a couple apps, so I added it back, although I don't quite agree that this is the correct behavior. Apps using the new layout system are not affected though, so I guess it is alright. Should fix #2530, although I didn't test it yet. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26502 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Slider.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/kits/interface/Slider.cpp b/src/kits/interface/Slider.cpp index 5aee1b59d8..e3f4e8c090 100644 --- a/src/kits/interface/Slider.cpp +++ b/src/kits/interface/Slider.cpp @@ -1300,8 +1300,13 @@ BSlider::GetPreferredSize(float* _width, float* _height) { BSize preferredSize = PreferredSize(); - if (_width) - *_width = preferredSize.width; + if (_width) { +// *_width = preferredSize.width; + // NOTE: For compatibility reasons, the BSlider never shrinks + // horizontally. This only affects applications which do not + // use the new layout system. + *_width = max_c(Bounds().Width(), preferredSize.width); + } if (_height) *_height = preferredSize.height;