@@ -7,11 +7,12 @@
*/
import QtQuick 2.0
import QtQuick.Layouts 1.1
import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.kwin 2 .0 as KWin
import org.kde.kwin 3 .0 as KWin
KWin .Switcher {
KWin .TabBoxSwitcher {
id: tabBox
readonly property real screenFactor: screenGeometry .width / screenGeometry .height
@@ -26,19 +27,20 @@ KWin.Switcher {
x: screenGeometry .x + (Qt .application .layoutDirection === Qt .RightToLeft ? screenGeometry .width - width : 0 )
y: screenGeometry .y
mainItem: PlasmaExtras . ScrollArea {
mainItem: PlasmaComponents . ScrollView {
id: dialogMainItem
focus: true
width : tabBox .screenGeometry .width * 0.15 + ( __verticalScrollBar . visible ? __verticalScrollBar . width : 0 )
contentWidth : tabBox .screenGeometry .width * 0.15
height: tabBox .screenGeometry .height - dialog .margins .top - dialog .margins .bottom
LayoutMirroring .enabled : Qt .application .layoutDirection === Qt .RightToLeft
LayoutMirroring .childrenInherit : true
ListView {
id: thumbnailListView
focus: true
model: tabBox .model
spacing: PlasmaCore .Units .smallSpacing
highlightMoveDuration: PlasmaCore .Units .longDuration
@@ -53,6 +55,9 @@ KWin.Switcher {
}
delegate: MouseArea {
Accessible .name : model .caption
Accessible .role : Accessible .Client
width: thumbnailListView .width
height: delegateColumn .height + 2 * delegateColumn .y
@@ -72,15 +77,11 @@ KWin.Switcher {
width: parent .width - 2 * PlasmaCore .Units .smallSpacing
spacing: PlasmaCore .Units .smallSpacing
focus: index == thumbnailListView .currentIndex
Accessible .name : model .caption
Accessible .role : Accessible .Client
Item {
Layout .fillWidth : true
implicitHeight: Math .round (delegateColumn .width / tabBox .screenFactor )
KWin .ThumbnailItem {
KWin .WindowThumbnail {
anchors .fill : parent
wId: windowId
}
@@ -106,26 +107,14 @@ KWin.Switcher {
wrapMode: Text .WrapAtWordBoundaryOrAnywhere
maximumLineCount: 2
lineHeight: 0.95
textFormat: Text .PlainText
}
}
}
}
highlight: PlasmaExtras .Highlight {}
}
/*
* Key navigation on outer item for two reasons:
* @li we have to Q_EMIT the change signal
* @li on multiple invocation it does not work on the list view. Focus seems to be lost.
**/
Keys .onPressed : {
if (event .key === Qt .Key_Up ) {
icons .decrementCurrentIndex ();
} else if (event .key === Qt .Key_Down ) {
icons .incrementCurrentIndex ();
}
}
}
}
}