Add enabled/disable support for ScrollBar plasma component
- The current disabled scroll bar have less opacity when disabled instead of custom graphics. Needs to be defined if this is the expected behaviour. Signed-off-by: Daker Fernandes Pinheiro <dakerfp@gmail.com>
This commit is contained in:
parent
b9e69695bd
commit
3a984f05b0
@ -44,6 +44,9 @@ Item {
|
|||||||
|
|
||||||
implicitWidth: _isVertical ? 22 : 200
|
implicitWidth: _isVertical ? 22 : 200
|
||||||
implicitHeight: _isVertical ? 200 : 22
|
implicitHeight: _isVertical ? 200 : 22
|
||||||
|
// TODO: needs to define if there will be specific graphics for
|
||||||
|
// disabled scroll bars
|
||||||
|
opacity: enabled ? 1.0 : 0.5
|
||||||
|
|
||||||
visible: flickableItem && handle.width < contents.width
|
visible: flickableItem && handle.width < contents.width
|
||||||
|
|
||||||
@ -58,7 +61,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Keys.onUpPressed: {
|
Keys.onUpPressed: {
|
||||||
if (!_isVertical)
|
if (!enabled || !_isVertical)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_inverted)
|
if (_inverted)
|
||||||
@ -68,7 +71,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Keys.onDownPressed: {
|
Keys.onDownPressed: {
|
||||||
if (!_isVertical)
|
if (!enabled || !_isVertical)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_inverted)
|
if (_inverted)
|
||||||
@ -78,7 +81,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Keys.onLeftPressed: {
|
Keys.onLeftPressed: {
|
||||||
if (_isVertical)
|
if (!enabled || _isVertical)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_inverted)
|
if (_inverted)
|
||||||
@ -88,7 +91,7 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Keys.onRightPressed: {
|
Keys.onRightPressed: {
|
||||||
if (_isVertical)
|
if (!enabled || _isVertical)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_inverted)
|
if (_inverted)
|
||||||
@ -134,6 +137,7 @@ Item {
|
|||||||
id: leftMousArea
|
id: leftMousArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
enabled: scrollbar.enabled
|
||||||
Timer {
|
Timer {
|
||||||
id: leftTimer
|
id: leftTimer
|
||||||
interval: scrollbar.scrollButtonInterval;
|
interval: scrollbar.scrollButtonInterval;
|
||||||
@ -174,6 +178,7 @@ Item {
|
|||||||
id: rightMousArea
|
id: rightMousArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
enabled: scrollbar.enabled
|
||||||
Timer {
|
Timer {
|
||||||
id: rightTimer
|
id: rightTimer
|
||||||
interval: scrollbar.scrollButtonInterval;
|
interval: scrollbar.scrollButtonInterval;
|
||||||
@ -289,6 +294,7 @@ Item {
|
|||||||
id: mouseArea
|
id: mouseArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
enabled: scrollbar.enabled
|
||||||
drag {
|
drag {
|
||||||
target: fakeHandle
|
target: fakeHandle
|
||||||
axis: Drag.XAxis
|
axis: Drag.XAxis
|
||||||
|
Loading…
x
Reference in New Issue
Block a user