2013-08-17 08:28:09 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* KWin - the KDE window manager *
|
|
|
|
* This file is part of the KDE project. *
|
|
|
|
* *
|
|
|
|
* Copyright (C) 2013 Antonis Tsiapaliokas <kok3rs@gmail.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software; you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU General Public License as published by *
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or *
|
|
|
|
* (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program is distributed in the hope that it will be useful, *
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
|
|
|
* GNU General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
import QtQuick 2.1
|
|
|
|
import QtQuick.Controls 1.0
|
|
|
|
import QtQuick.Layouts 1.0
|
|
|
|
import org.kde.kwin.kwincompositing 1.0
|
2013-09-10 07:54:46 +00:00
|
|
|
import org.kde.plasma.components 2.0 as PlasmaComponents
|
2013-08-17 08:28:09 +00:00
|
|
|
|
|
|
|
Item {
|
2013-12-02 10:22:57 +00:00
|
|
|
signal changed
|
2013-08-17 08:28:09 +00:00
|
|
|
|
|
|
|
Component {
|
|
|
|
id: sectionHeading
|
|
|
|
Rectangle {
|
|
|
|
width: parent.width
|
|
|
|
height:25
|
|
|
|
color: "white"
|
|
|
|
|
|
|
|
Text {
|
|
|
|
text: section
|
|
|
|
font.bold: true
|
|
|
|
font.pointSize: 16
|
|
|
|
color: "gray"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-08-29 16:58:51 +00:00
|
|
|
|
|
|
|
CompositingType {
|
|
|
|
id: compositingType
|
|
|
|
}
|
|
|
|
|
2013-08-22 10:31:01 +00:00
|
|
|
RowLayout {
|
|
|
|
id: row
|
|
|
|
width: parent.width
|
2013-08-17 08:28:09 +00:00
|
|
|
height: parent.height
|
2013-08-22 10:31:01 +00:00
|
|
|
CheckBox {
|
|
|
|
id: windowManagement
|
2013-09-10 08:41:42 +00:00
|
|
|
text: i18n("Improved Window Management")
|
2013-08-22 10:31:01 +00:00
|
|
|
checked: false
|
|
|
|
anchors.left: col.right
|
|
|
|
anchors.top: parent.top
|
2013-09-11 12:34:29 +00:00
|
|
|
anchors.topMargin: col.height/4
|
2013-08-27 18:21:07 +00:00
|
|
|
onClicked: searchModel.enableWidnowManagement(windowManagement.checked)
|
2013-08-17 08:28:09 +00:00
|
|
|
}
|
|
|
|
|
2013-08-22 15:49:49 +00:00
|
|
|
ComboBox {
|
|
|
|
id: openGLType
|
2013-08-29 16:58:51 +00:00
|
|
|
model: compositingType
|
|
|
|
currentIndex: compositingType.currentOpenGLType()
|
2013-08-22 15:49:49 +00:00
|
|
|
anchors.top: windowManagement.bottom
|
|
|
|
anchors.left: col.right
|
2013-09-11 12:20:12 +00:00
|
|
|
onCurrentIndexChanged: {
|
|
|
|
glScaleFilter.visible = currentIndex != 3;
|
|
|
|
xrScaleFilter.visible = currentIndex == 3;
|
2013-09-12 11:55:25 +00:00
|
|
|
glColorCorrection.enabled = currentIndex !=3 && glColorCorrection !=4;
|
2013-09-11 12:20:12 +00:00
|
|
|
}
|
2013-08-22 15:49:49 +00:00
|
|
|
}
|
|
|
|
|
2013-09-11 08:54:09 +00:00
|
|
|
Label {
|
|
|
|
id: animationText
|
|
|
|
text: i18n("Animation Speed:")
|
|
|
|
anchors {
|
|
|
|
top: openGLType.bottom
|
|
|
|
horizontalCenter: windowManagement.horizontalCenter
|
|
|
|
topMargin: 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Slider {
|
|
|
|
id: animationSpeed
|
|
|
|
maximumValue: 6.0
|
|
|
|
stepSize: 1.0
|
|
|
|
tickmarksEnabled: true
|
|
|
|
value: compositing.animationSpeed
|
|
|
|
anchors {
|
|
|
|
top: animationText.bottom
|
|
|
|
left: col.right
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-11 11:11:39 +00:00
|
|
|
Label {
|
|
|
|
id: windowThumbnailText
|
|
|
|
text: i18n("Keep Window Thumbnails:")
|
|
|
|
anchors {
|
|
|
|
top: animationSpeed.bottom
|
|
|
|
horizontalCenter: windowManagement.horizontalCenter
|
|
|
|
topMargin: 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: windowThumbnail
|
|
|
|
model: [i18n("Always (Breaks Animations)"), i18n("Only for Shown Windows"), i18n("Never")]
|
|
|
|
currentIndex: compositing.windowThumbnail
|
|
|
|
Layout.fillWidth: true
|
|
|
|
anchors {
|
|
|
|
top: windowThumbnailText.bottom
|
|
|
|
left: col.right
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-11 12:20:12 +00:00
|
|
|
Label {
|
|
|
|
id: scaleFilterText
|
|
|
|
text: i18n("Scale Method:")
|
|
|
|
anchors {
|
|
|
|
top: windowThumbnail.bottom
|
|
|
|
horizontalCenter: windowManagement.horizontalCenter
|
|
|
|
topMargin: 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: glScaleFilter
|
|
|
|
model: [i18n("Crisp"), i18n("Smooth"), i18n("Accurate")]
|
|
|
|
visible: openGLType.currentIndex != 3
|
|
|
|
currentIndex: compositing.glScaleFilter
|
|
|
|
anchors {
|
|
|
|
top: scaleFilterText.bottom
|
|
|
|
left: col.right
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: xrScaleFilter
|
|
|
|
model: [i18n("Crisp"), i18n("Smooth (slower)")]
|
|
|
|
visible: openGLType.currentIndex == 3
|
|
|
|
currentIndex: compositing.xrScaleFilter ? 1 : 0
|
|
|
|
anchors {
|
|
|
|
top: scaleFilterText.bottom
|
|
|
|
left: glScaleFilter.visible ? glScaleFilter.right : col.right
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-11 12:34:29 +00:00
|
|
|
CheckBox {
|
|
|
|
id: unredirectFullScreen
|
|
|
|
text: i18n("Suspend desktop effects for \nfull screen windows")
|
|
|
|
checked: compositing.unredirectFullscreen
|
|
|
|
anchors.left: col.right
|
|
|
|
anchors.top: xrScaleFilter.bottom
|
|
|
|
}
|
|
|
|
|
2013-09-12 11:42:18 +00:00
|
|
|
Label {
|
|
|
|
id: glSwapStrategyText
|
|
|
|
text: i18n("Tearing Prevention (VSync):")
|
|
|
|
anchors {
|
|
|
|
top: unredirectFullScreen.bottom
|
|
|
|
horizontalCenter: windowManagement.horizontalCenter
|
|
|
|
topMargin: 20
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ComboBox {
|
|
|
|
id: glSwapStrategy
|
|
|
|
model: [i18n("Never"), i18n("Automatic"), i18n("Only when cheap"), i18n("Full screen repaints"), i18n("Re-use screen content")]
|
|
|
|
currentIndex: compositing.glSwapStrategy
|
|
|
|
anchors {
|
|
|
|
top: glSwapStrategyText.bottom
|
|
|
|
left: col.right
|
|
|
|
right: parent.right
|
|
|
|
}
|
|
|
|
}
|
2013-09-11 12:34:29 +00:00
|
|
|
|
2013-09-12 11:55:25 +00:00
|
|
|
CheckBox {
|
|
|
|
id: glColorCorrection
|
2013-09-30 16:18:15 +00:00
|
|
|
text: i18n("Enable color correction \n(experimental)")
|
2013-09-12 11:55:25 +00:00
|
|
|
checked: compositing.glColorCorrection
|
|
|
|
enabled: openGLType.currentIndex != 3 && openGLType.currentIndex != 4
|
|
|
|
anchors {
|
|
|
|
top: glSwapStrategy.bottom
|
|
|
|
left: col.right
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-08-22 10:31:01 +00:00
|
|
|
ColumnLayout {
|
|
|
|
id: col
|
|
|
|
height: parent.height
|
2013-08-29 09:32:38 +00:00
|
|
|
Layout.minimumWidth: parent.width - windowManagement.width
|
2013-08-17 08:28:09 +00:00
|
|
|
|
|
|
|
anchors {
|
2013-08-22 10:31:01 +00:00
|
|
|
top: parent.top
|
2013-08-17 08:28:09 +00:00
|
|
|
left: parent.left
|
|
|
|
}
|
2013-09-10 08:47:16 +00:00
|
|
|
|
|
|
|
Label {
|
|
|
|
id: hint
|
|
|
|
text: i18n("Hint: To find out or configure how to activate an effect, look at the effect's settings.")
|
|
|
|
anchors {
|
|
|
|
top: parent.top
|
|
|
|
left: parent.left
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-09-10 07:54:46 +00:00
|
|
|
PlasmaComponents.TextField {
|
2013-08-22 10:31:01 +00:00
|
|
|
id: searchField
|
2013-09-10 07:54:46 +00:00
|
|
|
clearButtonShown: true
|
2013-08-17 08:28:09 +00:00
|
|
|
Layout.fillWidth: true
|
2013-08-22 10:31:01 +00:00
|
|
|
height: 20
|
|
|
|
anchors {
|
2013-09-10 08:47:16 +00:00
|
|
|
top: hint.bottom
|
2013-08-17 08:28:09 +00:00
|
|
|
}
|
2013-08-22 10:31:01 +00:00
|
|
|
focus: true
|
|
|
|
}
|
2013-08-17 08:28:09 +00:00
|
|
|
|
2013-08-22 10:31:01 +00:00
|
|
|
EffectFilterModel {
|
2013-08-27 18:21:07 +00:00
|
|
|
id: searchModel
|
2013-12-02 10:22:57 +00:00
|
|
|
objectName: "filterModel"
|
2013-08-22 10:31:01 +00:00
|
|
|
filter: searchField.text
|
2013-08-27 18:21:07 +00:00
|
|
|
signal effectState(int rowIndex, bool enabled)
|
|
|
|
|
|
|
|
onEffectState: {
|
2013-09-10 11:35:51 +00:00
|
|
|
searchModel.updateEffectStatus(rowIndex, enabled);
|
2013-08-27 18:21:07 +00:00
|
|
|
}
|
2013-08-17 08:28:09 +00:00
|
|
|
}
|
|
|
|
|
2013-08-22 10:31:01 +00:00
|
|
|
ScrollView {
|
|
|
|
id: scroll
|
|
|
|
highlightOnFocus: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.fillHeight: true
|
|
|
|
anchors {
|
|
|
|
top: searchField.bottom
|
|
|
|
left: parent.left
|
2013-12-02 10:22:57 +00:00
|
|
|
bottom: parent.bottom
|
2013-08-22 10:31:01 +00:00
|
|
|
}
|
|
|
|
ListView {
|
|
|
|
id: effectView
|
2013-09-13 10:34:40 +00:00
|
|
|
property color backgroundActiveColor: searchModel.backgroundActiveColor
|
|
|
|
property color backgroundNormalColor: searchModel.backgroundNormalColor
|
|
|
|
property color backgroundAlternateColor: searchModel.backgroundAlternateColor
|
2013-08-22 10:31:01 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
anchors.fill: parent
|
2013-08-27 10:10:31 +00:00
|
|
|
model: searchModel
|
2013-12-02 10:22:57 +00:00
|
|
|
delegate: Effect{
|
|
|
|
id: effectDelegate
|
|
|
|
Connections {
|
|
|
|
id: effectStateConnection
|
|
|
|
target: null
|
|
|
|
onChanged: searchModel.effectState(index, checked)
|
|
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
|
|
effectStateConnection.target = effectDelegate
|
|
|
|
}
|
|
|
|
}
|
2013-08-19 16:50:01 +00:00
|
|
|
|
2013-08-22 10:31:01 +00:00
|
|
|
section.property: "CategoryRole"
|
|
|
|
section.delegate: sectionHeading
|
|
|
|
}
|
2013-08-17 08:28:09 +00:00
|
|
|
}
|
|
|
|
|
2013-08-22 10:31:01 +00:00
|
|
|
ExclusiveGroup {
|
|
|
|
id: desktopSwitching
|
|
|
|
//Our ExclusiveGroup must me outside of the
|
|
|
|
//ListView, otherwise it will not work
|
2013-08-17 08:28:09 +00:00
|
|
|
}
|
2013-08-22 10:31:01 +00:00
|
|
|
|
|
|
|
}//End ColumnLayout
|
|
|
|
}//End RowLayout
|
2013-12-02 10:22:57 +00:00
|
|
|
Connections {
|
|
|
|
target: searchModel
|
|
|
|
onEffectState: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: openGLType
|
|
|
|
onCurrentIndexChanged: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: animationSpeed
|
|
|
|
onValueChanged: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: windowThumbnail
|
|
|
|
onCurrentIndexChanged: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: glScaleFilter
|
|
|
|
onCurrentIndexChanged: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: xrScaleFilter
|
|
|
|
onCurrentIndexChanged: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: unredirectFullScreen
|
|
|
|
onCheckedChanged: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: glSwapStrategy
|
|
|
|
onCurrentIndexChanged: changed()
|
|
|
|
}
|
|
|
|
Connections {
|
|
|
|
target: glColorCorrection
|
|
|
|
onCheckedChanged: changed()
|
|
|
|
}
|
2013-08-22 10:31:01 +00:00
|
|
|
}//End item
|