Compare commits

...

25 Commits

Author SHA1 Message Date
Uwe Rathmann e3ec499cc3 Merge branch 'master' into features/slider 2025-02-28 09:32:48 +01:00
Uwe Rathmann 0f4c9de0e6 wip 2025-02-06 11:10:14 +01:00
Uwe Rathmann 6de763ec2a wip 2025-02-06 11:03:47 +01:00
Uwe Rathmann 476b969d7d wip 2025-02-06 11:00:13 +01:00
Uwe Rathmann 7f324d2d48 Merge branch 'master' into xx 2025-02-06 10:59:51 +01:00
Uwe Rathmann 8d780244b6 Squashed commit of the following:
commit c331fd601a
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Dec 10 12:17:51 2024 +0100

    use enums for class members

commit 0d86454774
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Dec 10 11:27:16 2024 +0100

    elide mode for QskTextField::PlaceholderText added

commit 0038f6d3b3
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 16:03:55 2024 +0100

    more enums specified

commit 5d95913366
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 15:56:49 2024 +0100

    QskSizePolicy enums specified

commit 4220edc7ca
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 15:46:43 2024 +0100

    don't use enum bitfields for unspecied enums

commit 36f502b57a
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 15:43:57 2024 +0100

    QskItem::UpdateFlags sepcified

commit 23beda3c28
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 15:39:06 2024 +0100

    more enum types specified

commit 0849571523
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 15:21:37 2024 +0100

    enum types specified

commit d53579f3d9
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 15:04:37 2024 +0100

    enum types specified

commit 4e6ee36420
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 14:53:59 2024 +0100

    NodeRole enums qualified as quint8

commit 3a83f5fa2c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 13:29:03 2024 +0100

    compiler errors fixed

commit d1fa0207fa
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 12:10:10 2024 +0100

    Markdown format added

commit 66d97831b5
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 12:01:16 2024 +0100

    QskTextColors is a Q_GADGET now

commit 4ad28e6076
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 9 10:04:33 2024 +0100

    don't show the placeholder when text is not empty

commit b6f2003826
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Wed Dec 4 10:08:39 2024 +0100

    QskTextFieldSkinlet::sizeHint added

commit f0d53322aa
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Dec 3 17:52:39 2024 +0100

    gallery updated, dummy TextFieldSkinlets introduced

commit e86378a072
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Dec 3 13:33:17 2024 +0100

    fusion skin improved

commit 4540cc1e4e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Dec 3 10:06:26 2024 +0100

    QskTextFieldSkinlet::Selected state introduced

commit 77e556fad2
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Dec 3 09:32:39 2024 +0100

    QskTextField::placeholderText introduced, QskTextField::description
    removed

commit 77739d7734
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Dec 3 07:44:44 2024 +0100

    skin hint table size reduced

commit 108aa23397
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Dec 2 12:54:31 2024 +0100

    QskTextInput renamed to QskTextField ( term used by F2/M3 and QC2 )

commit b0864965a8
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Sun Dec 1 11:06:51 2024 +0100

    Material3 adjustements for progress bars

commit d18017ca90
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Nov 29 13:55:30 2024 +0100

    QskProgressRing fixed + M3 updates

commit a58d6dd589
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Nov 29 09:42:01 2024 +0100

    QskProgressIndicator::hasOrigin(), QskSlider::hasOrigin added

commit 12dfac153d
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 28 16:06:00 2024 +0100

    QskSlider::inverted introduced

commit db1e9a7e44
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 28 15:59:59 2024 +0100

    key handling of bounded inputs improved

commit d9a66e4a98
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 28 15:55:57 2024 +0100

    QskSlider API cleanup

commit 9d13cd1edf
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 28 15:47:20 2024 +0100

    subcontrol renamed from Knob to Handle

commit 7a180cfe5e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 28 12:00:46 2024 +0100

    the corrected mouse/touch handling works without extending the handle
    selection area
    handle selection

commit 66085ea41f
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Wed Nov 27 16:27:57 2024 +0100

    QskSlider::origin implemented

commit e2c76aa121
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Wed Nov 27 16:24:55 2024 +0100

    QskSlider ticks implementaton completed

commit 77731954eb
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Nov 26 13:59:42 2024 +0100

    slider changes on press

commit 59b88ffd7c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Nov 26 13:57:13 2024 +0100

    slider layout code fixed

commit cd65adb451
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Tue Nov 26 13:48:55 2024 +0100

    QskSkinnable::metric with default value

commit ea3d7a5e69
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Nov 25 09:02:04 2024 +0100

    QskInterval::center(), QskInterval::stretch removed as they the
    implementation is only handling normalized intervals

commit 494c370e61
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Nov 22 17:38:58 2024 +0100

    ticks for F2 sliders

commit f4c2211f2c
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Fri Nov 22 17:37:47 2024 +0100

    API extended

commit 5c1e0ccad4
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 21 19:19:53 2024 +0100

    invalid constexpr qualifier removed

commit 9a5dd886ed
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 21 17:59:54 2024 +0100

    slider ticks - not only for M3

commit d04c030924
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 21 17:59:37 2024 +0100

    using constexpr

commit d87c8e3d0b
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 21 13:54:01 2024 +0100

    API cleanup of the Bounded controls

commit 109fc7d7f4
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Wed Nov 20 14:57:16 2024 +0100

    QskBoxClipNode renamed to QskClipNode + more clip options added

commit 1e383406e2
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Wed Nov 20 11:00:17 2024 +0100

    M3 specific definitions moved to M3 classes

commit 97e3ea6e1f
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Nov 18 16:44:06 2024 +0100

    Qt5 incompatibility fixed

commit 00f2112817
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Mon Nov 18 16:15:50 2024 +0100

    QskMaterial3SliderSkinlet introduced

commit 9fc7b1f677
Author: Peter Hartmann <peter@edelhirsch.io>
Date:   Mon Nov 18 12:18:30 2024 +0100

    push buttons: Style checked state properly (#477)

    Resolves #367

commit b5c56f7f80
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 14 10:52:08 2024 +0100

    mismatch between allocated and used memory fixed

commit d1c2751a8e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 14 10:51:53 2024 +0100

    nullptr check added

commit 8dd5a7b249
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 14 08:52:40 2024 +0100

    dangling reference fixed

commit baaccb2f41
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 14 07:43:34 2024 +0100

    avoid enum bitfields

commit 7f389ef6cc
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Wed Nov 13 14:11:11 2024 +0100

    don't subtract the slider margins twice

commit d84ab6e387
Author: Peter Hartmann <peter@edelhirsch.io>
Date:   Wed Nov 13 10:00:38 2024 +0100

    Update instructions on how to build the website (#470)

    * Regenerate doxygen file

    ... and change some things

    * Add custom stylesheet from Skia

    * update instructions on how to build the website

commit 525ca3bd0e
Author: Uwe Rathmann <Uwe.Rathmann@tigertal.de>
Date:   Thu Nov 7 17:31:14 2024 +0100

    QskSlider: Adapt to new Material3 style
    ( ValueLabel a.k.a Tooltip is not done yet )
2024-12-10 14:41:17 +01:00
Uwe Rathmann 128ce8f79b synched with master 2024-12-02 11:03:37 +01:00
Uwe Rathmann 6a8d9096be QskSlider::Fill color added 2024-11-07 17:05:52 +01:00
Uwe Rathmann 43286c2b83 Merge branch 'master' into features/slider 2024-11-07 16:58:51 +01:00
Uwe Rathmann 1608ef8596 Merge branch 'slider' into features/slider 2024-11-07 14:13:10 +01:00
Uwe Rathmann 83670c997c Halo subcontrol removed 2024-10-28 16:03:49 +01:00
Uwe Rathmann 177e929dbb Merge branch 'master' into features/slider 2024-10-28 15:44:39 +01:00
Uwe Rathmann 9f6ad841c2 Merge branch 'master' into features/slider 2024-10-28 08:16:40 +01:00
Uwe Rathmann 52ac73111e Merge branch 'master' into features/slider 2024-10-23 13:54:17 +02:00
Uwe Rathmann b19515c801 QskSlider using the decimals property for the value label 2024-10-23 11:18:25 +02:00
Uwe Rathmann b53f60dd0e Merge branch 'master' into features/slider 2024-10-23 11:16:30 +02:00
Uwe Rathmann 4778feaaa2 value to text conversion moved to QskSlider 2024-10-23 09:17:28 +02:00
Uwe Rathmann e3b87338c0 Merge branch 'master' into features/slider 2024-10-23 08:54:49 +02:00
Uwe Rathmann d93459496a Merge branch 'master' into m3slider 2024-10-22 15:46:58 +02:00
Uwe Rathmann dd74bc7595 Merge branch 'master' into m3slider 2024-10-22 11:57:20 +02:00
Uwe Rathmann ad7e24faa5 Merge branch 'issues/391-m3-slider' of https://github.com/edelhirsch/qskinny into m3slider 2024-10-22 09:48:40 +02:00
Peter Hartmann b82097fdb4 QskSlider: Hardcode minimum handle strut size (for now)
... so that it is easier to use with the finger

Resolves #391
2024-07-22 15:45:49 +02:00
Peter Hartmann f04dedd30a QskSlider: Add stop indicators
... as required by M3

Resolves #391
2024-07-22 12:11:09 +02:00
Peter Hartmann 3fdd72c5a3 QskSlider: Add label container and text
... as required by M3

Resolves #391
2024-07-22 12:11:09 +02:00
Peter Hartmann e7b64bf4a0 QskSlider: Adapt to new Material3 style
Resolves #391
2024-07-22 12:11:09 +02:00
5 changed files with 72 additions and 2 deletions

View File

@ -1004,6 +1004,21 @@ void Editor::setupSlider()
const auto disabledColor = flattenedColor( m_pal.onSurface, m_pal.background, 0.38 );
setGradient( Q::Handle | Q::Disabled, disabledColor );
for( const auto state : { Q::Focused, Q::Pressed } )
{
setStrutSize( Q::LabelContainer | state, 48_px, 44_px,
{ QskStateCombination::CombinationNoState, Q::Hovered } );
}
setBoxShape( Q::LabelContainer, 100, Qt::RelativeSize );
setGradient( Q::LabelContainer, m_pal.inverseSurface );
setMargin( Q::LabelContainer | A::Horizontal, { 0, 0, 0, 4_px } );
setMargin( Q::LabelContainer | A::Vertical, { 4_px, 0, 0, 0 } );
setFontRole( Q::LabelText, LabelMedium );
setColor( Q::LabelText, m_pal.inverseOnSurface );
setAlignment( Q::LabelText, Qt::AlignCenter );
setAnimation( Q::Handle | A::Metric | A::Position, 2 * qskDuration );
}

View File

@ -15,6 +15,8 @@ QSK_SUBCONTROL( QskSlider, Fill )
QSK_SUBCONTROL( QskSlider, Scale )
QSK_SUBCONTROL( QskSlider, Tick )
QSK_SUBCONTROL( QskSlider, Handle )
QSK_SUBCONTROL( QskSlider, LabelContainer )
QSK_SUBCONTROL( QskSlider, LabelText )
QSK_SYSTEM_STATE( QskSlider, Pressed, QskAspect::FirstSystemState << 2 )

View File

@ -28,7 +28,8 @@ class QSK_EXPORT QskSlider : public QskBoundedValueInput
using Inherited = QskBoundedValueInput;
public:
QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Tick, Handle )
QSK_SUBCONTROLS( Panel, Groove, Fill, Scale, Tick, Handle,
LabelContainer, LabelText )
QSK_STATES( Pressed )
explicit QskSlider( QQuickItem* parent = nullptr );

View File

@ -11,6 +11,7 @@
#include <qvector.h>
#include <qpair.h>
#include <qmath.h>
#include <qfontmetrics.h>
// the color of graduation ticks might different, when being on top of the filling
QSK_SYSTEM_STATE( QskSliderSkinlet, Filled, QskAspect::FirstUserState >> 1 )
@ -87,7 +88,8 @@ static inline QPair< qreal, qreal > qskTickSpan( qreal min, qreal max, qreal len
QskSliderSkinlet::QskSliderSkinlet( QskSkin* skin )
: Inherited( skin )
{
setNodeRoles( { PanelRole, GrooveRole, FillRole, TicksRole, HandleRole } );
setNodeRoles( { PanelRole, GrooveRole, FillRole, TicksRole, HandleRole,
LabelContainerRole, LabelTextRole } );
}
QskSliderSkinlet::~QskSliderSkinlet()
@ -114,6 +116,12 @@ QRectF QskSliderSkinlet::subControlRect( const QskSkinnable* skinnable,
if ( subControl == Q::Handle )
return handleRect( slider, contentsRect );
if ( subControl == Q::LabelContainer )
return labelContainerRect( slider, contentsRect );
if ( subControl == Q::LabelText )
return labelContainerRect( slider, contentsRect );
return Inherited::subControlRect( skinnable, contentsRect, subControl );
}
@ -138,6 +146,12 @@ QSGNode* QskSliderSkinlet::updateSubNode(
case TicksRole:
return updateSeriesNode( slider, Q::Tick, node );
case LabelContainerRole:
return updateBoxNode( slider, node, Q::LabelContainer );
case LabelTextRole:
return updateTextNode( slider, node, slider->valueText(), Q::LabelText );
}
return Inherited::updateSubNode( skinnable, nodeRole, node );
@ -362,6 +376,40 @@ QRectF QskSliderSkinlet::tickRect( const QskSlider* slider,
}
}
QRectF QskSliderSkinlet::labelContainerRect(
const QskSlider* slider, const QRectF& rect ) const
{
auto size = slider->strutSizeHint( Q::LabelContainer );
if( size.isEmpty() )
return QRectF();
const QFontMetricsF fm( slider->effectiveFont( Q::LabelText ) );
const auto w = qskHorizontalAdvance( fm, slider->valueText() );
const auto padding = slider->paddingHint( Q::LabelContainer );
const auto h = fm.height() + padding.top() + padding.bottom();
size = size.expandedTo( { w, h } );
const auto hr = subControlRect( slider, rect, Q::Handle );
const auto margins = slider->marginHint( Q::LabelContainer );
qreal x, y;
if( slider->orientation() == Qt::Horizontal )
{
x = hr.center().x() - size.width() / 2;
y = hr.top() - margins.bottom() - size.height();
}
else
{
x = hr.left() - size.width() - margins.left();
y = hr.center().y() - size.height() / 2;
}
return QRectF( x, y, size.width(), size.height() );
}
QSizeF QskSliderSkinlet::sizeHint( const QskSkinnable* skinnable,
Qt::SizeHint which, const QSizeF& ) const
{

View File

@ -26,6 +26,8 @@ class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
FillRole,
TicksRole,
HandleRole,
LabelContainerRole,
LabelTextRole,
RoleCount
};
@ -65,6 +67,8 @@ class QSK_EXPORT QskSliderSkinlet : public QskSkinlet
QRectF fillRect( const QskSlider*, const QRectF& ) const;
QRectF handleRect( const QskSlider*, const QRectF& ) const;
QRectF tickRect( const QskSlider*, const QRectF&, int index ) const;
QRectF labelContainerRect( const QskSlider*, const QRectF& ) const;
};
#endif