discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SMDoubleSlider usability on GNUstep


From: Yavor Doganov
Subject: Re: SMDoubleSlider usability on GNUstep
Date: Fri, 23 Feb 2018 12:32:05 +0000 (UTC)
User-agent: Pan/0.144 (Time is the enemy; 28ab3ba git.gnome.org/pan2)

В Tue, 20 Feb 2018 23:13:21 +0200, Yavor Doganov написа:

> I turned NSCell's -setObjectValue: to a private method and changed all
> -set*Value: methods to use it.  My test program doesn't crash now and I
> can see the two knobs.  Movement is awkward (no sliding effect) and if I
> click on the first knob the second one disappears.

I reverted this change as it is causing the awkwardness, among other
problems.  Instead, I disabled SMDoubleSliderCell's -setObjectValue:
so that NSCell's method is always used.  It seems to be working
properly except:

1. When the high knob is not set to a particular value with
-set*HiValue: it is not displayed initially.  However, if I click on
the right side of the bar both knobs become visible.

2. Possibly related with the above issue, if I click on the low knob,
the high knob disappears.  It is visible where it should be during
NSCell -trackMouse:inRect:ofView:untilMouseUp: but as soon as the
mouse is up it disappears again.  When tracking the high knob both
knobs are visible as expected.

I believe these are GNUstep bugs or at least there is a difference in
the behavior compared to Cocoa (assuming the code works as expected on
Cocoa).

> Is it a problem that SMDoubleSliderCell overrides both -drawKnob: and
> -drawKnob?

I tried merging them into -drawKnob: only, no difference in the
behavior except that the high knob is not visible when the low knob is
being moved with the mouse.

3. When the low knob is moved at the beginning of the bar, it becomes
locked and can no longer be moved with the mouse.  This seems to be
caused by this code in SMDoubleSliderCell's -startTrackingAt:inView:

    if ( [ self trackingLoKnob ] && NSEqualRects( loKnobRect,
                [ self knobRectFlipped:[ controlView isFlipped ] ] ) )
        [ self setTrackingLoKnob:( _sm_loValue > [ self minValue ] ) ];

When _sm_loValue is 0 or lower than minValue (in cases when minValue
is set explicitly to a positive value), the boolean expression is
false and only the high knob can be tracked; the low knob remains
blocked indefinitely.  I replaced > with >= and it solves the problem,
although it has the same effect as disabling this check entirely.  It
seems bogus to me, the two knobs cannot overlap.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]