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 {
|
|
|
|
|
|
|
|
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
|
|
|
|
anchors.topMargin: col.height/2
|
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
|
|
|
|
onCurrentIndexChanged: apply.enabled = true
|
|
|
|
}
|
|
|
|
|
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-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: {
|
|
|
|
searchModel.effectStatus(rowIndex, enabled);
|
|
|
|
}
|
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
|
|
|
|
bottom: apply.top
|
|
|
|
}
|
|
|
|
ListView {
|
|
|
|
id: effectView
|
|
|
|
Layout.fillWidth: true
|
|
|
|
anchors.fill: parent
|
2013-08-27 10:10:31 +00:00
|
|
|
model: searchModel
|
|
|
|
delegate: Effect{}
|
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
|
|
|
|
|
|
|
Button {
|
|
|
|
id: apply
|
2013-09-10 08:41:42 +00:00
|
|
|
text: i18n("Apply")
|
2013-08-22 10:31:01 +00:00
|
|
|
enabled: false
|
|
|
|
anchors {
|
|
|
|
bottom: parent.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
onClicked: {
|
2013-08-27 18:21:07 +00:00
|
|
|
searchModel.syncConfig();
|
2013-08-22 10:31:01 +00:00
|
|
|
apply.enabled = false;
|
2013-08-29 16:58:51 +00:00
|
|
|
compositingType.syncConfig(openGLType.currentIndex);
|
2013-08-22 10:31:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}//End ColumnLayout
|
|
|
|
}//End RowLayout
|
|
|
|
}//End item
|