[vlc-commits] macosx: advanced prefs: only choose slider if we have limits set

David Fuhrmann git at videolan.org
Tue Nov 1 15:12:31 CET 2016


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Tue Nov  1 15:10:50 2016 +0100| [d70331b13ca5c65bb1b16b7d97a8c23bf7e7d86f] | committer: David Fuhrmann

macosx: advanced prefs: only choose slider if we have limits set

The RangedXXControls only make much sense if we have sensible
limits.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d70331b13ca5c65bb1b16b7d97a8c23bf7e7d86f
---

 modules/gui/macosx/prefs_widgets.m | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index 1b745eb..7ddd211 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -796,10 +796,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
         case CONFIG_ITEM_INTEGER:
             if (_p_item->list_count)
                 control = [[IntegerListConfigControl alloc] initWithItem: _p_item withView: parentView];
-            else if ((_p_item->min.i != 0 ||
-                      _p_item->max.i != 0) &&
-                     (_p_item->min.i != INT_MIN ||
-                      _p_item->max.i != INT_MAX))
+            else if (_p_item->min.i > INT32_MIN && _p_item->max.i < INT32_MAX)
                 control = [[RangedIntegerConfigControl alloc] initWithItem: _p_item withView: parentView];
             else
                 control = [[IntegerConfigControl alloc] initWithItem: _p_item withView: parentView];
@@ -809,10 +806,7 @@ o_textfield = [[NSSecureTextField alloc] initWithFrame: s_rc];              \
                                                      withView: parentView];
             break;
         case CONFIG_ITEM_FLOAT:
-            if ((_p_item->min.i != 0 ||
-                 _p_item->max.i != 0) &&
-                (_p_item->min.i != INT_MIN ||
-                 _p_item->max.i != INT_MAX))
+            if (_p_item->min.f > FLT_MIN && _p_item->max.f < FLT_MAX)
                 control = [[RangedFloatConfigControl alloc] initWithItem: _p_item withView: parentView];
             else
                 control = [[FloatConfigControl alloc] initWithItem: _p_item withView: parentView];



More information about the vlc-commits mailing list