itemFocusClip added
This commit is contained in:
parent
44f9f36d0d
commit
3df57c6025
|
@ -212,6 +212,16 @@ namespace
|
|||
m_isSizeChangedEnabled = on;
|
||||
}
|
||||
|
||||
QRectF focusIndicatorClipRect() const override
|
||||
{
|
||||
if( scrollArea()->hasItemFocusClipping() )
|
||||
{
|
||||
return Inherited::focusIndicatorClipRect();
|
||||
}
|
||||
|
||||
return QRectF();
|
||||
}
|
||||
|
||||
protected:
|
||||
bool event( QEvent* event ) override;
|
||||
|
||||
|
@ -392,6 +402,7 @@ class QskScrollArea::PrivateData
|
|||
public:
|
||||
PrivateData()
|
||||
: isItemResizable( true )
|
||||
, isItemFocusClipping( true )
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -412,6 +423,7 @@ class QskScrollArea::PrivateData
|
|||
ClipItem* clipItem = nullptr;
|
||||
|
||||
bool isItemResizable : 1;
|
||||
bool isItemFocusClipping : 1;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -511,6 +523,20 @@ bool QskScrollArea::isItemResizable() const
|
|||
return m_data->isItemResizable;
|
||||
}
|
||||
|
||||
void QskScrollArea::setItemFocusClipping( bool on )
|
||||
{
|
||||
if( m_data->isItemFocusClipping != on )
|
||||
{
|
||||
m_data->isItemFocusClipping = on;
|
||||
Q_EMIT focusIndicatorRectChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool QskScrollArea::hasItemFocusClipping() const
|
||||
{
|
||||
return m_data->isItemFocusClipping;
|
||||
}
|
||||
|
||||
void QskScrollArea::setScrolledItem( QQuickItem* item )
|
||||
{
|
||||
auto oldItem = m_data->clipItem->scrolledItem();
|
||||
|
|
|
@ -18,6 +18,9 @@ class QSK_EXPORT QskScrollArea : public QskScrollView
|
|||
Q_PROPERTY( bool itemResizable READ isItemResizable
|
||||
WRITE setItemResizable NOTIFY itemResizableChanged FINAL )
|
||||
|
||||
Q_PROPERTY( bool itemFocusClipping READ hasItemFocusClipping
|
||||
WRITE setItemFocusClipping FINAL )
|
||||
|
||||
using Inherited = QskScrollView;
|
||||
|
||||
public:
|
||||
|
@ -30,6 +33,9 @@ class QSK_EXPORT QskScrollArea : public QskScrollView
|
|||
void setItemResizable( bool on );
|
||||
bool isItemResizable() const;
|
||||
|
||||
void setItemFocusClipping( bool on );
|
||||
bool hasItemFocusClipping() const;
|
||||
|
||||
Q_SIGNALS:
|
||||
void scrolledItemChanged();
|
||||
void itemResizableChanged( bool );
|
||||
|
|
Loading…
Reference in New Issue