~zsombi/ubuntu-ui-toolkit/60-action-value-type

« back to all changes in this revision

Viewing changes to modules/Ubuntu/Components/plugin/uclistitem.cpp

  • Committer: Zsombor Egri
  • Date: 2014-10-24 15:29:03 UTC
  • mfrom: (1224.4.54 55-snap-options)
  • Revision ID: zsombor.egri@canonical.com-20141024152903-ry315twxhmuw5ymw
prereq sync

Show diffs side-by-side

added added

removed removed

Lines of Context:
206
206
    , ready(false)
207
207
    , index(-1)
208
208
    , xAxisMoveThresholdGU(1.5)
 
209
    , overshootGU(2)
209
210
    , color(Qt::transparent)
210
211
    , highlightColor(Qt::transparent)
211
212
    , reboundAnimation(0)
247
248
    // create rebound animation
248
249
    UCUbuntuAnimation animationCodes;
249
250
    reboundAnimation = new QQuickPropertyAnimation(q);
250
 
    reboundAnimation->setEasing(QEasingCurve(QEasingCurve::OutBack));
251
 
    reboundAnimation->setDuration(animationCodes.SnapDuration());
 
251
    QEasingCurve easing(QEasingCurve::OutElastic);
 
252
    easing.setPeriod(0.5);
 
253
    reboundAnimation->setEasing(easing);
 
254
    reboundAnimation->setDuration(animationCodes.BriskDuration());
252
255
    reboundAnimation->setTargetObject(contentItem);
253
256
    reboundAnimation->setProperty("x");
254
257
    reboundAnimation->setAlwaysRunToEnd(true);
396
399
    UCListItemActionsPrivate *trailing = UCListItemActionsPrivate::get(trailingActions);
397
400
    x += dx;
398
401
    // min cannot be less than the trailing's panel width
399
 
    qreal min = (trailing && trailing->panelItem) ? -trailing->panelItem->width() : 0;
 
402
    qreal min = (trailing && trailing->panelItem) ? -trailing->panelItem->width() - UCUnits::instance().gu(overshootGU): 0;
400
403
    // max cannot be bigger than 0 or the leading's width in case we have leading panel
401
 
    qreal max = (leading && leading->panelItem) ? leading->panelItem->width() : 0;
 
404
    qreal max = (leading && leading->panelItem) ? leading->panelItem->width() + UCUnits::instance().gu(overshootGU): 0;
402
405
    x = CLAMP(x, min, max);
403
406
}
404
407