remove qmlpackages
belongs to kde-workspace
This commit is contained in:
parent
9e32090b50
commit
2b55808042
@ -89,4 +89,3 @@ endif(X11_FOUND)
|
|||||||
|
|
||||||
install(TARGETS plasma-shell ${INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS plasma-shell ${INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
|
|
||||||
add_subdirectory(qmlpackages)
|
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
|
|
||||||
plasma_install_package(desktop org.kde.desktop plasma/shells shell)
|
|
||||||
plasma_install_package(blank org.kde.blank plasma/shells shell)
|
|
||||||
plasma_install_package(lookandfeel org.kde.lookandfeel plasma/look-and-feel lookandfeel)
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
$XGETTEXT `find . -name \*.qml` -L Java -o $podir/plasma_shell_org.kde.desktop.pot
|
|
||||||
rm -f rc.cpp
|
|
@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property alias reason: messageText.text
|
|
||||||
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
id: icon
|
|
||||||
anchors.verticalCenter: parent
|
|
||||||
width: theme.hugeIconSize
|
|
||||||
height: width
|
|
||||||
source: "dialog-error"
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
id: messageText
|
|
||||||
anchors.verticalCenter: parent
|
|
||||||
width: parent.width - icon.width
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,68 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Window 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property Item applet
|
|
||||||
property Item compactRepresentation
|
|
||||||
|
|
||||||
|
|
||||||
onAppletChanged: {
|
|
||||||
applet.parent = appletParent
|
|
||||||
applet.anchors.fill = applet.parent
|
|
||||||
}
|
|
||||||
onCompactRepresentationChanged: {
|
|
||||||
compactRepresentation.parent = root
|
|
||||||
compactRepresentation.anchors.fill = root
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.Dialog {
|
|
||||||
id: popupWindow
|
|
||||||
//windowFlags: Qt.Popup
|
|
||||||
color: Qt.rgba(0,0,0,0)
|
|
||||||
visible: plasmoid.expanded
|
|
||||||
visualParent: root
|
|
||||||
mainItem: Item {
|
|
||||||
id: appletParent
|
|
||||||
|
|
||||||
width: applet && applet.implicitWidth > 0 ? applet.implicitWidth : theme.mSize(theme.defaultFont).width * 35
|
|
||||||
height: applet && applet.implicitHeight > 0 ? applet.implicitHeight : theme.mSize(theme.defaultFont).height * 25
|
|
||||||
onWidthChanged: applet.width = width
|
|
||||||
onHeightChanged: applet.height = height
|
|
||||||
}
|
|
||||||
|
|
||||||
onActiveWindowChanged: {
|
|
||||||
if (!activeWindow) {
|
|
||||||
// plasmoid.expanded = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (!visible) {
|
|
||||||
plasmoid.expanded = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
id: icon
|
|
||||||
|
|
||||||
source: plasmoid.icon ? plasmoid.icon : "plasma"
|
|
||||||
active: mouseArea.containsMouse
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: plasmoid.expanded = !plasmoid.expanded
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,237 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
|
|
||||||
|
|
||||||
//TODO: all of this will be done with desktop components
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property int _m: theme.defaultFont.pointSize
|
|
||||||
|
|
||||||
//BEGIN properties
|
|
||||||
color: syspal.window
|
|
||||||
width: 640
|
|
||||||
height: 480
|
|
||||||
//END properties
|
|
||||||
|
|
||||||
//BEGIN model
|
|
||||||
property ConfigModel globalConfigModel: globalAppletConfigModel
|
|
||||||
|
|
||||||
ConfigModel {
|
|
||||||
id: globalAppletConfigModel
|
|
||||||
ConfigCategory {
|
|
||||||
name: "Keyboard shortcuts"
|
|
||||||
icon: "preferences-desktop-keyboard"
|
|
||||||
source: "ConfigurationShortcuts.qml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END model
|
|
||||||
|
|
||||||
//BEGIN functions
|
|
||||||
function saveConfig() {
|
|
||||||
for (var key in plasmoid.configuration) {
|
|
||||||
if (main.currentPage["cfg_"+key] !== undefined) {
|
|
||||||
plasmoid.configuration[key] = main.currentPage["cfg_"+key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function restoreConfig() {
|
|
||||||
for (var key in plasmoid.configuration) {
|
|
||||||
if (main.currentPage["cfg_"+key] !== undefined) {
|
|
||||||
main.currentPage["cfg_"+key] = plasmoid.configuration[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END functions
|
|
||||||
|
|
||||||
|
|
||||||
//BEGIN connections
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (configDialog.configModel && configDialog.configModel.count > 0) {
|
|
||||||
main.sourceFile = configDialog.configModel.get(0).source
|
|
||||||
} else {
|
|
||||||
main.sourceFile = globalConfigModel.get(0).source
|
|
||||||
}
|
|
||||||
root.restoreConfig()
|
|
||||||
// root.width = mainColumn.implicitWidth
|
|
||||||
// root.height = mainColumn.implicitHeight
|
|
||||||
}
|
|
||||||
//END connections
|
|
||||||
|
|
||||||
//BEGIN UI components
|
|
||||||
SystemPalette {id: syspal}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: mainColumn
|
|
||||||
anchors.fill: parent
|
|
||||||
property int implicitWidth: Math.max(contentRow.implicitWidth, buttonsRow.implicitWidth) + 8
|
|
||||||
property int implicitHeight: contentRow.implicitHeight + buttonsRow.implicitHeight + 8
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: contentRow
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.preferredHeight: parent.height - buttonsRow.height
|
|
||||||
|
|
||||||
QtControls.ScrollView{
|
|
||||||
id: categoriesScroll
|
|
||||||
frameVisible: true
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
visible: (configDialog.configModel ? configDialog.configModel.count : 0) + globalConfigModel.count > 1
|
|
||||||
width: visible ? 100 : 0
|
|
||||||
implicitWidth: width
|
|
||||||
Flickable {
|
|
||||||
id: categoriesView
|
|
||||||
contentWidth: width
|
|
||||||
contentHeight: childrenRect.height
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
property Item currentItem
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: categories
|
|
||||||
width: parent.width
|
|
||||||
height: Math.max(categoriesView.height, categoriesColumn.height)
|
|
||||||
color: syspal.base
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
color: syspal.highlight
|
|
||||||
width: parent.width
|
|
||||||
height: theme.iconSizes.IconSizeHuge
|
|
||||||
y: index * height
|
|
||||||
Behavior on y {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 250
|
|
||||||
easing.type: "InOutQuad"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
id: categoriesColumn
|
|
||||||
width: parent.width
|
|
||||||
Repeater {
|
|
||||||
model: configDialog.configModel
|
|
||||||
delegate: ConfigCategoryDelegate {
|
|
||||||
onClicked: categoriesView.currentIndex = index
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Repeater {
|
|
||||||
model: globalConfigModel
|
|
||||||
delegate: ConfigCategoryDelegate {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.ScrollView{
|
|
||||||
id: pageScroll
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Flickable {
|
|
||||||
contentWidth: width
|
|
||||||
contentHeight: main.height
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: childrenRect.height
|
|
||||||
QtControls.StackView {
|
|
||||||
id: main
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 12
|
|
||||||
property string sourceFile
|
|
||||||
Timer {
|
|
||||||
id: pageSizeSync
|
|
||||||
interval: 100
|
|
||||||
onTriggered: {
|
|
||||||
// root.width = mainColumn.implicitWidth
|
|
||||||
// root.height = mainColumn.implicitHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onImplicitWidthChanged: pageSizeSync.restart()
|
|
||||||
onImplicitHeightChanged: pageSizeSync.restart()
|
|
||||||
onSourceFileChanged: {
|
|
||||||
print("Source file changed in flickable" + sourceFile);
|
|
||||||
replace(Qt.resolvedUrl(sourceFile))
|
|
||||||
/*
|
|
||||||
* This is not needed on a desktop shell that has ok/apply/cancel buttons, i'll leave it here only for future reference until we have a prototype for the active shell.
|
|
||||||
* root.pageChanged will start a timer, that in turn will call saveConfig() when triggered
|
|
||||||
|
|
||||||
for (var prop in currentPage) {
|
|
||||||
if (prop.indexOf("cfg_") === 0) {
|
|
||||||
currentPage[prop+"Changed"].connect(root.pageChanged)
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
RowLayout {
|
|
||||||
id: buttonsRow
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: spacing
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconSource: "dialog-ok"
|
|
||||||
text: "Ok"
|
|
||||||
onClicked: {
|
|
||||||
if (main.currentPage.saveConfig !== undefined) {
|
|
||||||
main.currentPage.saveConfig()
|
|
||||||
} else {
|
|
||||||
root.saveConfig()
|
|
||||||
}
|
|
||||||
configDialog.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconSource: "dialog-ok-apply"
|
|
||||||
text: "Apply"
|
|
||||||
onClicked: {
|
|
||||||
if (main.currentPage.saveConfig !== undefined) {
|
|
||||||
main.currentPage.saveConfig()
|
|
||||||
} else {
|
|
||||||
root.saveConfig()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconSource: "dialog-cancel"
|
|
||||||
text: "Cancel"
|
|
||||||
onClicked: configDialog.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END UI components
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: delegate
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
//BEGIN properties
|
|
||||||
width: childrenRect.width
|
|
||||||
height: childrenRect.height
|
|
||||||
property bool current: model.source == main.sourceFile
|
|
||||||
//END properties
|
|
||||||
|
|
||||||
//BEGIN connections
|
|
||||||
onClicked: {
|
|
||||||
print("model source: " + model.source + " " + main.sourceFile);
|
|
||||||
if (delegate.current) {
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
if (typeof(categoriesView.currentIndex) != "undefined") {
|
|
||||||
categoriesView.currentIndex = index;
|
|
||||||
}
|
|
||||||
main.sourceFile = model.source
|
|
||||||
root.restoreConfig()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onCurrentChanged: {
|
|
||||||
if (current) {
|
|
||||||
categoriesView.currentIndex = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END connections
|
|
||||||
|
|
||||||
//BEGIN UI components
|
|
||||||
Column {
|
|
||||||
spacing: 4
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
topMargin: _m
|
|
||||||
}
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
width: theme.IconSizeHuge
|
|
||||||
height: width
|
|
||||||
source: model.icon
|
|
||||||
}
|
|
||||||
QtControls.Label {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
text: model.name
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END UI components
|
|
||||||
}
|
|
@ -1,30 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
|
|
||||||
Item {
|
|
||||||
implicitWidth: childrenRect.width
|
|
||||||
implicitHeight: childrenRect.height
|
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: "Containment actions go here"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,133 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
|
|
||||||
Column {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
spacing: _m
|
|
||||||
PlasmaExtras.Title {
|
|
||||||
text: "Plugins"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//BEGIN functions
|
|
||||||
function saveConfig() {
|
|
||||||
for (var key in configDialog.wallpaperConfiguration) {
|
|
||||||
if (main.currentPage["cfg_"+key] !== undefined) {
|
|
||||||
configDialog.wallpaperConfiguration[key] = main.currentPage["cfg_"+key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
configDialog.applyWallpaper()
|
|
||||||
}
|
|
||||||
|
|
||||||
function restoreConfig() {
|
|
||||||
for (var key in configDialog.wallpaperConfiguration) {
|
|
||||||
if (main.currentPage["cfg_"+key] !== undefined) {
|
|
||||||
main.currentPage["cfg_"+key] = configDialog.wallpaperConfiguration[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END functions
|
|
||||||
|
|
||||||
ListView {
|
|
||||||
id: categoriesView
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
height: 100
|
|
||||||
orientation: ListView.Horizontal
|
|
||||||
|
|
||||||
model: configDialog.wallpaperConfigModel
|
|
||||||
delegate: ConfigCategoryDelegate {
|
|
||||||
id: delegate
|
|
||||||
current: categoriesView.currentIndex == index
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
width: 64
|
|
||||||
onClicked: {
|
|
||||||
configDialog.currentWallpaper = model.pluginName
|
|
||||||
if (categoriesView.currentIndex == index) {
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
categoriesView.currentIndex = index;
|
|
||||||
main.sourceFile = model.source
|
|
||||||
root.restoreConfig()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onCurrentChanged: {
|
|
||||||
categoriesView.currentIndex = index
|
|
||||||
if (current) {
|
|
||||||
categoriesView.currentIndex = index
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (configDialog.currentWallpaper == model.pluginName) {
|
|
||||||
loadWallpaperTimer.pendingCurrent = model
|
|
||||||
loadWallpaperTimer.restart()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
highlight: Rectangle {
|
|
||||||
color: theme.highlightColor
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: loadWallpaperTimer
|
|
||||||
interval: 100
|
|
||||||
property variant pendingCurrent
|
|
||||||
onTriggered: {
|
|
||||||
if (pendingCurrent) {
|
|
||||||
categoriesView.currentIndex = pendingCurrent.index
|
|
||||||
main.sourceFile = pendingCurrent.source
|
|
||||||
root.restoreConfig()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.PageStack {
|
|
||||||
id: main
|
|
||||||
anchors {
|
|
||||||
left: categoriesView.left;
|
|
||||||
right: parent.right;
|
|
||||||
}
|
|
||||||
width: implicitWidth
|
|
||||||
height: implicitHeight
|
|
||||||
property string sourceFile
|
|
||||||
onSourceFileChanged: {
|
|
||||||
if (sourceFile != "") {
|
|
||||||
main.opacity = 1;
|
|
||||||
replace(Qt.resolvedUrl(sourceFile))
|
|
||||||
//main.width = mainColumn.implicitWidth
|
|
||||||
main.height = mainColumn.implicitHeight
|
|
||||||
} else {
|
|
||||||
main.opacity = 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Behavior on opacity { NumberAnimation {} }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: iconsPage
|
|
||||||
width: childrenRect.width
|
|
||||||
height: childrenRect.height
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
iconSource: "settings"
|
|
||||||
text: "None"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
|
|
||||||
|
|
||||||
AppletConfiguration {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
//BEGIN model
|
|
||||||
globalConfigModel: globalContainmentConfigModel
|
|
||||||
|
|
||||||
ConfigModel {
|
|
||||||
id: globalContainmentConfigModel
|
|
||||||
ConfigCategory {
|
|
||||||
name: "Appearance"
|
|
||||||
icon: "preferences-desktop-wallpaper"
|
|
||||||
source: "ConfigurationContainmentAppearance.qml"
|
|
||||||
}
|
|
||||||
ConfigCategory {
|
|
||||||
name: "Mouse Actions"
|
|
||||||
icon: "preferences-desktop-mouse"
|
|
||||||
source: "ConfigurationContainmentActions.qml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END model
|
|
||||||
|
|
||||||
}
|
|
@ -1,186 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
import "panelconfiguration"
|
|
||||||
|
|
||||||
|
|
||||||
//TODO: all of this will be done with desktop components
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: dialogRoot
|
|
||||||
|
|
||||||
//BEGIN Properties
|
|
||||||
width: 640
|
|
||||||
height: 64
|
|
||||||
imagePath: "dialogs/background"
|
|
||||||
|
|
||||||
state: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case 3:
|
|
||||||
return "TopEdge"
|
|
||||||
//LeftEdge
|
|
||||||
case 5:
|
|
||||||
return "LeftEdge"
|
|
||||||
//RightEdge
|
|
||||||
case 6:
|
|
||||||
return "RightEdge"
|
|
||||||
//BottomEdge
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
return "BottomEdge"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool vertical: (panel.location == 5 || panel.location == 6)
|
|
||||||
//END properties
|
|
||||||
|
|
||||||
//BEGIN Connections
|
|
||||||
Connections {
|
|
||||||
target: panel
|
|
||||||
onOffsetChanged: ruler.offset = panel.offset
|
|
||||||
onMinimumLengthChanged: ruler.minimumLength = panel.minimumLength
|
|
||||||
onMaximumLengthChanged: ruler.maximumLength = panel.maximumLength
|
|
||||||
}
|
|
||||||
//END Connections
|
|
||||||
|
|
||||||
|
|
||||||
//BEGIN UI components
|
|
||||||
|
|
||||||
Ruler {
|
|
||||||
id: ruler
|
|
||||||
state: dialogRoot.state
|
|
||||||
}
|
|
||||||
|
|
||||||
ToolBar {
|
|
||||||
id: toolBar
|
|
||||||
}
|
|
||||||
//END UI components
|
|
||||||
|
|
||||||
//BEGIN Animations
|
|
||||||
//when EdgeHandle is released animate to old panel position
|
|
||||||
ParallelAnimation {
|
|
||||||
id: panelResetAnimation
|
|
||||||
NumberAnimation {
|
|
||||||
target: panel
|
|
||||||
properties: (panel.location == 5 || panel.location == 6) ? "x" : "y"
|
|
||||||
to: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case 3:
|
|
||||||
return 0
|
|
||||||
break
|
|
||||||
//LeftEdge
|
|
||||||
case 5:
|
|
||||||
return 0
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case 6:
|
|
||||||
return panel.screenGeometry.x + panel.screenGeometry.width - panel.width
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
return panel.screenGeometry.y + panel.screenGeometry.height - panel.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
duration: 150
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: configDialog
|
|
||||||
properties: (panel.location == 5 || panel.location == 6) ? "x" : "y"
|
|
||||||
to: {
|
|
||||||
panel.height
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case 3:
|
|
||||||
return panel.height
|
|
||||||
break
|
|
||||||
//LeftEdge
|
|
||||||
case 5:
|
|
||||||
return panel.width
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case 6:
|
|
||||||
return panel.screenGeometry.x + panel.screenGeometry.width - panel.width - configDialog.width
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
return panel.screenGeometry.y + panel.screenGeometry.height - panel.height - configDialog.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
duration: 150
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END Animations
|
|
||||||
|
|
||||||
//BEGIN States
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "TopBorder|BottomBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitHeight: ruler.implicitHeight + toolBar.implicitHeight
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "TopBorder|BottomBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitHeight: ruler.implicitHeight + toolBar.implicitHeight
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "LeftBorder|RightBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitWidth: ruler.implicitWidth + toolBar.implicitWidth
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "LeftBorder|RightBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitWidth: ruler.implicitWidth + toolBar.implicitWidth
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
//END States
|
|
||||||
}
|
|
@ -1,112 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
flat: false
|
|
||||||
text: "Screen edge"
|
|
||||||
|
|
||||||
QtExtras.MouseEventListener {
|
|
||||||
anchors.fill: parent
|
|
||||||
property int lastX
|
|
||||||
property int lastY
|
|
||||||
property int startMouseX
|
|
||||||
property int startMouseY
|
|
||||||
onPressed: {
|
|
||||||
lastX = mouse.screenX
|
|
||||||
lastY = mouse.screenY
|
|
||||||
startMouseX = mouse.x
|
|
||||||
startMouseY = mouse.y
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case 3:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.y = configDialog.y - panel.height
|
|
||||||
break
|
|
||||||
//LeftEdge
|
|
||||||
case 5:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.x = configDialog.x - panel.width
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case 6:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.x = configDialog.x + configDialog.width
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.y = configDialog.y + configDialog.height
|
|
||||||
}
|
|
||||||
|
|
||||||
lastX = mouse.screenX
|
|
||||||
lastY = mouse.screenY
|
|
||||||
|
|
||||||
var screenAspect = panel.screenGeometry.height / panel.screenGeometry.width
|
|
||||||
var newLocation = panel.location
|
|
||||||
|
|
||||||
//If the mouse is in an internal rectangle, do nothing
|
|
||||||
if ((mouse.screenX > panel.screenGeometry.x + panel.screenGeometry.width/3 &&
|
|
||||||
mouse.screenX < panel.screenGeometry.x + panel.screenGeometry.width/3*2) &&
|
|
||||||
(mouse.screenY > panel.screenGeometry.y + panel.screenGeometry.height/3 &&
|
|
||||||
mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height/3*2)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mouse.screenY < panel.screenGeometry.y+(mouse.screenX-panel.screenGeometry.x)*screenAspect) {
|
|
||||||
if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) {
|
|
||||||
if (panel.location == 3) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = 3; //FIXME: Plasma::TopEdge;
|
|
||||||
}
|
|
||||||
} else if (panel.location == 6) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = 6; //FIXME: Plasma::RightEdge;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) {
|
|
||||||
if (panel.location == 5) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = 5; //FIXME: Plasma::LeftEdge;
|
|
||||||
}
|
|
||||||
} else if(panel.location == 4) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = 4; //FIXME: Plasma::BottomEdge;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
panel.location = newLocation
|
|
||||||
print("New Location: " + newLocation);
|
|
||||||
}
|
|
||||||
onReleased: panelResetAnimation.running = true
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,352 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property alias offset: offsetHandle.value
|
|
||||||
property alias minimumLength: minimumLengthHandle.value
|
|
||||||
property alias maximumLength: maximumLengthHandle.value
|
|
||||||
|
|
||||||
imagePath: "widgets/containment-controls"
|
|
||||||
state: "BottomEdge"
|
|
||||||
implicitWidth: offsetHandle.width + minimumLengthHandle.width
|
|
||||||
implicitHeight: offsetHandle.height + minimumLengthHandle.height
|
|
||||||
|
|
||||||
onMinimumLengthChanged: leftMinimumLengthHandle.value = minimumLength
|
|
||||||
onMaximumLengthChanged: leftMaximumLengthHandle.value = maximumLength
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
offsetHandle.value = panel.offset
|
|
||||||
minimumLengthHandle.value = panel.minimumLength
|
|
||||||
maximumLengthHandle.value = panel.maximumLength
|
|
||||||
leftMinimumLengthHandle.value = panel.minimumLength
|
|
||||||
leftMaximumLengthHandle.value = panel.maximumLength
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.Svg {
|
|
||||||
id: containmentControlsSvg
|
|
||||||
imagePath: "widgets/containment-controls"
|
|
||||||
}
|
|
||||||
PlasmaCore.SvgItem {
|
|
||||||
id: centerMark
|
|
||||||
svg: containmentControlsSvg
|
|
||||||
elementId: dialogRoot.vertical ? "vertical-centerindicator" : "horizontal-centerindicator"
|
|
||||||
visible: panel.alignment == Qt.AlignCenter
|
|
||||||
width: dialogRoot.vertical ? parent.width : naturalSize.width
|
|
||||||
height: dialogRoot.vertical ? naturalSize.height : parent.height
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
SliderHandle {
|
|
||||||
id: offsetHandle
|
|
||||||
graphicElementName: "offsetslider"
|
|
||||||
onValueChanged: panel.offset = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: minimumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignLeft
|
|
||||||
visible: panel.alignment != Qt.AlignRight
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "minslider"
|
|
||||||
onValueChanged: panel.minimumLength = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: maximumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignLeft
|
|
||||||
visible: panel.alignment != Qt.AlignRight
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "maxslider"
|
|
||||||
onValueChanged: panel.maximumLength = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: leftMinimumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignRight
|
|
||||||
visible: panel.alignment != Qt.AlignLeft
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "maxslider"
|
|
||||||
onValueChanged: panel.minimumLength = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: leftMaximumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignRight
|
|
||||||
visible: panel.alignment != Qt.AlignLeft
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "minslider"
|
|
||||||
onValueChanged: panel.maximumLength = value
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "north"
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: undefined
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "south"
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "west"
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: root.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: root.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "east"
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: undefined
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
flat: false
|
|
||||||
text: "Height"
|
|
||||||
QtExtras.MouseEventListener {
|
|
||||||
anchors.fill: parent
|
|
||||||
property int startMouseX
|
|
||||||
property int startMouseY
|
|
||||||
onPressed: {
|
|
||||||
startMouseX = mouse.x
|
|
||||||
startMouseY = mouse.y
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case 3:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.thickness = configDialog.y - panel.y
|
|
||||||
break;
|
|
||||||
//LeftEdge
|
|
||||||
case 5:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.thickness = configDialog.x - panel.x
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case 6:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.thickness = (panel.x + panel.width) - (configDialog.x + configDialog.width)
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.thickness = (panel.y + panel.height) - (configDialog.y + configDialog.height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,166 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.SvgItem {
|
|
||||||
id: root
|
|
||||||
svg: containmentControlsSvg
|
|
||||||
state: parent.state
|
|
||||||
width: naturalSize.width
|
|
||||||
height: naturalSize.height
|
|
||||||
|
|
||||||
//value expressed by this slider
|
|
||||||
property int value
|
|
||||||
//name of the graphics to load
|
|
||||||
property string graphicElementName
|
|
||||||
//where the point "0" is
|
|
||||||
property int offset: 0
|
|
||||||
//handle type: behave in different ways based on the alignment
|
|
||||||
property int alignment: panel.alignment
|
|
||||||
|
|
||||||
function syncPos() {
|
|
||||||
if (dialogRoot.vertical) {
|
|
||||||
if (alignment == Qt.AlignRight) {
|
|
||||||
y = root.parent.height - (value + offset + root.height/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
y = value + offset - root.height/2
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
y = root.parent.height/2 - value/2 - offset + root.height/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
y = root.parent.height/2 + value/2 + offset - root.height/2
|
|
||||||
} else {
|
|
||||||
y = root.parent.height/2 + value + offset -root.height/2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (alignment == Qt.AlignRight) {
|
|
||||||
x = root.parent.width - (value + offset + root.width/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
x = value + offset - root.width/2
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
x = root.parent.width/2 - value/2 + offset - root.width/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
x = root.parent.width/2 + value/2 + offset -root.width/2
|
|
||||||
} else {
|
|
||||||
x = root.parent.width/2 + value + offset -root.width/2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onValueChanged: syncPos()
|
|
||||||
onOffsetChanged: syncPos()
|
|
||||||
onAlignmentChanged: syncPos()
|
|
||||||
Connections {
|
|
||||||
target: root.parent
|
|
||||||
onWidthChanged: syncPos()
|
|
||||||
onHeightChanged: syncPos()
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
drag {
|
|
||||||
target: parent
|
|
||||||
axis: (dialogRoot.vertical) ? Drag.YAxis : Drag.XAxis
|
|
||||||
}
|
|
||||||
anchors.fill: parent
|
|
||||||
onPositionChanged: {
|
|
||||||
if (dialogRoot.vertical) {
|
|
||||||
if (root.alignment == Qt.AlignRight) {
|
|
||||||
root.value = root.parent.height - (parent.y + offset + root.height/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
root.value = parent.y - offset + root.height/2
|
|
||||||
//Center
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
root.value = (root.parent.height/2 - parent.y + offset)*2 + root.height/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
root.value = (parent.y - offset - root.parent.height/2)*2 + root.height/2
|
|
||||||
} else {
|
|
||||||
var value = parent.y - root.parent.height/2 - offset + root.height/2
|
|
||||||
//Snap
|
|
||||||
if (Math.abs(value) < 5) {
|
|
||||||
root.value = 0
|
|
||||||
} else {
|
|
||||||
root.value = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (root.alignment == Qt.AlignRight) {
|
|
||||||
root.value = root.parent.width - (parent.x + offset + root.width/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
root.value = parent.x - offset + root.width/2
|
|
||||||
//Center
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
root.value = (root.parent.width/2 - parent.x + offset)*2 + root.width/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
root.value = (parent.x - offset - root.parent.width/2)*2 + root.width/2
|
|
||||||
} else {
|
|
||||||
var value = parent.x - root.parent.width/2 - offset + root.width/2
|
|
||||||
//Snap
|
|
||||||
if (Math.abs(value) < 5) {
|
|
||||||
root.value = 0
|
|
||||||
} else {
|
|
||||||
root.value = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "north-" + graphicElementName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "south-" + graphicElementName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "west-" + graphicElementName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "east-" + graphicElementName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,232 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
state: parent.state
|
|
||||||
implicitWidth: childrenRect.width + 20
|
|
||||||
implicitHeight: childrenRect.height + 20
|
|
||||||
PlasmaComponents.ButtonRow {
|
|
||||||
id: row
|
|
||||||
spacing: 0
|
|
||||||
exclusive: false
|
|
||||||
visible: !dialogRoot.vertical
|
|
||||||
anchors {
|
|
||||||
centerIn: parent
|
|
||||||
}
|
|
||||||
EdgeHandle {
|
|
||||||
id: edgeHandle
|
|
||||||
}
|
|
||||||
SizeHandle {
|
|
||||||
id: sizeHandle
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//FIXME: remove this duplication, use desktopcomponents linear layouts that can switch between horizontal and vertical
|
|
||||||
PlasmaComponents.ButtonColumn {
|
|
||||||
id: column
|
|
||||||
spacing: 0
|
|
||||||
exclusive: false
|
|
||||||
visible: dialogRoot.vertical
|
|
||||||
anchors {
|
|
||||||
centerIn: parent
|
|
||||||
}
|
|
||||||
EdgeHandle {
|
|
||||||
width: 80
|
|
||||||
}
|
|
||||||
SizeHandle {
|
|
||||||
width: 80
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: moreSettingsButton
|
|
||||||
property QtObject contextMenu
|
|
||||||
text: "More settings"
|
|
||||||
onClicked: {
|
|
||||||
if (!contextMenu) {
|
|
||||||
contextMenu = contextMenuComponent.createObject(moreSettingsButton)
|
|
||||||
}
|
|
||||||
contextMenu.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: contextMenuComponent
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
visualParent: moreSettingsButton
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
id: leftToggle
|
|
||||||
text: "Left"
|
|
||||||
checkable: true
|
|
||||||
checked: panel.alignment == Qt.AlignLeft
|
|
||||||
onClicked: panel.alignment = Qt.AlignLeft
|
|
||||||
onToggled: {
|
|
||||||
if (checked) {
|
|
||||||
centerToggle.checked = false
|
|
||||||
rightToggle.checked = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
id: centerToggle
|
|
||||||
text: "Center"
|
|
||||||
checkable: true
|
|
||||||
checked: panel.alignment == Qt.AlignCenter
|
|
||||||
onClicked: panel.alignment = Qt.AlignCenter
|
|
||||||
onToggled: {
|
|
||||||
if (checked) {
|
|
||||||
leftToggle.checked = false
|
|
||||||
rightToggle.checked = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
id: rightToggle
|
|
||||||
text: "Right"
|
|
||||||
checkable: true
|
|
||||||
checked: panel.alignment == Qt.AlignRight
|
|
||||||
onClicked: panel.alignment = Qt.AlignRight
|
|
||||||
onToggled: {
|
|
||||||
if (checked) {
|
|
||||||
centerToggle.checked = false
|
|
||||||
leftToggle.checked = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//BEGIN States
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: root.verticalCenter
|
|
||||||
horizontalCenter: undefined
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: undefined
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: root.verticalCenter
|
|
||||||
horizontalCenter: undefined
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: undefined
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: undefined
|
|
||||||
horizontalCenter: root.verticalCenter
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: undefined
|
|
||||||
horizontalCenter: root.verticalCenter
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
//END States
|
|
||||||
}
|
|
@ -1,17 +0,0 @@
|
|||||||
[Desktop]
|
|
||||||
Containment=org.kde.desktopcontainment
|
|
||||||
ToolBox=org.kde.desktoptoolbox
|
|
||||||
RuntimePlatform=
|
|
||||||
|
|
||||||
[Desktop][ContainmentActions]
|
|
||||||
Ctrl;LeftButton=org.kde.standardmenu
|
|
||||||
MiddleButton=org.kde.paste
|
|
||||||
|
|
||||||
[Panel]
|
|
||||||
Containment=org.kde.panel
|
|
||||||
ToolBox=org.kde.paneltoolbox
|
|
||||||
[Panel][ContainmentActions]
|
|
||||||
Ctrl;LeftButton=org.kde.standardmenu
|
|
||||||
|
|
||||||
[Theme]
|
|
||||||
Theme=default
|
|
@ -1,197 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.draganddrop 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: background
|
|
||||||
width: list.delegateWidth
|
|
||||||
height: list.delegateHeight
|
|
||||||
|
|
||||||
property variant icon: decoration
|
|
||||||
property string title: name
|
|
||||||
property string description: model.description
|
|
||||||
property string author: model.author
|
|
||||||
property string email: model.email
|
|
||||||
property string license: model.license
|
|
||||||
property string pluginName: model.pluginName
|
|
||||||
property bool local: model.local
|
|
||||||
|
|
||||||
ListView.onRemove: SequentialAnimation {
|
|
||||||
PropertyAction {
|
|
||||||
target: background
|
|
||||||
property: "ListView.delayRemove"
|
|
||||||
value: true
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "y" : "x"
|
|
||||||
to: widgetExplorer.orientation == Qt.Horizontal ? list.delegateHeight : list.delegateWidth
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "y" : "x"
|
|
||||||
to: widgetExplorer.orientation == Qt.Horizontal ? list.delegateHeight : list.delegateWidth
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "width" : "height"
|
|
||||||
from: widgetExplorer.orientation == Qt.Horizontal ? list.delegateWidth : list.delegateHeight
|
|
||||||
to: 0
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
PropertyAction {
|
|
||||||
target: background
|
|
||||||
property: "ListView.delayRemove"
|
|
||||||
value: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListView.onAdd: SequentialAnimation {
|
|
||||||
PropertyAction {
|
|
||||||
target: background
|
|
||||||
property: "y"
|
|
||||||
value: widgetExplorer.orientation == Qt.Horizontal ? -list.delegateHeight : -list.delegateWidth
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "width" : "height"
|
|
||||||
from: 0
|
|
||||||
to: widgetExplorer.orientation == Qt.Horizontal ? list.delegateWidth : list.delegateHeight
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "y" : "x"
|
|
||||||
to: 0
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
imagePath: "widgets/viewitem"
|
|
||||||
prefix: "normal"
|
|
||||||
|
|
||||||
DragArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
supportedActions: Qt.MoveAction | Qt.LinkAction
|
|
||||||
onDragStarted: tooltipDialog.visible = false
|
|
||||||
delegateImage: background.icon
|
|
||||||
mimeData {
|
|
||||||
source: parent
|
|
||||||
}
|
|
||||||
Component.onCompleted: mimeData.setData("text/x-plasmoidservicename", pluginName)
|
|
||||||
|
|
||||||
QIconItem {
|
|
||||||
id: iconWidget
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
x: y
|
|
||||||
width: theme.hugeIconSize
|
|
||||||
height: width
|
|
||||||
icon: background.icon
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
anchors {
|
|
||||||
left: iconWidget.right
|
|
||||||
right: parent.right
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
leftMargin: background.margins.left
|
|
||||||
rightMargin: background.margins.right
|
|
||||||
}
|
|
||||||
spacing: 4
|
|
||||||
PlasmaExtras.Heading {
|
|
||||||
id: titleText
|
|
||||||
level: 4
|
|
||||||
text: title
|
|
||||||
// font {
|
|
||||||
// weight: Font.Bold
|
|
||||||
// pointSize: theme.smallestFont.pointSize
|
|
||||||
// }
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
height: paintedHeight
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
//go with nowrap only if there is a single word too long
|
|
||||||
onPaintedWidthChanged: {
|
|
||||||
wrapTimer.restart()
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: wrapTimer
|
|
||||||
interval: 200
|
|
||||||
onTriggered: {
|
|
||||||
//give it some pixels of tolerance
|
|
||||||
if (titleText.paintedWidth > titleText.width + 3) {
|
|
||||||
titleText.wrapMode = Text.NoWrap
|
|
||||||
titleText.elide = Text.ElideRight
|
|
||||||
} else {
|
|
||||||
titleText.wrapMode = Text.WordWrap
|
|
||||||
titleText.elide = Text.ElideNone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: description
|
|
||||||
font.pointSize: theme.smallestFont.pointSize
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
//elide: Text.ElideRight
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
verticalAlignment: Text.AlignTop
|
|
||||||
maximumLineCount: 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QIconItem {
|
|
||||||
icon: running ? "dialog-ok-apply" : undefined
|
|
||||||
visible: running
|
|
||||||
width: theme.smallIconSize
|
|
||||||
height: width
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
rightMargin: background.margins.right
|
|
||||||
bottomMargin: background.margins.bottom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onDoubleClicked: widgetExplorer.addApplet(pluginName)
|
|
||||||
onEntered: tooltipDialog.appletDelegate = background
|
|
||||||
onExited: tooltipDialog.appletDelegate = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Sebastian Kügler <sebas@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
//import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
//import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
color: "pink"
|
|
||||||
width: 400
|
|
||||||
height: 800
|
|
||||||
|
|
||||||
ListView {
|
|
||||||
anchors.fill: parent
|
|
||||||
model: widgetExplorer.widgetsModel
|
|
||||||
header: PlasmaExtras.Title { text: "Add Widgets" }
|
|
||||||
delegate: Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
Text { text: "Applet: " + pluginName }
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: widgetExplorer.addApplet(pluginName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
print("WidgetExplorer QML loaded");
|
|
||||||
print(" found " + widgetExplorer.widgetsModel.count + " widgets");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,142 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.qtextracomponents 2.0
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: main
|
|
||||||
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: toolTipHideTimer.running = false
|
|
||||||
onExited: toolTipHideTimer.running = true
|
|
||||||
|
|
||||||
width: childrenRect.width
|
|
||||||
height: 200
|
|
||||||
|
|
||||||
property variant icon
|
|
||||||
property string title
|
|
||||||
property string description
|
|
||||||
property string author
|
|
||||||
property string email
|
|
||||||
property string license
|
|
||||||
property string pluginName
|
|
||||||
property bool local
|
|
||||||
|
|
||||||
onClicked: tooltipDialog.visible = false
|
|
||||||
Connections {
|
|
||||||
target: tooltipDialog
|
|
||||||
onAppletDelegateChanged: {
|
|
||||||
if (!tooltipDialog.appletDelegate) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
icon = tooltipDialog.appletDelegate.icon
|
|
||||||
title = tooltipDialog.appletDelegate.title
|
|
||||||
description = tooltipDialog.appletDelegate.description
|
|
||||||
author = tooltipDialog.appletDelegate.author
|
|
||||||
email = tooltipDialog.appletDelegate.email
|
|
||||||
license = tooltipDialog.appletDelegate.license
|
|
||||||
pluginName = tooltipDialog.appletDelegate.pluginName
|
|
||||||
local = tooltipDialog.appletDelegate.local
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QIconItem {
|
|
||||||
id: tooltipIconWidget
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.top: parent.top
|
|
||||||
width: theme.hugeIconSize
|
|
||||||
height: width
|
|
||||||
icon: main.icon
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
id: nameColumn
|
|
||||||
spacing: 8
|
|
||||||
anchors {
|
|
||||||
left: tooltipIconWidget.right
|
|
||||||
leftMargin: 8
|
|
||||||
top: parent.top
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: title
|
|
||||||
font.bold:true
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
height: paintedHeight
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: description
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Grid {
|
|
||||||
anchors.top: tooltipIconWidget.bottom
|
|
||||||
anchors.topMargin: 16
|
|
||||||
anchors.bottom: uninstallButton.top
|
|
||||||
anchors.bottomMargin: 4
|
|
||||||
rows: 3
|
|
||||||
columns: 2
|
|
||||||
spacing: 4
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: i18n("License:")
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
id: licenseText
|
|
||||||
text: license
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: i18n("Author:")
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: author
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: i18n("Email:")
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: email
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: uninstallButton
|
|
||||||
anchors {
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
opacity: local ? 1 : 0
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
iconSource: "application-exit"
|
|
||||||
text: i18n("Uninstall")
|
|
||||||
onClicked: {
|
|
||||||
widgetExplorer.uninstall(pluginName)
|
|
||||||
tooltipDialog.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,378 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.qtextracomponents 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: main
|
|
||||||
|
|
||||||
width: 240
|
|
||||||
height: 800
|
|
||||||
//this is used to perfectly align the filter field and delegates
|
|
||||||
property int cellWidth: theme.defaultFont.pixelSize * 20
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
imagePath: "dialogs/background"
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: margins
|
|
||||||
//color: "orange"
|
|
||||||
//opacity: 0.3
|
|
||||||
}
|
|
||||||
|
|
||||||
property int minimumWidth: cellWidth + (
|
|
||||||
widgetExplorer.orientation == Qt.Horizontal
|
|
||||||
? 0
|
|
||||||
: (scrollBar.width + 4 * 2) // 4 * 2 == left and right margins
|
|
||||||
)
|
|
||||||
property int minimumHeight: topBar.height + list.delegateHeight + (widgetExplorer.orientation == Qt.Horizontal ? scrollBar.height : 0) + 4
|
|
||||||
|
|
||||||
property Item getWidgetsButton
|
|
||||||
property Item categoryButton
|
|
||||||
|
|
||||||
function i18n(inp) { return inp; }
|
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
id: categoriesDialog
|
|
||||||
visualParent: main.categoryButton
|
|
||||||
}
|
|
||||||
Repeater {
|
|
||||||
parent: categoriesDialog
|
|
||||||
model: widgetExplorer.filterModel
|
|
||||||
delegate: PlasmaComponents.MenuItem {
|
|
||||||
text: display
|
|
||||||
separator: model["separator"] != undefined ? model["separator"] : false
|
|
||||||
onClicked: {
|
|
||||||
list.contentX = 0
|
|
||||||
list.contentY = 0
|
|
||||||
main.categoryButton.text = display
|
|
||||||
widgetExplorer.widgetsModel.filterQuery = model["filterData"]
|
|
||||||
widgetExplorer.widgetsModel.filterType = model["filterType"]
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
parent = categoriesDialog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
id: getWidgetsDialog
|
|
||||||
visualParent: main.getWidgetsButton
|
|
||||||
}
|
|
||||||
Repeater {
|
|
||||||
parent: getWidgetsDialog
|
|
||||||
model: widgetExplorer.widgetsMenuActions
|
|
||||||
delegate: PlasmaComponents.MenuItem {
|
|
||||||
icon: modelData.icon
|
|
||||||
text: modelData.text
|
|
||||||
separator: modelData.separator
|
|
||||||
onClicked: modelData.trigger()
|
|
||||||
Component.onCompleted: {
|
|
||||||
parent = getWidgetsDialog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.Dialog {
|
|
||||||
id: tooltipDialog
|
|
||||||
property Item appletDelegate
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
tooltipDialog.setAttribute(Qt.WA_X11NetWmWindowTypeToolTip, true)
|
|
||||||
tooltipDialog.windowFlags = Qt.Window|Qt.WindowStaysOnTopHint|Qt.X11BypassWindowManagerHint
|
|
||||||
}
|
|
||||||
|
|
||||||
onAppletDelegateChanged: {
|
|
||||||
if (!appletDelegate) {
|
|
||||||
toolTipHideTimer.restart()
|
|
||||||
toolTipShowTimer.running = false
|
|
||||||
} else if (tooltipDialog.visible) {
|
|
||||||
var point = main.tooltipPosition()
|
|
||||||
tooltipDialog.x = point.x
|
|
||||||
tooltipDialog.y = point.y
|
|
||||||
} else {
|
|
||||||
toolTipShowTimer.restart()
|
|
||||||
toolTipHideTimer.running = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mainItem: Tooltip { id: tooltipWidget }
|
|
||||||
Behavior on x {
|
|
||||||
enabled: widgetExplorer.orientation == Qt.Horizontal
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
Behavior on y {
|
|
||||||
enabled: widgetExplorer.orientation == Qt.Vertical
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: toolTipShowTimer
|
|
||||||
interval: 500
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
var point = main.tooltipPosition()
|
|
||||||
tooltipDialog.x = point.x
|
|
||||||
tooltipDialog.y = point.y
|
|
||||||
tooltipDialog.visible = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: toolTipHideTimer
|
|
||||||
interval: 1000
|
|
||||||
repeat: false
|
|
||||||
onTriggered: tooltipDialog.visible = false
|
|
||||||
}
|
|
||||||
function tooltipPosition() {
|
|
||||||
return widgetExplorer.tooltipPosition(tooltipDialog.appletDelegate, tooltipDialog.width, tooltipDialog.height);
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: topBar
|
|
||||||
property Item categoryButton
|
|
||||||
|
|
||||||
sourceComponent: (widgetExplorer.orientation == Qt.Horizontal) ? horizontalTopBarComponent : verticalTopBarComponent
|
|
||||||
height: item.height + 2
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
|
|
||||||
topMargin: widgetExplorer.orientation == Qt.Horizontal ? 4 : 0
|
|
||||||
leftMargin: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: horizontalTopBarComponent
|
|
||||||
|
|
||||||
Item {
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
height: filterField.height
|
|
||||||
Row {
|
|
||||||
spacing: 5
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
leftMargin: 2
|
|
||||||
}
|
|
||||||
PlasmaComponents.TextField {
|
|
||||||
id: filterField
|
|
||||||
width: list.width / Math.floor(list.width / cellWidth) - 4
|
|
||||||
clearButtonShown: true
|
|
||||||
placeholderText: i18n("Enter search term...")
|
|
||||||
onTextChanged: {
|
|
||||||
list.contentX = 0
|
|
||||||
list.contentY = 0
|
|
||||||
widgetExplorer.widgetsModel.searchTerm = text
|
|
||||||
}
|
|
||||||
Component.onCompleted: forceActiveFocus()
|
|
||||||
}
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: categoryButton
|
|
||||||
text: i18n("Categories")
|
|
||||||
onClicked: categoriesDialog.open(0, categoryButton.height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: 5
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: getWidgetsButton
|
|
||||||
iconSource: "get-hot-new-stuff"
|
|
||||||
text: i18n("Get new widgets")
|
|
||||||
onClicked: getWidgetsDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: widgetExplorer.extraActions.length
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
iconSource: widgetExplorer.extraActions[modelData].icon
|
|
||||||
text: widgetExplorer.extraActions[modelData].text
|
|
||||||
onClicked: {
|
|
||||||
widgetExplorer.extraActions[modelData].trigger()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
iconSource: "window-close"
|
|
||||||
onClicked: widgetExplorer.closeClicked()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
main.getWidgetsButton = getWidgetsButton
|
|
||||||
main.categoryButton = categoryButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: verticalTopBarComponent
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left:parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
anchors.right: parent.right
|
|
||||||
iconSource: "window-close"
|
|
||||||
onClicked: widgetExplorer.closeClicked()
|
|
||||||
}
|
|
||||||
PlasmaComponents.TextField {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
clearButtonShown: true
|
|
||||||
placeholderText: i18n("Enter search term...")
|
|
||||||
onTextChanged: {
|
|
||||||
list.contentX = 0
|
|
||||||
list.contentY = 0
|
|
||||||
widgetExplorer.widgetsModel.searchTerm = text
|
|
||||||
}
|
|
||||||
Component.onCompleted: forceActiveFocus()
|
|
||||||
}
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
id: categoryButton
|
|
||||||
text: i18n("Categories")
|
|
||||||
onClicked: categoriesDialog.open(0, categoryButton.height)
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
main.categoryButton = categoryButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseEventListener {
|
|
||||||
id: listParent
|
|
||||||
anchors {
|
|
||||||
top: topBar.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: widgetExplorer.orientation == Qt.Horizontal
|
|
||||||
? parent.right
|
|
||||||
: (scrollBar.visible ? scrollBar.left : parent.right)
|
|
||||||
bottom: widgetExplorer.orientation == Qt.Horizontal ? scrollBar.top : bottomBar.top
|
|
||||||
leftMargin: 4
|
|
||||||
bottomMargin: 4
|
|
||||||
}
|
|
||||||
onWheelMoved: {
|
|
||||||
//use this only if the wheel orientation is vertical and the list orientation is horizontal, otherwise will be the list itself managing the wheel
|
|
||||||
if (wheel.orientation == Qt.Vertical && list.orientation == ListView.Horizontal) {
|
|
||||||
var delta = wheel.delta > 0 ? 20 : -20
|
|
||||||
list.contentX = Math.min(Math.max(0, list.contentWidth - list.width),
|
|
||||||
Math.max(0, list.contentX - delta))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListView {
|
|
||||||
id: list
|
|
||||||
|
|
||||||
property int delegateWidth: (widgetExplorer.orientation == Qt.Horizontal) ? (list.width / Math.floor(list.width / cellWidth)) : list.width
|
|
||||||
property int delegateHeight: theme.defaultFont.pixelSize * 7 - 4
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
orientation: widgetExplorer.orientation == Qt.Horizontal ? ListView.Horizontal : ListView.Vertical
|
|
||||||
snapMode: ListView.SnapToItem
|
|
||||||
model: widgetExplorer.widgetsModel
|
|
||||||
|
|
||||||
clip: widgetExplorer.orientation == Qt.Vertical
|
|
||||||
|
|
||||||
delegate: AppletDelegate {}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
PlasmaComponents.ScrollBar {
|
|
||||||
id: scrollBar
|
|
||||||
orientation: widgetExplorer.orientation == Qt.Horizontal ? ListView.Horizontal : ListView.Vertical
|
|
||||||
anchors {
|
|
||||||
top: widgetExplorer.orientation == Qt.Horizontal ? undefined : listParent.top
|
|
||||||
bottom: widgetExplorer.orientation == Qt.Horizontal ? parent.bottom : bottomBar.top
|
|
||||||
left: widgetExplorer.orientation == Qt.Horizontal ? parent.left : undefined
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
flickableItem: list
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: bottomBar
|
|
||||||
|
|
||||||
sourceComponent: (widgetExplorer.orientation == Qt.Horizontal) ? undefined : verticalBottomBarComponent
|
|
||||||
//height: item.height
|
|
||||||
height: 48 // FIXME
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
leftMargin: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: verticalBottomBarComponent
|
|
||||||
Column {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
id: getWidgetsButton
|
|
||||||
iconSource: "get-hot-new-stuff"
|
|
||||||
text: i18n("Get new widgets")
|
|
||||||
onClicked: getWidgetsDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: widgetExplorer.extraActions.length
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
iconSource: widgetExplorer.extraActions[modelData].icon
|
|
||||||
text: widgetExplorer.extraActions[modelData].text
|
|
||||||
onClicked: {
|
|
||||||
widgetExplorer.extraActions[modelData].trigger()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
main.getWidgetsButton = getWidgetsButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
// var panel = new Panel
|
|
||||||
// panel.screen = 0
|
|
||||||
// panel.location = 'top'
|
|
||||||
// panel.addWidget("org.kde.testapplet")
|
|
||||||
// panel.addWidget("org.kde.testcomponentsapplet")
|
|
||||||
//
|
|
||||||
// for (var i = 0; i < screenCount; ++i) {
|
|
||||||
// var desktop = new Activity
|
|
||||||
// desktop.name = i18n("Desktop")
|
|
||||||
// desktop.screen = i
|
|
||||||
// desktop.wallpaperPlugin = 'org.kde.image'
|
|
||||||
//
|
|
||||||
// desktop.addWidget("org.kde.testapplet")
|
|
||||||
// var testComponents = desktop.addWidget("org.kde.testcomponentsapplet")
|
|
||||||
// }
|
|
@ -1,70 +0,0 @@
|
|||||||
/* vim:set foldmethod=marker:
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013 Ivan Cukic <ivan.cukic(at)kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2,
|
|
||||||
* or (at your option) any later version, as published by the Free
|
|
||||||
* Software Foundation
|
|
||||||
*
|
|
||||||
* 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, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2
|
|
||||||
import org.kde.solid 1.0 as Solid
|
|
||||||
import org.kde.plasma.platformcomponents 1.0 as Platform
|
|
||||||
import QtQuick.Window 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: main
|
|
||||||
|
|
||||||
property string shell : "org.kde.blank"
|
|
||||||
property bool willing : false
|
|
||||||
property int priority : 0
|
|
||||||
|
|
||||||
// This is not needed, but allows the
|
|
||||||
// handler to know whether its shell is loaded
|
|
||||||
property bool loaded : false
|
|
||||||
|
|
||||||
Solid.Devices {
|
|
||||||
id: keyboards
|
|
||||||
query: "IS Keyboard"
|
|
||||||
}
|
|
||||||
|
|
||||||
Platform.Application {
|
|
||||||
application: "xterm"
|
|
||||||
running: main.loaded
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: This is not needed - just for testing purposes
|
|
||||||
Window {
|
|
||||||
id: blankDialog
|
|
||||||
|
|
||||||
visible: main.loaded
|
|
||||||
|
|
||||||
width: 500
|
|
||||||
height: 500
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
color: "white"
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors.fill: parent
|
|
||||||
font.pointSize: 32
|
|
||||||
text: "Blank"
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
//import org.kde.plasma 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
color: "gray"
|
|
||||||
width: 1024
|
|
||||||
height: 768
|
|
||||||
|
|
||||||
property Item containment
|
|
||||||
|
|
||||||
onContainmentChanged: {
|
|
||||||
print("New Containment: " + containment)
|
|
||||||
//containment.parent = root
|
|
||||||
containment.visible = true
|
|
||||||
containment.anchors.fill = root
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
print("View org.kde.blank QML loaded")
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
//import org.kde.plasma 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: root
|
|
||||||
width: 640
|
|
||||||
height: 32
|
|
||||||
imagePath: "widgets/panel-background"
|
|
||||||
|
|
||||||
property Item containment
|
|
||||||
|
|
||||||
onContainmentChanged: {
|
|
||||||
print("New panel Containment: " + containment)
|
|
||||||
//containment.parent = root
|
|
||||||
containment.visible = true
|
|
||||||
containment.anchors.fill = root
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
print("PanelView QML loaded")
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,34 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Comment=Blank desktop view furniture
|
|
||||||
Comment[nl]=Meubilair voor weergave op blanco bureaublad
|
|
||||||
Comment[pt]=Disposição do ambiente de trabalho em branco
|
|
||||||
Comment[pt_BR]=Acessório de visualização da área de trabalho vazia
|
|
||||||
Comment[sk]=Prázdna plocha zobraziť nábytok
|
|
||||||
Comment[sv]=Visa tomt skrivbordsmöbler
|
|
||||||
Comment[uk]=Компоненти для перегляду порожньої стільниці
|
|
||||||
Comment[x-test]=xxBlank desktop view furniturexx
|
|
||||||
Encoding=UTF-8
|
|
||||||
Keywords=
|
|
||||||
Name=Blank Desktop
|
|
||||||
Name[cs]=Prázdná pracovní plocha
|
|
||||||
Name[de]=Leere Arbeitsfläche
|
|
||||||
Name[fi]=Tyhjä työpöytä
|
|
||||||
Name[nl]=Blanco bureaublad
|
|
||||||
Name[pt]=Ambiente de Trabalho em Branco
|
|
||||||
Name[pt_BR]=Área de trabalho vazia
|
|
||||||
Name[sk]=Prázdna plocha
|
|
||||||
Name[sv]=Tomt skrivbord
|
|
||||||
Name[uk]=Порожня стільниця
|
|
||||||
Name[x-test]=xxBlank Desktopxx
|
|
||||||
Type=Service
|
|
||||||
|
|
||||||
X-KDE-ServiceTypes=Plasma/Shell
|
|
||||||
X-KDE-ParentApp=
|
|
||||||
X-KDE-PluginInfo-Author=Marco Martin
|
|
||||||
X-KDE-PluginInfo-Category=
|
|
||||||
X-KDE-PluginInfo-Email=mart@kde.org
|
|
||||||
X-KDE-PluginInfo-License=GPLv2+
|
|
||||||
X-KDE-PluginInfo-Name=org.kde.blank
|
|
||||||
X-KDE-PluginInfo-Version=
|
|
||||||
X-KDE-PluginInfo-Website=
|
|
||||||
X-Plasma-MainScript=layout.js
|
|
@ -1,3 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
$XGETTEXT `find . -name \*.qml` -L Java -o $podir/plasma_shell_org.kde.desktop.pot
|
|
||||||
rm -f rc.cpp
|
|
@ -1,293 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.1
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.qtextracomponents 2.0
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: background
|
|
||||||
|
|
||||||
width: Math.max((delegateStack.currentPage ? delegateStack.currentPage.implicitWidth : 0) + margins.left + margins.right, list.delegateWidth)
|
|
||||||
height: Math.max((delegateStack.currentPage ? delegateStack.currentPage.implicitHeight : 0) + margins.top + margins.bottom, list.delegateHeight)
|
|
||||||
|
|
||||||
imagePath: "widgets/viewitem"
|
|
||||||
prefix: Current ? (mainMouseArea.containsMouse ? "selected+hover" : "selected") : (mainMouseArea.containsMouse ? "hover" : "normal")
|
|
||||||
|
|
||||||
Behavior on width {
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
Behavior on height {
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.PageStack {
|
|
||||||
id: delegateStack
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
leftMargin: background.margins.left
|
|
||||||
topMargin: background.margins.top
|
|
||||||
rightMargin: background.margins.right
|
|
||||||
bottomMargin: background.margins.bottom
|
|
||||||
}
|
|
||||||
clip: true
|
|
||||||
initialPage: iconComponent
|
|
||||||
}
|
|
||||||
|
|
||||||
property Item mainMouseArea
|
|
||||||
Component {
|
|
||||||
id: iconComponent
|
|
||||||
Item {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
var activityId = model["DataEngineSource"]
|
|
||||||
var service = activitySource.serviceForSource(activityId)
|
|
||||||
var operation = service.operationDescription("setCurrent")
|
|
||||||
service.startOperationCall(operation)
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: mainMouseArea = mouseArea
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
id: iconWidget
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
x: y
|
|
||||||
width: theme.hugeIconSize
|
|
||||||
height: width
|
|
||||||
source: Icon
|
|
||||||
}
|
|
||||||
QPixmapItem {
|
|
||||||
anchors.fill: iconWidget
|
|
||||||
pixmap: Icon ? undefined : activityManager.pixmapForActivity(model["DataEngineSource"])
|
|
||||||
visible: Icon == ""
|
|
||||||
}
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
width: theme.mediumIconSize
|
|
||||||
height: width
|
|
||||||
anchors.centerIn: iconWidget
|
|
||||||
source: "media-playback-start"
|
|
||||||
visible: model["State"] != "Running"
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
anchors {
|
|
||||||
left: iconWidget.right
|
|
||||||
right: parent.right
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
leftMargin: background.margins.left
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
id: titleText
|
|
||||||
text: Name
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
height: paintedHeight
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
//go with nowrap only if there is a single word too long
|
|
||||||
onPaintedWidthChanged: {
|
|
||||||
wrapTimer.restart()
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: wrapTimer
|
|
||||||
interval: 200
|
|
||||||
onTriggered: {
|
|
||||||
//give it some pixels of tolerance
|
|
||||||
if (titleText.paintedWidth > titleText.width + 3) {
|
|
||||||
titleText.wrapMode = Text.NoWrap
|
|
||||||
titleText.elide = Text.ElideRight
|
|
||||||
} else {
|
|
||||||
titleText.wrapMode = Text.WordWrap
|
|
||||||
titleText.elide = Text.ElideNone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
id: buttonsRow
|
|
||||||
visible: model["State"] == "Running"
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
id: configureButton
|
|
||||||
flat: false
|
|
||||||
iconSource: "configure"
|
|
||||||
onClicked: delegateStack.push(configurationComponent)
|
|
||||||
}
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
visible: !model["Current"]
|
|
||||||
iconSource: "media-playback-stop"
|
|
||||||
flat: false
|
|
||||||
onClicked: {
|
|
||||||
var activityId = model["DataEngineSource"]
|
|
||||||
var service = activitySource.serviceForSource(activityId)
|
|
||||||
var operation = service.operationDescription("stop")
|
|
||||||
service.startOperationCall(operation)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
visible: model["State"] != "Running"
|
|
||||||
iconSource: "edit-delete"
|
|
||||||
text: i18n("Delete")
|
|
||||||
width: Math.min(implicitWidth, parent.width)
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
onClicked: delegateStack.push(confirmationComponent)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: confirmationComponent
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
//20 is just a number arbitrarly low, won't be followed
|
|
||||||
implicitWidth: (activityManager.orientation == Qt.Horizontal) ? confirmationLabel.paintedWidth : 20
|
|
||||||
implicitHeight: (activityManager.orientation == Qt.Horizontal) ? 20 : confirmationColumn.childrenRect.height
|
|
||||||
|
|
||||||
onClicked: delegateStack.pop()
|
|
||||||
Column {
|
|
||||||
id: confirmationColumn
|
|
||||||
anchors.fill: parent
|
|
||||||
spacing: 4
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
id: confirmationLabel
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
text: i18n("Remove activity %1?", Name)
|
|
||||||
wrapMode: (activityManager.orientation == Qt.Horizontal) ? Text.NoWrap : Text.Wrap
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
text: i18n("Remove")
|
|
||||||
onClicked: {
|
|
||||||
var activityId = model["DataEngineSource"]
|
|
||||||
var service = activitySource.serviceForSource(activityId)
|
|
||||||
var operation = service.operationDescription("remove")
|
|
||||||
operation["Id"] = activityId
|
|
||||||
service.startOperationCall(operation)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
text: i18n("Cancel")
|
|
||||||
onClicked: delegateStack.pop()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: configurationComponent
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
//20 is just a number arbitrarly low, won't be followed
|
|
||||||
implicitWidth: (activityManager.orientation == Qt.Horizontal) ? (iconButton.x*3 + iconButton.width + theme.mSize(theme.defaultFont).width * 12) : 20
|
|
||||||
// set the implicit height to a meaningful value, otherwise the layouting goes a little crazy :)
|
|
||||||
implicitHeight: iconButton.y*3
|
|
||||||
|
|
||||||
onClicked: delegateStack.pop()
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: iconButton
|
|
||||||
iconSource: Icon
|
|
||||||
anchors {
|
|
||||||
top: configurationLayout.top
|
|
||||||
bottom: configurationLayout.bottom
|
|
||||||
}
|
|
||||||
x: y
|
|
||||||
width: height
|
|
||||||
QPixmapItem {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: theme.largeIconSize
|
|
||||||
height: width
|
|
||||||
smooth: true
|
|
||||||
visible: iconButton.iconSource == ""
|
|
||||||
pixmap: visible ? undefined : activityManager.pixmapForActivity(model["DataEngineSource"])
|
|
||||||
}
|
|
||||||
onClicked: iconSource = activityManager.chooseIcon()
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
id: configurationLayout
|
|
||||||
anchors {
|
|
||||||
left: iconButton.right
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
right: parent.right
|
|
||||||
leftMargin: iconButton.x
|
|
||||||
rightMargin: iconButton.x
|
|
||||||
}
|
|
||||||
spacing: 4
|
|
||||||
PlasmaComponents.TextField {
|
|
||||||
id: activityNameField
|
|
||||||
text: Name
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
text: i18n("Apply")
|
|
||||||
onClicked: {
|
|
||||||
var activityId = model["DataEngineSource"]
|
|
||||||
var service = activitySource.serviceForSource(activityId)
|
|
||||||
|
|
||||||
var operation = service.operationDescription("setName")
|
|
||||||
operation["Name"] = activityNameField.text
|
|
||||||
service.startOperationCall(operation)
|
|
||||||
|
|
||||||
var operation = service.operationDescription("setIcon")
|
|
||||||
operation["Icon"] = iconButton.iconSource
|
|
||||||
service.startOperationCall(operation)
|
|
||||||
|
|
||||||
delegateStack.pop()
|
|
||||||
}
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
text: i18n("Cancel")
|
|
||||||
onClicked: delegateStack.pop()
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,308 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.qtextracomponents 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: main
|
|
||||||
signal closed()
|
|
||||||
|
|
||||||
//this is used to perfectly align the filter field and delegates
|
|
||||||
property int cellWidth: theme.mSize(theme.defaultFont).width * 20
|
|
||||||
|
|
||||||
QtObject {
|
|
||||||
id: activityManager
|
|
||||||
property int orientation: Qt.Vertical
|
|
||||||
}
|
|
||||||
property int minimumWidth: cellWidth + (
|
|
||||||
activityManager.orientation == Qt.Horizontal
|
|
||||||
? 0
|
|
||||||
: (scrollBar.width + 4 * 2) // 4 * 2 == left and right margins
|
|
||||||
)
|
|
||||||
property int minimumHeight: topBar.height + list.delegateHeight + (activityManager.orientation == Qt.Horizontal ? scrollBar.height : 0) + 4
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.DataSource {
|
|
||||||
id: activitySource
|
|
||||||
engine: "org.kde.activities"
|
|
||||||
onSourceAdded: {
|
|
||||||
if (source != "Status") {
|
|
||||||
connectSource(source)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
connectedSources = sources.filter(function(val) {
|
|
||||||
return val != "Status";
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
id: newActivityMenu
|
|
||||||
visualParent: topBar.newActivityButton
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
id: templatesItem
|
|
||||||
text: i18n("Templates")
|
|
||||||
onClicked: activityTemplatesMenu.open()
|
|
||||||
}
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
icon: "user-desktop"
|
|
||||||
text: i18n("Empty Desktop")
|
|
||||||
onClicked: activityManager.createActivity("desktop")
|
|
||||||
}
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
icon: "edit-copy"
|
|
||||||
text: i18n("Clone current activity")
|
|
||||||
onClicked: activityManager.cloneCurrentActivity()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
id: activityTemplatesMenu
|
|
||||||
visualParent: templatesItem
|
|
||||||
}
|
|
||||||
Repeater {
|
|
||||||
parent: activityTemplatesMenu
|
|
||||||
model: activityManager.activityTypeActions
|
|
||||||
delegate: PlasmaComponents.MenuItem {
|
|
||||||
icon: modelData.icon
|
|
||||||
text: modelData.text
|
|
||||||
separator: modelData.separator
|
|
||||||
onClicked: {
|
|
||||||
//is a plugin?
|
|
||||||
if (modelData.pluginName) {
|
|
||||||
activityManager.createActivity(modelData.pluginName)
|
|
||||||
//is a script?
|
|
||||||
} else if (modelData.scriptFile) {
|
|
||||||
activityManager.createActivityFromScript(modelData.scriptFile, modelData.text, modelData.icon, modelData.startupApps)
|
|
||||||
//invoke ghns
|
|
||||||
} else {
|
|
||||||
activityManager.downloadActivityScripts()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
parent = activityTemplatesMenu
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: topBar
|
|
||||||
property string query
|
|
||||||
property Item newActivityButton
|
|
||||||
|
|
||||||
sourceComponent: (activityManager.orientation == Qt.Horizontal) ? horizontalTopBarComponent : verticalTopBarComponent
|
|
||||||
height: item.height + 2
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
|
|
||||||
topMargin: activityManager.orientation == Qt.Horizontal ? 4 : 0
|
|
||||||
leftMargin: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component {
|
|
||||||
id: horizontalTopBarComponent
|
|
||||||
Item {
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left:parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
height: filterField.height
|
|
||||||
|
|
||||||
PlasmaComponents.TextField {
|
|
||||||
id: filterField
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
leftMargin: 2
|
|
||||||
}
|
|
||||||
width: list.width / Math.floor(list.width / cellWidth) - 4
|
|
||||||
clearButtonShown: true
|
|
||||||
onTextChanged: topBar.query = text
|
|
||||||
placeholderText: i18n("Enter search term...")
|
|
||||||
Component.onCompleted: forceActiveFocus()
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: 4
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: newActivityButton
|
|
||||||
iconSource: "list-add"
|
|
||||||
text: i18n("Create activity...")
|
|
||||||
onClicked: newActivityMenu.open()
|
|
||||||
}
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
iconSource: "plasma"
|
|
||||||
text: i18n("Add widgets")
|
|
||||||
onClicked: activityManager.addWidgetsRequested()
|
|
||||||
}
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
iconSource: "window-close"
|
|
||||||
onClicked: main.closed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
topBar.newActivityButton = newActivityButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component {
|
|
||||||
id: verticalTopBarComponent
|
|
||||||
Column {
|
|
||||||
spacing: 4
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left:parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
anchors.right: parent.right
|
|
||||||
iconSource: "window-close"
|
|
||||||
onClicked: main.closed()
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.TextField {
|
|
||||||
id: filterField
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
clearButtonShown: true
|
|
||||||
onTextChanged: topBar.query = text
|
|
||||||
placeholderText: i18n("Enter search term...")
|
|
||||||
Component.onCompleted: forceActiveFocus()
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: newActivityButton
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
iconSource: "list-add"
|
|
||||||
text: i18n("Create activity...")
|
|
||||||
onClicked: newActivityMenu.open()
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
topBar.newActivityButton = newActivityButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseEventListener {
|
|
||||||
id: listParent
|
|
||||||
anchors {
|
|
||||||
top: topBar.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: activityManager.orientation == Qt.Horizontal
|
|
||||||
? parent.right
|
|
||||||
: (scrollBar.visible ? scrollBar.left : parent.right)
|
|
||||||
bottom: activityManager.orientation == Qt.Horizontal ? scrollBar.top : bottomBar.top
|
|
||||||
leftMargin: 4
|
|
||||||
bottomMargin: 4
|
|
||||||
}
|
|
||||||
onWheelMoved: {
|
|
||||||
//use this only if the wheel orientation is vertical and the list orientation is horizontal, otherwise will be the list itself managing the wheel
|
|
||||||
if (wheel.orientation == Qt.Vertical && list.orientation == ListView.Horizontal) {
|
|
||||||
var delta = wheel.delta > 0 ? 20 : -20
|
|
||||||
list.contentX = Math.min(Math.max(0, list.contentWidth - list.width),
|
|
||||||
Math.max(0, list.contentX - delta))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListView {
|
|
||||||
id: list
|
|
||||||
|
|
||||||
property int delegateWidth: (activityManager.orientation == Qt.Horizontal) ? (list.width / Math.floor(list.width / cellWidth)) : list.width
|
|
||||||
property int delegateHeight: theme.mSize(theme.defaultFont).height * 7 - 4
|
|
||||||
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
orientation: activityManager.orientation == Qt.Horizontal ? ListView.Horizontal : ListView.vertical
|
|
||||||
snapMode: ListView.SnapToItem
|
|
||||||
model: PlasmaCore.SortFilterModel {
|
|
||||||
sourceModel: PlasmaCore.DataModel {
|
|
||||||
dataSource: activitySource
|
|
||||||
}
|
|
||||||
filterRole: "Name"
|
|
||||||
filterRegExp: ".*"+topBar.query+".*"
|
|
||||||
}
|
|
||||||
clip: activityManager.orientation == Qt.Vertical
|
|
||||||
|
|
||||||
delegate: ActivityDelegate {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.ScrollBar {
|
|
||||||
id: scrollBar
|
|
||||||
orientation: activityManager.orientation == Qt.Horizontal ? ListView.Horizontal : ListView.Vertical
|
|
||||||
anchors {
|
|
||||||
top: activityManager.orientation == Qt.Horizontal ? undefined : listParent.top
|
|
||||||
bottom: activityManager.orientation == Qt.Horizontal ? parent.bottom : bottomBar.top
|
|
||||||
left: activityManager.orientation == Qt.Horizontal ? parent.left : undefined
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
flickableItem: list
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: bottomBar
|
|
||||||
|
|
||||||
sourceComponent: (activityManager.orientation == Qt.Horizontal) ? undefined : verticalBottomBarComponent
|
|
||||||
height: item.height
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
leftMargin: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: verticalBottomBarComponent
|
|
||||||
Column {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
iconSource: "plasma"
|
|
||||||
text: i18n("Add widgets")
|
|
||||||
onClicked: activityManager.addWidgetsRequested()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
Row {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property alias reason: messageText.text
|
|
||||||
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
id: icon
|
|
||||||
anchors.verticalCenter: parent
|
|
||||||
width: theme.hugeIconSize
|
|
||||||
height: width
|
|
||||||
source: "dialog-error"
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
id: messageText
|
|
||||||
anchors.verticalCenter: parent
|
|
||||||
width: parent.width - icon.width
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,87 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Window 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property int minimumWidth: compactRepresentation && compactRepresentation.minimumWidth !== undefined ? compactRepresentation.minimumWidth : -1
|
|
||||||
property int minimumHeight: compactRepresentation && compactRepresentation.minimumHeight !== undefined ? compactRepresentation.minimumHeight : -1
|
|
||||||
|
|
||||||
property int maximumWidth: compactRepresentation && compactRepresentation.maximumWidth !== undefined ? compactRepresentation.maximumWidth : -1
|
|
||||||
property int maximumHeight: compactRepresentation && compactRepresentation.maximumHeight !== undefined ? compactRepresentation.maximumHeight : -1
|
|
||||||
|
|
||||||
property int implicitWidth: compactRepresentation && compactRepresentation.implicitWidth !== undefined ? compactRepresentation.implicitWidth : -1
|
|
||||||
property int implicitHeight: compactRepresentation && compactRepresentation.implicitHeight !== undefined ? compactRepresentation.implicitHeight : -1
|
|
||||||
|
|
||||||
property bool fillWidth: compactRepresentation && compactRepresentation.fillWidth !== undefined ? compactRepresentation.fillWidth : false
|
|
||||||
property bool fillHeight: compactRepresentation && compactRepresentation.fillHeight !== undefined ? compactRepresentation.fillHeight : false
|
|
||||||
|
|
||||||
|
|
||||||
property Item applet
|
|
||||||
property Item compactRepresentation
|
|
||||||
|
|
||||||
onAppletChanged: {
|
|
||||||
|
|
||||||
//if the applet size was restored to a stored size, or if is dragged from the desktop, restore popup size
|
|
||||||
if (applet.width > 0) {
|
|
||||||
popupWindow.mainItem.width = applet.width;
|
|
||||||
}
|
|
||||||
if (applet.height > 0) {
|
|
||||||
popupWindow.mainItem.height = applet.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
applet.parent = appletParent;
|
|
||||||
applet.anchors.fill = applet.parent;
|
|
||||||
}
|
|
||||||
onCompactRepresentationChanged: {
|
|
||||||
compactRepresentation.parent = root
|
|
||||||
compactRepresentation.anchors.fill = root
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.Dialog {
|
|
||||||
id: popupWindow
|
|
||||||
//windowFlags: Qt.Popup
|
|
||||||
color: Qt.rgba(0,0,0,0)
|
|
||||||
visible: plasmoid.expanded
|
|
||||||
visualParent: root
|
|
||||||
mainItem: Item {
|
|
||||||
id: appletParent
|
|
||||||
|
|
||||||
width: applet && applet.implicitHeight > 0 ? applet.implicitHeight : theme.mSize(theme.defaultFont).width * 35
|
|
||||||
height: applet && applet.implicitHeight > 0 ? applet.implicitHeight : theme.mSize(theme.defaultFont).height * 25
|
|
||||||
}
|
|
||||||
|
|
||||||
onActiveWindowChanged: {
|
|
||||||
if (!activeWindow) {
|
|
||||||
// plasmoid.expanded = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (!visible) {
|
|
||||||
plasmoid.expanded = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
id: icon
|
|
||||||
|
|
||||||
source: plasmoid.icon ? plasmoid.icon : "plasma"
|
|
||||||
active: mouseArea.containsMouse
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: mouseArea
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onClicked: plasmoid.expanded = !plasmoid.expanded
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,238 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
|
|
||||||
|
|
||||||
//TODO: all of this will be done with desktop components
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property int _m: theme.defaultFont.pointSize
|
|
||||||
|
|
||||||
//BEGIN properties
|
|
||||||
color: syspal.window
|
|
||||||
width: 640
|
|
||||||
height: 480
|
|
||||||
//END properties
|
|
||||||
|
|
||||||
//BEGIN model
|
|
||||||
property ConfigModel globalConfigModel: globalAppletConfigModel
|
|
||||||
|
|
||||||
ConfigModel {
|
|
||||||
id: globalAppletConfigModel
|
|
||||||
ConfigCategory {
|
|
||||||
name: "Keyboard shortcuts"
|
|
||||||
icon: "preferences-desktop-keyboard"
|
|
||||||
source: "ConfigurationShortcuts.qml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END model
|
|
||||||
|
|
||||||
//BEGIN functions
|
|
||||||
function saveConfig() {
|
|
||||||
if (main.currentItem.saveConfig) {
|
|
||||||
main.currentItem.saveConfig()
|
|
||||||
} else {
|
|
||||||
for (var key in plasmoid.configuration) {
|
|
||||||
if (main.currentItem["cfg_"+key] !== undefined) {
|
|
||||||
plasmoid.configuration[key] = main.currentItem["cfg_"+key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function restoreConfig() {
|
|
||||||
for (var key in plasmoid.configuration) {
|
|
||||||
if (main.currentItem["cfg_"+key] !== undefined) {
|
|
||||||
main.currentItem["cfg_"+key] = plasmoid.configuration[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END functions
|
|
||||||
|
|
||||||
|
|
||||||
//BEGIN connections
|
|
||||||
Component.onCompleted: {
|
|
||||||
if (configDialog.configModel && configDialog.configModel.count > 0) {
|
|
||||||
main.sourceFile = configDialog.configModel.get(0).source
|
|
||||||
} else {
|
|
||||||
main.sourceFile = globalConfigModel.get(0).source
|
|
||||||
}
|
|
||||||
root.restoreConfig()
|
|
||||||
// root.width = mainColumn.implicitWidth
|
|
||||||
// root.height = mainColumn.implicitHeight
|
|
||||||
}
|
|
||||||
//END connections
|
|
||||||
|
|
||||||
//BEGIN UI components
|
|
||||||
SystemPalette {id: syspal}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: mainColumn
|
|
||||||
anchors.fill: parent
|
|
||||||
property int implicitWidth: Math.max(contentRow.implicitWidth, buttonsRow.implicitWidth) + 8
|
|
||||||
property int implicitHeight: contentRow.implicitHeight + buttonsRow.implicitHeight + 8
|
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
id: contentRow
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
Layout.fillHeight: true
|
|
||||||
Layout.preferredHeight: parent.height - buttonsRow.height
|
|
||||||
|
|
||||||
QtControls.ScrollView {
|
|
||||||
id: categoriesScroll
|
|
||||||
frameVisible: true
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
visible: (configDialog.configModel ? configDialog.configModel.count : 0) + globalConfigModel.count > 1
|
|
||||||
width: visible ? 100 : 0
|
|
||||||
implicitWidth: width
|
|
||||||
Flickable {
|
|
||||||
id: categoriesView
|
|
||||||
contentWidth: width
|
|
||||||
contentHeight: childrenRect.height
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
property Item currentItem: categoriesColumn.children[1]
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: categories
|
|
||||||
width: parent.width
|
|
||||||
height: categoriesColumn.height
|
|
||||||
|
|
||||||
Item {
|
|
||||||
width: parent.width
|
|
||||||
height: categoriesView.currentItem.height
|
|
||||||
y: categoriesView.currentItem.y
|
|
||||||
Rectangle {
|
|
||||||
color: syspal.highlight
|
|
||||||
radius: 3
|
|
||||||
anchors {
|
|
||||||
fill: parent
|
|
||||||
margins: 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Behavior on y {
|
|
||||||
NumberAnimation {
|
|
||||||
duration: 250
|
|
||||||
easing.type: "InOutQuad"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
id: categoriesColumn
|
|
||||||
width: parent.width
|
|
||||||
Repeater {
|
|
||||||
model: configDialog.configModel
|
|
||||||
delegate: ConfigCategoryDelegate {
|
|
||||||
onClicked: categoriesView.currentIndex = index
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Repeater {
|
|
||||||
model: globalConfigModel
|
|
||||||
delegate: ConfigCategoryDelegate {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QtControls.StackView {
|
|
||||||
id: main
|
|
||||||
clip: true
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
Layout.fillWidth: true
|
|
||||||
height: Math.max(pageScroll.height, currentItem != null ? currentItem.implicitHeight : 0)
|
|
||||||
property string sourceFile
|
|
||||||
Timer {
|
|
||||||
id: pageSizeSync
|
|
||||||
interval: 100
|
|
||||||
onTriggered: {
|
|
||||||
// root.width = mainColumn.implicitWidth
|
|
||||||
// root.height = mainColumn.implicitHeight
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onImplicitWidthChanged: pageSizeSync.restart()
|
|
||||||
onImplicitHeightChanged: pageSizeSync.restart()
|
|
||||||
onSourceFileChanged: {
|
|
||||||
print("Source file changed in flickable" + sourceFile);
|
|
||||||
replace(Qt.resolvedUrl(sourceFile))
|
|
||||||
/*
|
|
||||||
* This is not needed on a desktop shell that has ok/apply/cancel buttons, i'll leave it here only for future reference until we have a prototype for the active shell.
|
|
||||||
* root.pageChanged will start a timer, that in turn will call saveConfig() when triggered
|
|
||||||
|
|
||||||
for (var prop in currentPage) {
|
|
||||||
if (prop.indexOf("cfg_") === 0) {
|
|
||||||
currentPage[prop+"Changed"].connect(root.pageChanged)
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
RowLayout {
|
|
||||||
id: buttonsRow
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
rightMargin: spacing
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconName: "dialog-ok"
|
|
||||||
text: "Ok"
|
|
||||||
onClicked: {
|
|
||||||
if (main.currentItem.saveConfig !== undefined) {
|
|
||||||
main.currentItem.saveConfig();
|
|
||||||
} else {
|
|
||||||
root.saveConfig();
|
|
||||||
}
|
|
||||||
configDialog.close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconName: "dialog-ok-apply"
|
|
||||||
text: "Apply"
|
|
||||||
onClicked: {
|
|
||||||
if (main.currentItem.saveConfig !== undefined) {
|
|
||||||
main.currentItem.saveConfig();
|
|
||||||
} else {
|
|
||||||
root.saveConfig();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconName: "dialog-cancel"
|
|
||||||
text: "Cancel"
|
|
||||||
onClicked: configDialog.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END UI components
|
|
||||||
}
|
|
@ -1,83 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: delegate
|
|
||||||
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
//BEGIN properties
|
|
||||||
width: childrenRect.width
|
|
||||||
height: childrenRect.height + 4
|
|
||||||
property bool current: model.source == main.sourceFile
|
|
||||||
//END properties
|
|
||||||
|
|
||||||
//BEGIN connections
|
|
||||||
onClicked: {
|
|
||||||
print("model source: " + model.source + " " + main.sourceFile);
|
|
||||||
if (delegate.current) {
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
if (typeof(categoriesView.currentItem) !== "undefined") {
|
|
||||||
categoriesView.currentItem = delegate;
|
|
||||||
}
|
|
||||||
main.sourceFile = model.source
|
|
||||||
root.restoreConfig()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onCurrentChanged: {
|
|
||||||
if (current) {
|
|
||||||
categoriesView.currentItem = delegate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END connections
|
|
||||||
|
|
||||||
//BEGIN UI components
|
|
||||||
Column {
|
|
||||||
spacing: 4
|
|
||||||
anchors {
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
topMargin: _m
|
|
||||||
}
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
width: theme.IconSizeHuge
|
|
||||||
height: width
|
|
||||||
source: model.icon
|
|
||||||
}
|
|
||||||
QtControls.Label {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
text: model.name
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
color: current ? syspal.highlightedText : syspal.text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END UI components
|
|
||||||
}
|
|
@ -1,119 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
implicitWidth: childrenRect.width
|
|
||||||
implicitHeight: childrenRect.height
|
|
||||||
|
|
||||||
property var prettyStrings: {
|
|
||||||
"LeftButton": i18n("Left-Button"),
|
|
||||||
"RightButton": i18n("Right-Button"),
|
|
||||||
"MidButton": i18n("Middle-Button"),
|
|
||||||
|
|
||||||
"wheel:Vertical": i18n("Vertical-Scroll"),
|
|
||||||
"wheel:Horizontal": i18n("Horizontal-Scroll"),
|
|
||||||
|
|
||||||
"ShiftModifier": i18n("Shift"),
|
|
||||||
"ControlModifier": i18n("Ctrl"),
|
|
||||||
"AltModifier": i18n("Alt"),
|
|
||||||
"MetaModifier": i18n("Meta")
|
|
||||||
}
|
|
||||||
|
|
||||||
function saveConfig() {
|
|
||||||
configDialog.currentContainmentActionsModel.save();
|
|
||||||
}
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
topMargin: 25
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: configDialog.currentContainmentActionsModel
|
|
||||||
delegate: RowLayout {
|
|
||||||
width: root.width
|
|
||||||
MouseEventInputButton {
|
|
||||||
defaultText: prettyStrings ? (prettyStrings[model.action.split(';')[1]] ? prettyStrings[model.action.split(';')[1]] + "+" : "") + prettyStrings[model.action.split(';')[0]] : ""
|
|
||||||
eventString: model.action
|
|
||||||
onEventStringChanged: {
|
|
||||||
configDialog.currentContainmentActionsModel.update(index, eventString, model.pluginName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: pluginsCombo
|
|
||||||
Layout.fillWidth: true
|
|
||||||
model: configDialog.containmentActionConfigModel
|
|
||||||
textRole: "name"
|
|
||||||
property bool initialized: false
|
|
||||||
Component.onCompleted: {
|
|
||||||
for (var i = 0; i < configDialog.containmentActionConfigModel.count; ++i) {
|
|
||||||
if (configDialog.containmentActionConfigModel.get(i).pluginName == pluginName) {
|
|
||||||
pluginsCombo.currentIndex = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pluginsCombo.initialized = true;
|
|
||||||
}
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
if (initialized && configDialog.containmentActionConfigModel.get(currentIndex).pluginName != pluginName) {
|
|
||||||
configDialog.currentContainmentActionsModel.update(index, action, configDialog.containmentActionConfigModel.get(currentIndex).pluginName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconName: "configure"
|
|
||||||
width: height
|
|
||||||
enabled: model.hasConfigurationInterface
|
|
||||||
onClicked: {
|
|
||||||
configDialog.currentContainmentActionsModel.showConfiguration(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconName: "dialog-information"
|
|
||||||
width: height
|
|
||||||
onClicked: {
|
|
||||||
configDialog.currentContainmentActionsModel.showAbout(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QtControls.Button {
|
|
||||||
iconName: "list-remove"
|
|
||||||
width: height
|
|
||||||
onClicked: {
|
|
||||||
configDialog.currentContainmentActionsModel.remove(index);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseEventInputButton {
|
|
||||||
defaultText: i18n("Add Action");
|
|
||||||
onEventStringChanged: {
|
|
||||||
configDialog.currentContainmentActionsModel.append(eventString, "org.kde.contextmenu");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,94 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property int formAlignment: pluginComboBox.x
|
|
||||||
property string currentWallpaper: ""
|
|
||||||
|
|
||||||
//BEGIN functions
|
|
||||||
function saveConfig() {
|
|
||||||
for (var key in configDialog.wallpaperConfiguration) {
|
|
||||||
if (main.currentItem["cfg_"+key] !== undefined) {
|
|
||||||
configDialog.wallpaperConfiguration[key] = main.currentItem["cfg_"+key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
configDialog.currentWallpaper = root.currentWallpaper;
|
|
||||||
configDialog.applyWallpaper()
|
|
||||||
}
|
|
||||||
|
|
||||||
function restoreConfig() {
|
|
||||||
for (var key in configDialog.wallpaperConfiguration) {
|
|
||||||
if (main.currentItem["cfg_"+key] !== undefined) {
|
|
||||||
main.currentItem["cfg_"+key] = configDialog.wallpaperConfiguration[key]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END functions
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
for (var i = 0; i < configDialog.wallpaperConfigModel.count; ++i) {
|
|
||||||
var data = configDialog.wallpaperConfigModel.get(i);
|
|
||||||
for(var j in data) print(j)
|
|
||||||
if (configDialog.currentWallpaper == data.pluginName) {
|
|
||||||
pluginComboBox.currentIndex = i
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
|
||||||
spacing: 4
|
|
||||||
QtControls.Label {
|
|
||||||
anchors.verticalCenter: pluginComboBox.verticalCenter
|
|
||||||
text: "Wallpaper plugin:"
|
|
||||||
}
|
|
||||||
QtControls.ComboBox {
|
|
||||||
id: pluginComboBox
|
|
||||||
model: configDialog.wallpaperConfigModel
|
|
||||||
textRole: "name"
|
|
||||||
onCurrentIndexChanged: {
|
|
||||||
var model = configDialog.wallpaperConfigModel.get(currentIndex)
|
|
||||||
root.currentWallpaper = model.pluginName
|
|
||||||
main.sourceFile = model.source
|
|
||||||
root.restoreConfig()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QtControls.StackView {
|
|
||||||
id: main
|
|
||||||
Layout.fillHeight: true;
|
|
||||||
anchors {
|
|
||||||
left: parent.left;
|
|
||||||
right: parent.right;
|
|
||||||
}
|
|
||||||
property string sourceFile
|
|
||||||
onSourceFileChanged: {
|
|
||||||
if (sourceFile != "") {
|
|
||||||
replace(Qt.resolvedUrl(sourceFile))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: iconsPage
|
|
||||||
width: childrenRect.width
|
|
||||||
height: childrenRect.height
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
iconSource: "settings"
|
|
||||||
text: "None"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,47 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
|
|
||||||
|
|
||||||
AppletConfiguration {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
//BEGIN model
|
|
||||||
globalConfigModel: globalContainmentConfigModel
|
|
||||||
|
|
||||||
ConfigModel {
|
|
||||||
id: globalContainmentConfigModel
|
|
||||||
ConfigCategory {
|
|
||||||
name: "Appearance"
|
|
||||||
icon: "preferences-desktop-wallpaper"
|
|
||||||
source: "ConfigurationContainmentAppearance.qml"
|
|
||||||
}
|
|
||||||
ConfigCategory {
|
|
||||||
name: "Mouse Actions"
|
|
||||||
icon: "preferences-desktop-mouse"
|
|
||||||
source: "ConfigurationContainmentActions.qml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END model
|
|
||||||
|
|
||||||
}
|
|
@ -1,71 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import QtQuick.Controls 1.0 as QtControls
|
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
|
|
||||||
QtControls.Button {
|
|
||||||
id: mouseInputButton
|
|
||||||
property string defaultText: i18n("Add Action")
|
|
||||||
text: defaultText
|
|
||||||
checkable: true
|
|
||||||
property string eventString
|
|
||||||
|
|
||||||
implicitWidth: theme.mSize(theme.defaultFont).width * 15
|
|
||||||
Layout.minimumWidth: implicitWidth
|
|
||||||
Layout.maximumWidth: implicitWidth
|
|
||||||
|
|
||||||
onCheckedChanged: {
|
|
||||||
if (checked) {
|
|
||||||
text = i18n("Input Here");
|
|
||||||
mouseInputArea.enabled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
id: mouseInputArea
|
|
||||||
anchors.fill: parent
|
|
||||||
acceptedButtons: Qt.AllButtons
|
|
||||||
enabled: false
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
var newEventString = configDialog.currentContainmentActionsModel.mouseEventString(mouse.button, mouse.modifiers);
|
|
||||||
|
|
||||||
if (eventString === newEventString || !configDialog.currentContainmentActionsModel.isTriggerUsed(newEventString)) {
|
|
||||||
eventString = newEventString;
|
|
||||||
mouseInputButton.text = defaultText;
|
|
||||||
mouseInputButton.checked = false;
|
|
||||||
enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onWheel: {
|
|
||||||
var newEventString = configDialog.currentContainmentActionsModel.wheelEventString(wheel.pixelDelta, wheel.buttons, wheel.modifiers);
|
|
||||||
|
|
||||||
if (eventString === newEventString || !configDialog.currentContainmentActionsModel.isTriggerUsed(newEventString)) {
|
|
||||||
eventString = newEventString;
|
|
||||||
mouseInputButton.text = defaultText;
|
|
||||||
mouseInputButton.checked = false;
|
|
||||||
enabled = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,186 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
import "panelconfiguration"
|
|
||||||
|
|
||||||
|
|
||||||
//TODO: all of this will be done with desktop components
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: dialogRoot
|
|
||||||
|
|
||||||
//BEGIN Properties
|
|
||||||
width: 640
|
|
||||||
height: 64
|
|
||||||
imagePath: "dialogs/background"
|
|
||||||
|
|
||||||
state: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case PlasmaCore.Types.TopEdge:
|
|
||||||
return "TopEdge"
|
|
||||||
//LeftEdge
|
|
||||||
case PlasmaCore.Types.LeftEdge:
|
|
||||||
return "LeftEdge"
|
|
||||||
//RightEdge
|
|
||||||
case PlasmaCore.Types.RightEdge:
|
|
||||||
return "RightEdge"
|
|
||||||
//BottomEdge
|
|
||||||
case PlasmaCore.Types.BottomEdge:
|
|
||||||
default:
|
|
||||||
return "BottomEdge"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
property bool vertical: (panel.location == 5 || panel.location == 6)
|
|
||||||
//END properties
|
|
||||||
|
|
||||||
//BEGIN Connections
|
|
||||||
Connections {
|
|
||||||
target: panel
|
|
||||||
onOffsetChanged: ruler.offset = panel.offset
|
|
||||||
onMinimumLengthChanged: ruler.minimumLength = panel.minimumLength
|
|
||||||
onMaximumLengthChanged: ruler.maximumLength = panel.maximumLength
|
|
||||||
}
|
|
||||||
//END Connections
|
|
||||||
|
|
||||||
|
|
||||||
//BEGIN UI components
|
|
||||||
|
|
||||||
Ruler {
|
|
||||||
id: ruler
|
|
||||||
state: dialogRoot.state
|
|
||||||
}
|
|
||||||
|
|
||||||
ToolBar {
|
|
||||||
id: toolBar
|
|
||||||
}
|
|
||||||
//END UI components
|
|
||||||
|
|
||||||
//BEGIN Animations
|
|
||||||
//when EdgeHandle is released animate to old panel position
|
|
||||||
ParallelAnimation {
|
|
||||||
id: panelResetAnimation
|
|
||||||
NumberAnimation {
|
|
||||||
target: panel
|
|
||||||
properties: (panel.location == 5 || panel.location == 6) ? "x" : "y"
|
|
||||||
to: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case PlasmaCore.Types.TopEdge:
|
|
||||||
return 0
|
|
||||||
break
|
|
||||||
//LeftEdge
|
|
||||||
case PlasmaCore.Types.LeftEdge:
|
|
||||||
return 0
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case PlasmaCore.Types.RightEdge:
|
|
||||||
return panel.screenGeometry.x + panel.screenGeometry.width - panel.width
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case PlasmaCore.Types.BottomEdge:
|
|
||||||
default:
|
|
||||||
return panel.screenGeometry.y + panel.screenGeometry.height - panel.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
duration: 150
|
|
||||||
}
|
|
||||||
|
|
||||||
NumberAnimation {
|
|
||||||
target: configDialog
|
|
||||||
properties: (panel.location == 5 || panel.location == 6) ? "x" : "y"
|
|
||||||
to: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case PlasmaCore.Types.TopEdge:
|
|
||||||
return panel.height
|
|
||||||
break
|
|
||||||
//LeftEdge
|
|
||||||
case PlasmaCore.Types.LeftEdge:
|
|
||||||
return panel.width
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case PlasmaCore.Types.RightEdge:
|
|
||||||
return panel.screenGeometry.x + panel.screenGeometry.width - panel.width - configDialog.width
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case PlasmaCore.Types.BottomEdge:
|
|
||||||
default:
|
|
||||||
return panel.screenGeometry.y + panel.screenGeometry.height - panel.height - configDialog.height
|
|
||||||
}
|
|
||||||
}
|
|
||||||
duration: 150
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//END Animations
|
|
||||||
|
|
||||||
//BEGIN States
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "TopBorder|BottomBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitHeight: ruler.implicitHeight + toolBar.implicitHeight
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "TopBorder|BottomBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitHeight: ruler.implicitHeight + toolBar.implicitHeight
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "LeftBorder|RightBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitWidth: ruler.implicitWidth + toolBar.implicitWidth
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
enabledBorders: "LeftBorder|RightBorder"
|
|
||||||
}
|
|
||||||
PropertyChanges {
|
|
||||||
target: dialogRoot
|
|
||||||
implicitWidth: ruler.implicitWidth + toolBar.implicitWidth
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
//END States
|
|
||||||
}
|
|
@ -1,114 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
flat: false
|
|
||||||
text: "Screen edge"
|
|
||||||
|
|
||||||
QtExtras.MouseEventListener {
|
|
||||||
anchors.fill: parent
|
|
||||||
property int lastX
|
|
||||||
property int lastY
|
|
||||||
property int startMouseX
|
|
||||||
property int startMouseY
|
|
||||||
onPressed: {
|
|
||||||
lastX = mouse.screenX
|
|
||||||
lastY = mouse.screenY
|
|
||||||
startMouseX = mouse.x
|
|
||||||
startMouseY = mouse.y
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case 3:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.y = configDialog.y - panel.height
|
|
||||||
break
|
|
||||||
//LeftEdge
|
|
||||||
case 5:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.x = configDialog.x - panel.width
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case 6:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.x = configDialog.x + configDialog.width
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.y = configDialog.y + configDialog.height
|
|
||||||
}
|
|
||||||
|
|
||||||
lastX = mouse.screenX
|
|
||||||
lastY = mouse.screenY
|
|
||||||
|
|
||||||
var screenAspect = panel.screenGeometry.height / panel.screenGeometry.width
|
|
||||||
var newLocation = panel.location
|
|
||||||
|
|
||||||
//If the mouse is in an internal rectangle, do nothing
|
|
||||||
if ((mouse.screenX > panel.screenGeometry.x + panel.screenGeometry.width/3 &&
|
|
||||||
mouse.screenX < panel.screenGeometry.x + panel.screenGeometry.width/3*2) &&
|
|
||||||
(mouse.screenY > panel.screenGeometry.y + panel.screenGeometry.height/3 &&
|
|
||||||
mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height/3*2)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (mouse.screenY < panel.screenGeometry.y+(mouse.screenX-panel.screenGeometry.x)*screenAspect) {
|
|
||||||
if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) {
|
|
||||||
if (panel.location == 3) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = PlasmaCore.Types.TopEdge;
|
|
||||||
}
|
|
||||||
} else if (panel.location == 6) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = PlasmaCore.Types.RightEdge;
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
if (mouse.screenY < panel.screenGeometry.y + panel.screenGeometry.height-(mouse.screenX-panel.screenGeometry.x)*screenAspect) {
|
|
||||||
if (panel.location == 5) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = PlasmaCore.Types.LeftEdge;
|
|
||||||
}
|
|
||||||
} else if(panel.location == 4) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
newLocation = PlasmaCore.Types.BottomEdge;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
panel.location = newLocation
|
|
||||||
print("New Location: " + newLocation);
|
|
||||||
}
|
|
||||||
onReleased: {
|
|
||||||
panelResetAnimation.running = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,352 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property alias offset: offsetHandle.value
|
|
||||||
property alias minimumLength: minimumLengthHandle.value
|
|
||||||
property alias maximumLength: maximumLengthHandle.value
|
|
||||||
|
|
||||||
imagePath: "widgets/containment-controls"
|
|
||||||
state: "BottomEdge"
|
|
||||||
implicitWidth: offsetHandle.width + minimumLengthHandle.width
|
|
||||||
implicitHeight: offsetHandle.height + minimumLengthHandle.height
|
|
||||||
|
|
||||||
onMinimumLengthChanged: leftMinimumLengthHandle.value = minimumLength
|
|
||||||
onMaximumLengthChanged: leftMaximumLengthHandle.value = maximumLength
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
offsetHandle.value = panel.offset
|
|
||||||
minimumLengthHandle.value = panel.minimumLength
|
|
||||||
maximumLengthHandle.value = panel.maximumLength
|
|
||||||
leftMinimumLengthHandle.value = panel.minimumLength
|
|
||||||
leftMaximumLengthHandle.value = panel.maximumLength
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.Svg {
|
|
||||||
id: containmentControlsSvg
|
|
||||||
imagePath: "widgets/containment-controls"
|
|
||||||
}
|
|
||||||
PlasmaCore.SvgItem {
|
|
||||||
id: centerMark
|
|
||||||
svg: containmentControlsSvg
|
|
||||||
elementId: dialogRoot.vertical ? "vertical-centerindicator" : "horizontal-centerindicator"
|
|
||||||
visible: panel.alignment == Qt.AlignCenter
|
|
||||||
width: dialogRoot.vertical ? parent.width : naturalSize.width
|
|
||||||
height: dialogRoot.vertical ? naturalSize.height : parent.height
|
|
||||||
anchors.centerIn: parent
|
|
||||||
}
|
|
||||||
|
|
||||||
SliderHandle {
|
|
||||||
id: offsetHandle
|
|
||||||
graphicElementName: "offsetslider"
|
|
||||||
onValueChanged: panel.offset = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: minimumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignLeft
|
|
||||||
visible: panel.alignment != Qt.AlignRight
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "minslider"
|
|
||||||
onValueChanged: panel.minimumLength = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: maximumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignLeft
|
|
||||||
visible: panel.alignment != Qt.AlignRight
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "maxslider"
|
|
||||||
onValueChanged: panel.maximumLength = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: leftMinimumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignRight
|
|
||||||
visible: panel.alignment != Qt.AlignLeft
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "maxslider"
|
|
||||||
onValueChanged: panel.minimumLength = value
|
|
||||||
}
|
|
||||||
SliderHandle {
|
|
||||||
id: leftMaximumLengthHandle
|
|
||||||
alignment: panel.alignment | Qt.AlignRight
|
|
||||||
visible: panel.alignment != Qt.AlignLeft
|
|
||||||
offset: panel.offset
|
|
||||||
graphicElementName: "minslider"
|
|
||||||
onValueChanged: panel.maximumLength = value
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "north"
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: undefined
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "south"
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: root.top
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "west"
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: root.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: root.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
prefix: "east"
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: undefined
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: offsetHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: minimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: maximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMinimumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: leftMaximumLengthHandle
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
flat: false
|
|
||||||
text: "Height"
|
|
||||||
QtExtras.MouseEventListener {
|
|
||||||
anchors.fill: parent
|
|
||||||
property int startMouseX
|
|
||||||
property int startMouseY
|
|
||||||
onPressed: {
|
|
||||||
startMouseX = mouse.x
|
|
||||||
startMouseY = mouse.y
|
|
||||||
}
|
|
||||||
onPositionChanged: {
|
|
||||||
switch (panel.location) {
|
|
||||||
//TopEdge
|
|
||||||
case 3:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.thickness = configDialog.y - panel.y
|
|
||||||
break;
|
|
||||||
//LeftEdge
|
|
||||||
case 5:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.thickness = configDialog.x - panel.x
|
|
||||||
break;
|
|
||||||
//RightEdge
|
|
||||||
case 6:
|
|
||||||
configDialog.x = mouse.screenX - mapToItem(dialogRoot, startMouseX, 0).x
|
|
||||||
panel.thickness = (panel.x + panel.width) - (configDialog.x + configDialog.width)
|
|
||||||
break;
|
|
||||||
//BottomEdge
|
|
||||||
case 4:
|
|
||||||
default:
|
|
||||||
configDialog.y = mouse.screenY - mapToItem(dialogRoot, 0, startMouseY).y
|
|
||||||
panel.thickness = (panel.y + panel.height) - (configDialog.y + configDialog.height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,166 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0 as QtExtras
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.SvgItem {
|
|
||||||
id: root
|
|
||||||
svg: containmentControlsSvg
|
|
||||||
state: parent.state
|
|
||||||
width: naturalSize.width
|
|
||||||
height: naturalSize.height
|
|
||||||
|
|
||||||
//value expressed by this slider
|
|
||||||
property int value
|
|
||||||
//name of the graphics to load
|
|
||||||
property string graphicElementName
|
|
||||||
//where the point "0" is
|
|
||||||
property int offset: 0
|
|
||||||
//handle type: behave in different ways based on the alignment
|
|
||||||
property int alignment: panel.alignment
|
|
||||||
|
|
||||||
function syncPos() {
|
|
||||||
if (dialogRoot.vertical) {
|
|
||||||
if (alignment == Qt.AlignRight) {
|
|
||||||
y = root.parent.height - (value + offset + root.height/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
y = value + offset - root.height/2
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
y = root.parent.height/2 - value/2 - offset + root.height/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
y = root.parent.height/2 + value/2 + offset - root.height/2
|
|
||||||
} else {
|
|
||||||
y = root.parent.height/2 + value + offset -root.height/2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (alignment == Qt.AlignRight) {
|
|
||||||
x = root.parent.width - (value + offset + root.width/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
x = value + offset - root.width/2
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
x = root.parent.width/2 - value/2 + offset - root.width/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
x = root.parent.width/2 + value/2 + offset -root.width/2
|
|
||||||
} else {
|
|
||||||
x = root.parent.width/2 + value + offset -root.width/2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onValueChanged: syncPos()
|
|
||||||
onOffsetChanged: syncPos()
|
|
||||||
onAlignmentChanged: syncPos()
|
|
||||||
Connections {
|
|
||||||
target: root.parent
|
|
||||||
onWidthChanged: syncPos()
|
|
||||||
onHeightChanged: syncPos()
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
drag {
|
|
||||||
target: parent
|
|
||||||
axis: (dialogRoot.vertical) ? Drag.YAxis : Drag.XAxis
|
|
||||||
}
|
|
||||||
anchors.fill: parent
|
|
||||||
onPositionChanged: {
|
|
||||||
if (dialogRoot.vertical) {
|
|
||||||
if (root.alignment == Qt.AlignRight) {
|
|
||||||
root.value = root.parent.height - (parent.y + offset + root.height/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
root.value = parent.y - offset + root.height/2
|
|
||||||
//Center
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
root.value = (root.parent.height/2 - parent.y + offset)*2 + root.height/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
root.value = (parent.y - offset - root.parent.height/2)*2 + root.height/2
|
|
||||||
} else {
|
|
||||||
var value = parent.y - root.parent.height/2 - offset + root.height/2
|
|
||||||
//Snap
|
|
||||||
if (Math.abs(value) < 5) {
|
|
||||||
root.value = 0
|
|
||||||
} else {
|
|
||||||
root.value = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (root.alignment == Qt.AlignRight) {
|
|
||||||
root.value = root.parent.width - (parent.x + offset + root.width/2)
|
|
||||||
} else if (alignment == Qt.AlignLeft) {
|
|
||||||
root.value = parent.x - offset + root.width/2
|
|
||||||
//Center
|
|
||||||
} else {
|
|
||||||
if (root.alignment & Qt.AlignRight) {
|
|
||||||
root.value = (root.parent.width/2 - parent.x + offset)*2 + root.width/2
|
|
||||||
} else if (root.alignment & Qt.AlignLeft) {
|
|
||||||
root.value = (parent.x - offset - root.parent.width/2)*2 + root.width/2
|
|
||||||
} else {
|
|
||||||
var value = parent.x - root.parent.width/2 - offset + root.width/2
|
|
||||||
//Snap
|
|
||||||
if (Math.abs(value) < 5) {
|
|
||||||
root.value = 0
|
|
||||||
} else {
|
|
||||||
root.value = value
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "north-" + graphicElementName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "south-" + graphicElementName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "west-" + graphicElementName
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
elementId: "east-" + graphicElementName
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,232 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.configuration 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: root
|
|
||||||
state: parent.state
|
|
||||||
implicitWidth: column.width + 20
|
|
||||||
implicitHeight: row.height + 20
|
|
||||||
PlasmaComponents.ButtonRow {
|
|
||||||
id: row
|
|
||||||
spacing: 0
|
|
||||||
exclusive: false
|
|
||||||
visible: !dialogRoot.vertical
|
|
||||||
anchors {
|
|
||||||
centerIn: parent
|
|
||||||
}
|
|
||||||
EdgeHandle {
|
|
||||||
id: edgeHandle
|
|
||||||
}
|
|
||||||
SizeHandle {
|
|
||||||
id: sizeHandle
|
|
||||||
}
|
|
||||||
}
|
|
||||||
//FIXME: remove this duplication, use desktopcomponents linear layouts that can switch between horizontal and vertical
|
|
||||||
PlasmaComponents.ButtonColumn {
|
|
||||||
id: column
|
|
||||||
spacing: 0
|
|
||||||
exclusive: false
|
|
||||||
visible: dialogRoot.vertical
|
|
||||||
anchors {
|
|
||||||
centerIn: parent
|
|
||||||
}
|
|
||||||
EdgeHandle {
|
|
||||||
width: 80
|
|
||||||
}
|
|
||||||
SizeHandle {
|
|
||||||
width: 80
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: moreSettingsButton
|
|
||||||
property QtObject contextMenu
|
|
||||||
text: "More settings"
|
|
||||||
onClicked: {
|
|
||||||
if (!contextMenu) {
|
|
||||||
contextMenu = contextMenuComponent.createObject(moreSettingsButton)
|
|
||||||
}
|
|
||||||
contextMenu.open()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: contextMenuComponent
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
visualParent: moreSettingsButton
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
id: leftToggle
|
|
||||||
text: "Left"
|
|
||||||
checkable: true
|
|
||||||
checked: panel.alignment == Qt.AlignLeft
|
|
||||||
onClicked: panel.alignment = Qt.AlignLeft
|
|
||||||
onToggled: {
|
|
||||||
if (checked) {
|
|
||||||
centerToggle.checked = false
|
|
||||||
rightToggle.checked = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
id: centerToggle
|
|
||||||
text: "Center"
|
|
||||||
checkable: true
|
|
||||||
checked: panel.alignment == Qt.AlignCenter
|
|
||||||
onClicked: panel.alignment = Qt.AlignCenter
|
|
||||||
onToggled: {
|
|
||||||
if (checked) {
|
|
||||||
leftToggle.checked = false
|
|
||||||
rightToggle.checked = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
id: rightToggle
|
|
||||||
text: "Right"
|
|
||||||
checkable: true
|
|
||||||
checked: panel.alignment == Qt.AlignRight
|
|
||||||
onClicked: panel.alignment = Qt.AlignRight
|
|
||||||
onToggled: {
|
|
||||||
if (checked) {
|
|
||||||
centerToggle.checked = false
|
|
||||||
leftToggle.checked = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//BEGIN States
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "TopEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: undefined
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: root.verticalCenter
|
|
||||||
horizontalCenter: undefined
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "BottomEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
height: root.implicitHeight
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: undefined
|
|
||||||
left: root.parent.left
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: root.verticalCenter
|
|
||||||
horizontalCenter: undefined
|
|
||||||
top: undefined
|
|
||||||
bottom: undefined
|
|
||||||
left: undefined
|
|
||||||
right: root.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "LeftEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: undefined
|
|
||||||
right: root.parent.right
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: undefined
|
|
||||||
horizontalCenter: root.verticalCenter
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "RightEdge"
|
|
||||||
PropertyChanges {
|
|
||||||
target: root
|
|
||||||
width: root.implicitWidth
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: root
|
|
||||||
anchors {
|
|
||||||
top: root.parent.top
|
|
||||||
bottom: root.parent.bottom
|
|
||||||
left: root.parent.left
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
AnchorChanges {
|
|
||||||
target: moreSettingsButton
|
|
||||||
anchors {
|
|
||||||
verticalCenter: undefined
|
|
||||||
horizontalCenter: root.verticalCenter
|
|
||||||
top: undefined
|
|
||||||
bottom: root.bottom
|
|
||||||
left: undefined
|
|
||||||
right: undefined
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
//END States
|
|
||||||
}
|
|
@ -1,19 +0,0 @@
|
|||||||
[Desktop]
|
|
||||||
Containment=org.kde.desktopcontainment
|
|
||||||
ToolBox=org.kde.desktoptoolbox
|
|
||||||
RuntimePlatform=
|
|
||||||
|
|
||||||
[Desktop][ContainmentActions]
|
|
||||||
RightButton;NoModifier=org.kde.contextmenu
|
|
||||||
MidButton;NoModifier=org.kde.paste
|
|
||||||
wheel:Vertical;NoModifier=org.kde.switchdesktop
|
|
||||||
|
|
||||||
[Panel]
|
|
||||||
Containment=org.kde.panel
|
|
||||||
ToolBox=org.kde.paneltoolbox
|
|
||||||
[Panel][ContainmentActions]
|
|
||||||
RightButton;NoModifier=org.kde.contextmenu
|
|
||||||
MidButton;NoModifier=org.kde.paste
|
|
||||||
|
|
||||||
[Theme]
|
|
||||||
Theme=default
|
|
@ -1,197 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.draganddrop 2.0
|
|
||||||
import org.kde.qtextracomponents 2.0
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: background
|
|
||||||
width: list.delegateWidth
|
|
||||||
height: list.delegateHeight
|
|
||||||
|
|
||||||
property variant icon: decoration
|
|
||||||
property string title: name
|
|
||||||
property string description: model.description
|
|
||||||
property string author: model.author
|
|
||||||
property string email: model.email
|
|
||||||
property string license: model.license
|
|
||||||
property string pluginName: model.pluginName
|
|
||||||
property bool local: model.local
|
|
||||||
|
|
||||||
ListView.onRemove: SequentialAnimation {
|
|
||||||
PropertyAction {
|
|
||||||
target: background
|
|
||||||
property: "ListView.delayRemove"
|
|
||||||
value: true
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "y" : "x"
|
|
||||||
to: widgetExplorer.orientation == Qt.Horizontal ? list.delegateHeight : list.delegateWidth
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "y" : "x"
|
|
||||||
to: widgetExplorer.orientation == Qt.Horizontal ? list.delegateHeight : list.delegateWidth
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "width" : "height"
|
|
||||||
from: widgetExplorer.orientation == Qt.Horizontal ? list.delegateWidth : list.delegateHeight
|
|
||||||
to: 0
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
PropertyAction {
|
|
||||||
target: background
|
|
||||||
property: "ListView.delayRemove"
|
|
||||||
value: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ListView.onAdd: SequentialAnimation {
|
|
||||||
PropertyAction {
|
|
||||||
target: background
|
|
||||||
property: "y"
|
|
||||||
value: widgetExplorer.orientation == Qt.Horizontal ? -list.delegateHeight : -list.delegateWidth
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "width" : "height"
|
|
||||||
from: 0
|
|
||||||
to: widgetExplorer.orientation == Qt.Horizontal ? list.delegateWidth : list.delegateHeight
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: background
|
|
||||||
property: widgetExplorer.orientation == Qt.Horizontal ? "y" : "x"
|
|
||||||
to: 0
|
|
||||||
duration: 150
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
imagePath: "widgets/viewitem"
|
|
||||||
prefix: "normal"
|
|
||||||
|
|
||||||
DragArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
supportedActions: Qt.MoveAction | Qt.LinkAction
|
|
||||||
onDragStarted: tooltipDialog.visible = false
|
|
||||||
delegateImage: background.icon
|
|
||||||
mimeData {
|
|
||||||
source: parent
|
|
||||||
}
|
|
||||||
Component.onCompleted: mimeData.setData("text/x-plasmoidservicename", pluginName)
|
|
||||||
|
|
||||||
QIconItem {
|
|
||||||
id: iconWidget
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
x: y
|
|
||||||
width: theme.hugeIconSize
|
|
||||||
height: width
|
|
||||||
icon: background.icon
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
anchors {
|
|
||||||
left: iconWidget.right
|
|
||||||
right: parent.right
|
|
||||||
verticalCenter: parent.verticalCenter
|
|
||||||
|
|
||||||
leftMargin: background.margins.left
|
|
||||||
rightMargin: background.margins.right
|
|
||||||
}
|
|
||||||
spacing: 4
|
|
||||||
PlasmaExtras.Heading {
|
|
||||||
id: titleText
|
|
||||||
level: 4
|
|
||||||
text: title
|
|
||||||
// font {
|
|
||||||
// weight: Font.Bold
|
|
||||||
// pointSize: theme.smallestFont.pointSize
|
|
||||||
// }
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
height: paintedHeight
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
//go with nowrap only if there is a single word too long
|
|
||||||
onPaintedWidthChanged: {
|
|
||||||
wrapTimer.restart()
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: wrapTimer
|
|
||||||
interval: 200
|
|
||||||
onTriggered: {
|
|
||||||
//give it some pixels of tolerance
|
|
||||||
if (titleText.paintedWidth > titleText.width + 3) {
|
|
||||||
titleText.wrapMode = Text.NoWrap
|
|
||||||
titleText.elide = Text.ElideRight
|
|
||||||
} else {
|
|
||||||
titleText.wrapMode = Text.WordWrap
|
|
||||||
titleText.elide = Text.ElideNone
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: description
|
|
||||||
font.pointSize: theme.smallestFont.pointSize
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
//elide: Text.ElideRight
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
verticalAlignment: Text.AlignTop
|
|
||||||
maximumLineCount: 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QIconItem {
|
|
||||||
icon: running ? "dialog-ok-apply" : undefined
|
|
||||||
visible: running
|
|
||||||
width: theme.smallIconSize
|
|
||||||
height: width
|
|
||||||
anchors {
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
rightMargin: background.margins.right
|
|
||||||
bottomMargin: background.margins.bottom
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onDoubleClicked: widgetExplorer.addApplet(pluginName)
|
|
||||||
onEntered: tooltipDialog.appletDelegate = background
|
|
||||||
onExited: tooltipDialog.appletDelegate = null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,51 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2013 Sebastian Kügler <sebas@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
//import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
//import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
color: "pink"
|
|
||||||
width: 400
|
|
||||||
height: 800
|
|
||||||
|
|
||||||
ListView {
|
|
||||||
anchors.fill: parent
|
|
||||||
model: widgetExplorer.widgetsModel
|
|
||||||
header: PlasmaExtras.Title { text: "Add Widgets" }
|
|
||||||
delegate: Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 48
|
|
||||||
Text { text: "Applet: " + pluginName }
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: widgetExplorer.addApplet(pluginName)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
print("WidgetExplorer QML loaded");
|
|
||||||
print(" found " + widgetExplorer.widgetsModel.count + " widgets");
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,148 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.1
|
|
||||||
import QtQuick.Layouts 1.0 as Layouts
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
|
|
||||||
MouseArea {
|
|
||||||
id: main
|
|
||||||
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: toolTipHideTimer.running = false
|
|
||||||
onExited: toolTipHideTimer.running = true
|
|
||||||
|
|
||||||
width: theme.mSize(theme.defaultFont).width * 35
|
|
||||||
height: theme.mSize(theme.defaultFont).height * 16
|
|
||||||
|
|
||||||
property variant icon
|
|
||||||
property string title
|
|
||||||
property string description
|
|
||||||
property string author
|
|
||||||
property string email
|
|
||||||
property string license
|
|
||||||
property string pluginName
|
|
||||||
property bool local
|
|
||||||
|
|
||||||
onClicked: tooltipDialog.visible = false
|
|
||||||
Connections {
|
|
||||||
target: tooltipDialog
|
|
||||||
onAppletDelegateChanged: {
|
|
||||||
if (!tooltipDialog.appletDelegate) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
icon = tooltipDialog.appletDelegate.icon
|
|
||||||
title = tooltipDialog.appletDelegate.title
|
|
||||||
description = tooltipDialog.appletDelegate.description
|
|
||||||
author = tooltipDialog.appletDelegate.author
|
|
||||||
email = tooltipDialog.appletDelegate.email
|
|
||||||
license = tooltipDialog.appletDelegate.license
|
|
||||||
pluginName = tooltipDialog.appletDelegate.pluginName
|
|
||||||
local = tooltipDialog.appletDelegate.local
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaCore.IconItem {
|
|
||||||
id: tooltipIconWidget
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
top: parent.top
|
|
||||||
margins: 8
|
|
||||||
}
|
|
||||||
width: theme.hugeIconSize
|
|
||||||
height: width
|
|
||||||
source: main.icon
|
|
||||||
}
|
|
||||||
Column {
|
|
||||||
id: nameColumn
|
|
||||||
spacing: 8
|
|
||||||
anchors {
|
|
||||||
left: tooltipIconWidget.right
|
|
||||||
margins: 8
|
|
||||||
top: parent.top
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaExtras.Heading {
|
|
||||||
text: title
|
|
||||||
level: 2
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
height: paintedHeight
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: description
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Layouts.GridLayout {
|
|
||||||
columns: 2
|
|
||||||
anchors {
|
|
||||||
top: (nameColumn.height > tooltipIconWidget.height) ? nameColumn.bottom : tooltipIconWidget.bottom
|
|
||||||
topMargin: 16
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: i18n("License:")
|
|
||||||
Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
id: licenseText
|
|
||||||
text: license
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: i18n("Author:")
|
|
||||||
Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: author
|
|
||||||
wrapMode: Text.Wrap
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: i18n("Email:")
|
|
||||||
Layouts.Layout.alignment: Qt.AlignVCenter|Qt.AlignRight
|
|
||||||
}
|
|
||||||
PlasmaComponents.Label {
|
|
||||||
text: email
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: uninstallButton
|
|
||||||
anchors {
|
|
||||||
horizontalCenter: parent.horizontalCenter
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
opacity: local ? 1 : 0
|
|
||||||
Behavior on opacity {
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
iconSource: "application-exit"
|
|
||||||
text: i18n("Uninstall")
|
|
||||||
onClicked: {
|
|
||||||
widgetExplorer.uninstall(pluginName)
|
|
||||||
tooltipDialog.visible = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,366 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2011 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Library General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 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 Library General Public
|
|
||||||
* License along with this program; if not, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
|
||||||
import org.kde.qtextracomponents 2.0
|
|
||||||
import QtQuick.Window 2.1
|
|
||||||
import org.kde.plasma.private.shell 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: main
|
|
||||||
|
|
||||||
width: 240
|
|
||||||
height: 800//Screen.height
|
|
||||||
//this is used to perfectly align the filter field and delegates
|
|
||||||
property int cellWidth: theme.mSize(theme.defaultFont).width * 10
|
|
||||||
|
|
||||||
property int minimumWidth: theme.mSize(theme.defaultFont).width * 12
|
|
||||||
property int minimumHeight: 800//topBar.height + list.delegateHeight + (widgetExplorer.orientation == Qt.Horizontal ? scrollBar.height : 0) + 4
|
|
||||||
|
|
||||||
property alias containment: widgetExplorer.containment
|
|
||||||
|
|
||||||
property Item getWidgetsButton
|
|
||||||
property Item categoryButton
|
|
||||||
|
|
||||||
signal closed()
|
|
||||||
|
|
||||||
WidgetExplorer {
|
|
||||||
id: widgetExplorer
|
|
||||||
//view: desktop
|
|
||||||
onShouldClose: main.closed();
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
id: categoriesDialog
|
|
||||||
visualParent: main.categoryButton
|
|
||||||
}
|
|
||||||
Repeater {
|
|
||||||
parent: categoriesDialog
|
|
||||||
model: widgetExplorer.filterModel
|
|
||||||
delegate: Item {
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
text: display
|
|
||||||
separator: model["separator"] != undefined ? model["separator"] : false
|
|
||||||
onClicked: {
|
|
||||||
list.contentX = 0
|
|
||||||
list.contentY = 0
|
|
||||||
main.categoryButton.text = display
|
|
||||||
widgetExplorer.widgetsModel.filterQuery = model["filterData"]
|
|
||||||
widgetExplorer.widgetsModel.filterType = model["filterType"]
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
parent = categoriesDialog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaComponents.ContextMenu {
|
|
||||||
id: getWidgetsDialog
|
|
||||||
visualParent: main.getWidgetsButton
|
|
||||||
}
|
|
||||||
Repeater {
|
|
||||||
parent: getWidgetsDialog
|
|
||||||
model: widgetExplorer.widgetsMenuActions
|
|
||||||
delegate: Item {
|
|
||||||
PlasmaComponents.MenuItem {
|
|
||||||
icon: modelData.icon
|
|
||||||
text: modelData.text
|
|
||||||
separator: modelData.separator
|
|
||||||
onClicked: modelData.trigger()
|
|
||||||
Component.onCompleted: {
|
|
||||||
parent = getWidgetsDialog
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.Dialog {
|
|
||||||
id: tooltipDialog
|
|
||||||
property Item appletDelegate
|
|
||||||
location: PlasmaCore.Types.LeftEdge
|
|
||||||
|
|
||||||
type: PlasmaCore.Dialog.Tooltip
|
|
||||||
windowFlags:Qt.Window|Qt.WindowStaysOnTopHint|Qt.X11BypassWindowManagerHint
|
|
||||||
|
|
||||||
onAppletDelegateChanged: {
|
|
||||||
if (!appletDelegate) {
|
|
||||||
toolTipHideTimer.restart()
|
|
||||||
toolTipShowTimer.running = false
|
|
||||||
} else if (tooltipDialog.visible) {
|
|
||||||
tooltipDialog.visualParent = appletDelegate
|
|
||||||
tooltipDialog.x = point.x
|
|
||||||
tooltipDialog.y = point.y
|
|
||||||
} else {
|
|
||||||
tooltipDialog.visualParent = appletDelegate
|
|
||||||
toolTipShowTimer.restart()
|
|
||||||
toolTipHideTimer.running = false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
mainItem: Tooltip { id: tooltipWidget }
|
|
||||||
Behavior on x {
|
|
||||||
enabled: widgetExplorer.orientation == Qt.Horizontal
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
Behavior on y {
|
|
||||||
enabled: widgetExplorer.orientation == Qt.Vertical
|
|
||||||
NumberAnimation { duration: 250 }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: toolTipShowTimer
|
|
||||||
interval: 500
|
|
||||||
repeat: false
|
|
||||||
onTriggered: {
|
|
||||||
tooltipDialog.visible = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Timer {
|
|
||||||
id: toolTipHideTimer
|
|
||||||
interval: 1000
|
|
||||||
repeat: false
|
|
||||||
onTriggered: tooltipDialog.visible = false
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: topBar
|
|
||||||
property Item categoryButton
|
|
||||||
|
|
||||||
sourceComponent: (widgetExplorer.orientation == Qt.Horizontal) ? horizontalTopBarComponent : verticalTopBarComponent
|
|
||||||
height: item.height + 2
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
|
|
||||||
topMargin: widgetExplorer.orientation == Qt.Horizontal ? 4 : 0
|
|
||||||
leftMargin: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: horizontalTopBarComponent
|
|
||||||
|
|
||||||
Item {
|
|
||||||
anchors {
|
|
||||||
top: parent.top
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
height: filterField.height
|
|
||||||
Row {
|
|
||||||
spacing: 5
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
leftMargin: 2
|
|
||||||
}
|
|
||||||
PlasmaComponents.TextField {
|
|
||||||
id: filterField
|
|
||||||
width: list.width / Math.floor(list.width / cellWidth) - 4
|
|
||||||
clearButtonShown: true
|
|
||||||
placeholderText: i18n("Enter search term...")
|
|
||||||
onTextChanged: {
|
|
||||||
list.contentX = 0
|
|
||||||
list.contentY = 0
|
|
||||||
widgetExplorer.widgetsModel.searchTerm = text
|
|
||||||
}
|
|
||||||
Component.onCompleted: forceActiveFocus()
|
|
||||||
}
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: categoryButton
|
|
||||||
text: i18n("Categories")
|
|
||||||
onClicked: categoriesDialog.open(0, categoryButton.height)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Row {
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: 5
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
id: getWidgetsButton
|
|
||||||
iconSource: "get-hot-new-stuff"
|
|
||||||
text: i18n("Get new widgets")
|
|
||||||
onClicked: getWidgetsDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: widgetExplorer.extraActions.length
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
iconSource: widgetExplorer.extraActions[modelData].icon
|
|
||||||
text: widgetExplorer.extraActions[modelData].text
|
|
||||||
onClicked: {
|
|
||||||
widgetExplorer.extraActions[modelData].trigger()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
iconSource: "window-close"
|
|
||||||
onClicked: main.closed()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
main.getWidgetsButton = getWidgetsButton
|
|
||||||
main.categoryButton = categoryButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: verticalTopBarComponent
|
|
||||||
|
|
||||||
Column {
|
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.left:parent.left
|
|
||||||
anchors.right: parent.right
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
PlasmaComponents.ToolButton {
|
|
||||||
anchors.right: parent.right
|
|
||||||
iconSource: "window-close"
|
|
||||||
onClicked: main.closed()
|
|
||||||
}
|
|
||||||
PlasmaComponents.TextField {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
clearButtonShown: true
|
|
||||||
placeholderText: i18n("Enter search term...")
|
|
||||||
onTextChanged: {
|
|
||||||
list.contentX = 0
|
|
||||||
list.contentY = 0
|
|
||||||
widgetExplorer.widgetsModel.searchTerm = text
|
|
||||||
}
|
|
||||||
Component.onCompleted: forceActiveFocus()
|
|
||||||
}
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
id: categoryButton
|
|
||||||
text: i18n("Categories")
|
|
||||||
onClicked: categoriesDialog.open(0, categoryButton.height)
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
main.categoryButton = categoryButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MouseEventListener {
|
|
||||||
id: listParent
|
|
||||||
anchors {
|
|
||||||
top: topBar.bottom
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: widgetExplorer.orientation == Qt.Horizontal ? parent.bottom : bottomBar.top
|
|
||||||
leftMargin: 4
|
|
||||||
bottomMargin: 4
|
|
||||||
}
|
|
||||||
onWheelMoved: {
|
|
||||||
//use this only if the wheel orientation is vertical and the list orientation is horizontal, otherwise will be the list itself managing the wheel
|
|
||||||
if (wheel.orientation == Qt.Vertical && list.orientation == ListView.Horizontal) {
|
|
||||||
var delta = wheel.delta > 0 ? 20 : -20
|
|
||||||
list.contentX = Math.min(Math.max(0, list.contentWidth - list.width),
|
|
||||||
Math.max(0, list.contentX - delta))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
PlasmaExtras.ScrollArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
ListView {
|
|
||||||
id: list
|
|
||||||
|
|
||||||
property int delegateWidth: (widgetExplorer.orientation == Qt.Horizontal) ? (list.width / Math.floor(list.width / cellWidth)) : list.width
|
|
||||||
property int delegateHeight: theme.defaultFont.pixelSize * 7 - 4
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
orientation: widgetExplorer.orientation == Qt.Horizontal ? ListView.Horizontal : ListView.Vertical
|
|
||||||
snapMode: ListView.SnapToItem
|
|
||||||
model: widgetExplorer.widgetsModel
|
|
||||||
|
|
||||||
clip: widgetExplorer.orientation == Qt.Vertical
|
|
||||||
|
|
||||||
delegate: AppletDelegate {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Loader {
|
|
||||||
id: bottomBar
|
|
||||||
|
|
||||||
sourceComponent: (widgetExplorer.orientation == Qt.Horizontal) ? undefined : verticalBottomBarComponent
|
|
||||||
//height: item.height
|
|
||||||
height: 48 // FIXME
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
leftMargin: 4
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component {
|
|
||||||
id: verticalBottomBarComponent
|
|
||||||
Column {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
bottom: parent.bottom
|
|
||||||
}
|
|
||||||
|
|
||||||
spacing: 4
|
|
||||||
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
id: getWidgetsButton
|
|
||||||
iconSource: "get-hot-new-stuff"
|
|
||||||
text: i18n("Get new widgets")
|
|
||||||
onClicked: getWidgetsDialog.open()
|
|
||||||
}
|
|
||||||
|
|
||||||
Repeater {
|
|
||||||
model: widgetExplorer.extraActions.length
|
|
||||||
PlasmaComponents.Button {
|
|
||||||
anchors {
|
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
iconSource: widgetExplorer.extraActions[modelData].icon
|
|
||||||
text: widgetExplorer.extraActions[modelData].text
|
|
||||||
onClicked: {
|
|
||||||
widgetExplorer.extraActions[modelData].trigger()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
main.getWidgetsButton = getWidgetsButton
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
var panel = new Panel
|
|
||||||
panel.screen = 0
|
|
||||||
panel.location = 'top'
|
|
||||||
panel.addWidget("org.kde.kickoff")
|
|
||||||
panel.addWidget("org.kde.plasma.taskmanager")
|
|
||||||
panel.addWidget("org.kde.systemtray")
|
|
||||||
|
|
||||||
for (var i = 0; i < screenCount; ++i) {
|
|
||||||
var desktop = new Activity
|
|
||||||
desktop.name = i18n("Desktop")
|
|
||||||
desktop.screen = i
|
|
||||||
desktop.wallpaperPlugin = 'org.kde.image'
|
|
||||||
|
|
||||||
var clock = desktop.addWidget("org.kde.analogclock");
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
/* vim:set foldmethod=marker:
|
|
||||||
*
|
|
||||||
* Copyright (C) 2013 Ivan Cukic <ivan.cukic(at)kde.org>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License version 2,
|
|
||||||
* or (at your option) any later version, as published by the Free
|
|
||||||
* Software Foundation
|
|
||||||
*
|
|
||||||
* 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, write to the
|
|
||||||
* Free Software Foundation, Inc.,
|
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2
|
|
||||||
import org.kde.solid 1.0 as Solid
|
|
||||||
import QtQuick.Window 2.0
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: main
|
|
||||||
|
|
||||||
property string shell : "org.kde.desktop"
|
|
||||||
property bool willing : true
|
|
||||||
property int priority : 1
|
|
||||||
|
|
||||||
// This is not needed, but allows the
|
|
||||||
// handler to know whether its shell is loaded
|
|
||||||
property bool loaded : false
|
|
||||||
|
|
||||||
Solid.Devices {
|
|
||||||
id: keyboards
|
|
||||||
query: "IS Keyboard"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,191 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
|
||||||
import "../activitymanager"
|
|
||||||
import "../explorer"
|
|
||||||
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: root
|
|
||||||
color: Qt.rgba(0, 0, 0, 0.2)
|
|
||||||
width: 1024
|
|
||||||
height: 768
|
|
||||||
|
|
||||||
property Item containment
|
|
||||||
|
|
||||||
function toggleWidgetExplorer(containment) {
|
|
||||||
console.log("Widget Explorer toggled");
|
|
||||||
|
|
||||||
sidePanelStack.pop(blankPage);
|
|
||||||
|
|
||||||
if (sidePanelStack.state == "widgetExplorer") {
|
|
||||||
sidePanelStack.state = "closed";
|
|
||||||
} else {
|
|
||||||
var page = sidePanelStack.push(Qt.resolvedUrl("../explorer/WidgetExplorer.qml"));
|
|
||||||
page.closed.connect(function(){sidePanelStack.state = "closed";});
|
|
||||||
page.containment = containment;
|
|
||||||
sidePanelStack.state = "widgetExplorer";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleActivityManager() {
|
|
||||||
console.log("Activity manger toggled");
|
|
||||||
|
|
||||||
sidePanelStack.pop(blankPage);
|
|
||||||
|
|
||||||
if (sidePanelStack.state == "activityManager") {
|
|
||||||
sidePanelStack.state = "closed";
|
|
||||||
} else {
|
|
||||||
var page = sidePanelStack.push(Qt.resolvedUrl("../activitymanager/ActivityManager.qml"));
|
|
||||||
page.closed.connect(function(){sidePanelStack.state = "closed";});
|
|
||||||
sidePanelStack.state = "activityManager";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PlasmaCore.Dialog {
|
|
||||||
id: sidePanel
|
|
||||||
location: PlasmaCore.Types.LeftEdge
|
|
||||||
onVisibleChanged: {
|
|
||||||
if (!visible) {
|
|
||||||
sidePanelStack.pop(blankPage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
type: PlasmaCore.Dialog.Dock
|
|
||||||
windowFlags: Qt.Window|Qt.WindowStaysOnTopHint|Qt.X11BypassWindowManagerHint
|
|
||||||
|
|
||||||
mainItem: PlasmaComponents.PageStack {
|
|
||||||
id: sidePanelStack
|
|
||||||
state: "closed"
|
|
||||||
width: 250
|
|
||||||
height: 500
|
|
||||||
initialPage: Item {
|
|
||||||
id: blankPage
|
|
||||||
}
|
|
||||||
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "closed"
|
|
||||||
PropertyChanges {
|
|
||||||
target: sidePanel
|
|
||||||
visible: false
|
|
||||||
height: containment.availableScreenRegion(containment.screen)[0].height;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "widgetExplorer"
|
|
||||||
PropertyChanges {
|
|
||||||
target: sidePanel
|
|
||||||
visible: true
|
|
||||||
height: containment.availableScreenRegion(containment.screen)[0].height;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "activityManager"
|
|
||||||
PropertyChanges {
|
|
||||||
target: sidePanel
|
|
||||||
visible: true
|
|
||||||
height: containment.availableScreenRegion(containment.screen)[0].height;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onContainmentChanged: {
|
|
||||||
print("New Containment: " + containment);
|
|
||||||
print("Old Containment: " + internal.oldContainment);
|
|
||||||
//containment.parent = root;
|
|
||||||
containment.visible = true;
|
|
||||||
|
|
||||||
internal.newContainment = containment;
|
|
||||||
if (internal.oldContainment && internal.oldContainment != containment) {
|
|
||||||
switchAnim.running = true;
|
|
||||||
} else {
|
|
||||||
internal.oldContainment = containment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//some properties that shouldn't be accessible from elsewhere
|
|
||||||
QtObject {
|
|
||||||
id: internal;
|
|
||||||
|
|
||||||
property Item oldContainment;
|
|
||||||
property Item newContainment;
|
|
||||||
}
|
|
||||||
|
|
||||||
SequentialAnimation {
|
|
||||||
id: switchAnim
|
|
||||||
ScriptAction {
|
|
||||||
script: {
|
|
||||||
containment.anchors.left = undefined;
|
|
||||||
containment.anchors.top = undefined;
|
|
||||||
containment.anchors.right = undefined;
|
|
||||||
containment.anchors.bottom = undefined;
|
|
||||||
|
|
||||||
internal.oldContainment.anchors.left = undefined;
|
|
||||||
internal.oldContainment.anchors.top = undefined;
|
|
||||||
internal.oldContainment.anchors.right = undefined;
|
|
||||||
internal.oldContainment.anchors.bottom = undefined;
|
|
||||||
|
|
||||||
internal.oldContainment.z = 0;
|
|
||||||
internal.oldContainment.x = 0;
|
|
||||||
containment.z = 1;
|
|
||||||
containment.x = root.width;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ParallelAnimation {
|
|
||||||
NumberAnimation {
|
|
||||||
target: internal.oldContainment
|
|
||||||
properties: "x"
|
|
||||||
to: -root.width
|
|
||||||
duration: 400
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
NumberAnimation {
|
|
||||||
target: internal.newContainment
|
|
||||||
properties: "x"
|
|
||||||
to: 0
|
|
||||||
duration: 250
|
|
||||||
easing.type: Easing.InOutQuad
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ScriptAction {
|
|
||||||
script: {
|
|
||||||
containment.anchors.left = root.left;
|
|
||||||
containment.anchors.top = root.top;
|
|
||||||
containment.anchors.right = root.right;
|
|
||||||
containment.anchors.bottom = root.bottom;
|
|
||||||
|
|
||||||
internal.oldContainment.visible = false;
|
|
||||||
internal.oldContainment = containment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
//configure the view behavior
|
|
||||||
desktop.stayBehind = true;
|
|
||||||
desktop.fillScreen = true;
|
|
||||||
print("View org.kde.desktop QML loaded")
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,142 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2012 Marco Martin <mart@kde.org>
|
|
||||||
*
|
|
||||||
* 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, write to the Free Software
|
|
||||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
//import org.kde.plasma 2.0
|
|
||||||
|
|
||||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
||||||
|
|
||||||
|
|
||||||
PlasmaCore.FrameSvgItem {
|
|
||||||
id: root
|
|
||||||
width: 640
|
|
||||||
height: 32
|
|
||||||
imagePath: "widgets/panel-background"
|
|
||||||
|
|
||||||
property Item containment
|
|
||||||
|
|
||||||
function adjustBorders() {
|
|
||||||
if (!containment) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var borders = PlasmaCore.FrameSvg.AllBorders;
|
|
||||||
|
|
||||||
switch (containment.location) {
|
|
||||||
case PlasmaCore.Types.TopEdge:
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.TopBorder;
|
|
||||||
break;
|
|
||||||
case PlasmaCore.Types.LeftEdge:
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.LeftBorder;
|
|
||||||
break;
|
|
||||||
case PlasmaCore.Types.RightEdge:
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.RightBorder;
|
|
||||||
break;
|
|
||||||
case PlasmaCore.Types.BottomEdge:
|
|
||||||
default:
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.BottomBorder;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (panel.x <= panel.screen.geometry.x) {
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.LeftBorder;
|
|
||||||
}
|
|
||||||
if (panel.x + panel.width >= panel.screen.geometry.x + panel.screen.geometry.width) {
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.RightBorder;
|
|
||||||
}
|
|
||||||
if (panel.y <= panel.screen.geometry.y) {
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.TopBorder;
|
|
||||||
}
|
|
||||||
if (panel.y + panel.height >= panel.screen.geometry.y + panel.screen.geometry.height) {
|
|
||||||
borders = borders & ~PlasmaCore.FrameSvg.BottomBorder;
|
|
||||||
}
|
|
||||||
|
|
||||||
root.enabledBorders = borders;
|
|
||||||
}
|
|
||||||
|
|
||||||
onContainmentChanged: {
|
|
||||||
print("New panel Containment: " + containment)
|
|
||||||
//containment.parent = root
|
|
||||||
containment.visible = true
|
|
||||||
containment.anchors.fill = root
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: containment
|
|
||||||
onLocationChanged: {
|
|
||||||
adjustBorders()
|
|
||||||
}
|
|
||||||
onMinimumWidthChanged: {
|
|
||||||
if (containment.formFactor === PlasmaCore.Types.Horizontal) {
|
|
||||||
panel.width = Math.max(panel.width, panel.minimumLength);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onMaximumWidthChanged: {
|
|
||||||
if (containment.formFactor === PlasmaCore.Types.Horizontal) {
|
|
||||||
panel.width = Math.min(panel.width, panel.maximumLength);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onImplicitWidthChanged: {
|
|
||||||
if (containment.formFactor === PlasmaCore.Types.Horizontal) {
|
|
||||||
panel.width = Math.min(panel.maximumLength, Math.max(containment.implicitWidth, panel.minimumLength));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
onMinimumHeightChanged: {
|
|
||||||
if (containment.formFactor === PlasmaCore.Types.Vertical) {
|
|
||||||
panel.width = Math.max(panel.width, panel.minimumLength);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onMaximumHeightChanged: {
|
|
||||||
if (containment.formFactor === PlasmaCore.Types.Vertical) {
|
|
||||||
panel.width = Math.min(panel.width, panel.maximumLength);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
onImplicitHeightChanged: {
|
|
||||||
if (containment.formFactor === PlasmaCore.Types.Vertical) {
|
|
||||||
panel.width = Math.min(panel.maximumLength, Math.max(containment.implicitHeight, panel.minimumLength));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: panel
|
|
||||||
onXChanged: {
|
|
||||||
adjustBorders();
|
|
||||||
}
|
|
||||||
onYChanged: {
|
|
||||||
adjustBorders();
|
|
||||||
}
|
|
||||||
onWidthChanged: {
|
|
||||||
adjustBorders();
|
|
||||||
}
|
|
||||||
onHeightChanged: {
|
|
||||||
adjustBorders();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Connections {
|
|
||||||
target: panel.screen
|
|
||||||
onGeometryChanged: {
|
|
||||||
adjustBorders();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
print("PanelView QML loaded")
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,44 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Comment=Desktop view furniture
|
|
||||||
Comment[fr]=Présentation de la vue du bureau
|
|
||||||
Comment[mr]=डेस्कटॉप दृश्य फर्निचर
|
|
||||||
Comment[nl]=Meubilair voor weergave op het bureaublad
|
|
||||||
Comment[pl]=Umeblowanie widoku pulpitu
|
|
||||||
Comment[pt]=Componentes do ecrã
|
|
||||||
Comment[pt_BR]=Acessório de visualização da área de trabalho
|
|
||||||
Comment[sk]=Zobrazenie plochy nábytok
|
|
||||||
Comment[sv]=Visa skrivbordsmöbler
|
|
||||||
Comment[uk]=Компоненти для перегляду стільниці
|
|
||||||
Comment[x-test]=xxDesktop view furniturexx
|
|
||||||
Encoding=UTF-8
|
|
||||||
Keywords=
|
|
||||||
Name=Desktop
|
|
||||||
Name[bs]=Površ
|
|
||||||
Name[cs]=Pracovní plocha
|
|
||||||
Name[de]=Arbeitsfläche
|
|
||||||
Name[es]=Escritorio
|
|
||||||
Name[fi]=Työpöytä
|
|
||||||
Name[fr]=Bureau
|
|
||||||
Name[mr]=डेस्कटॉप
|
|
||||||
Name[nl]=Bureaublad
|
|
||||||
Name[pl]=Pulpit
|
|
||||||
Name[pt]=Ambiente de Trabalho
|
|
||||||
Name[pt_BR]=Área de trabalho
|
|
||||||
Name[sk]=Plocha
|
|
||||||
Name[sv]=Skrivbord
|
|
||||||
Name[tr]=Masaüstü
|
|
||||||
Name[ug]=ئۈستەلئۈستى
|
|
||||||
Name[uk]=Стільниця
|
|
||||||
Name[x-test]=xxDesktopxx
|
|
||||||
Type=Service
|
|
||||||
|
|
||||||
X-KDE-ServiceTypes=Plasma/Shell
|
|
||||||
X-KDE-ParentApp=
|
|
||||||
X-KDE-PluginInfo-Author=Marco Martin
|
|
||||||
X-KDE-PluginInfo-Category=
|
|
||||||
X-KDE-PluginInfo-Email=mart@kde.org
|
|
||||||
X-KDE-PluginInfo-License=GPLv2+
|
|
||||||
X-KDE-PluginInfo-Name=org.kde.desktop
|
|
||||||
X-KDE-PluginInfo-Version=
|
|
||||||
X-KDE-PluginInfo-Website=
|
|
||||||
X-Plasma-MainScript=layout.js
|
|
@ -1,3 +0,0 @@
|
|||||||
#! /usr/bin/env bash
|
|
||||||
$XGETTEXT `find . -name \*.qml` -L Java -o $podir/plasma_lookandfeel_org.kde.lookandfeel.pot
|
|
||||||
rm -f rc.cpp
|
|
@ -1,49 +0,0 @@
|
|||||||
[Desktop Entry]
|
|
||||||
Comment=Desktop Design Language
|
|
||||||
Comment[fr]=Langage de conception de bureau
|
|
||||||
Comment[nl]=Ontwerptaal van het bureaublad
|
|
||||||
Comment[pl]=Język Projektu Pulpitu
|
|
||||||
Comment[pt]=Linguagem de Desenho do Ecrã
|
|
||||||
Comment[pt_BR]=Linguagem de desenho da área de trabalho
|
|
||||||
Comment[sk]=Jazyk dizajnu plochy
|
|
||||||
Comment[sv]=Konstruktionsspråk för skrivbord
|
|
||||||
Comment[uk]=Мова розробки для стільниці
|
|
||||||
Comment[x-test]=xxDesktop Design Languagexx
|
|
||||||
Encoding=UTF-8
|
|
||||||
Keywords=Desktop, Workspace, Appearance, Look and Feel, Logout, Lock, Suspend, Shutdown, Hibernate,
|
|
||||||
Keywords[fr]=Bureau,Espace de travail,Apparence,Déconnexion,Verouillage,Mise en veille,Extinction,Hibernation.
|
|
||||||
Keywords[nl]=Bureaublad, werkruimte, uiterlijk, uiterlijk en gedrag, afmelden, vergrendelen, onderbreken, afsluiten, slapen,
|
|
||||||
Keywords[pl]=Pulpit, Przestrzeń robocza, Wygląd, Wygląd, Wyloguj, Zablokuj, Wstrzymaj, Wyłącz, Hibernuj,
|
|
||||||
Keywords[pt]=Ecrã, Área de Trabalho, Aparência, Aparência e Comportamento, Encerrar, Bloquear, Suspender, Desligar, Hibernar,
|
|
||||||
Keywords[pt_BR]=Área de trabalho, Espaço de trabalho, Aparência, Aparência e Comportamento, Encerrar sessão, Bloquear, Suspender, Desligar, Hibernar,
|
|
||||||
Keywords[sk]=Plocha, pracovná plocha, vzhľad, nastavenie, odhlásenie, zamknutie, uspanie, vypnutie, hibernácia,
|
|
||||||
Keywords[sv]=Skrivbord, Arbetsyta, Utseende, Utseende och känsla, Utloggning, Lås, Viloläge, Avstängning, Dvala,
|
|
||||||
Keywords[uk]=стільниця;робочий;простір;вигляд;поведінка;вихід;блокування;призупинення;призупинка;присипляння;вимикання;Desktop;Workspace;Appearance;Look and Feel;Logout;Lock;Suspend;Shutdown;Hibernate;
|
|
||||||
Keywords[x-test]=xxDesktop, Workspace, Appearance, Look and Feel, Logout, Lock, Suspend, Shutdown, Hibernate,xx
|
|
||||||
Name=Look and Feel
|
|
||||||
Name[cs]=Vzhled a dojem
|
|
||||||
Name[de]=Erscheinungsbild
|
|
||||||
Name[fi]=Ulkoasu ja tuntuma
|
|
||||||
Name[fr]=Apparence
|
|
||||||
Name[hu]=Megjelenés
|
|
||||||
Name[nl]=Uiterlijk en gedrag
|
|
||||||
Name[pl]=Wygląd
|
|
||||||
Name[pt]=Aparência e Comportamento
|
|
||||||
Name[pt_BR]=Aparência e comportamento
|
|
||||||
Name[sk]=Vzhľad a nastavenie
|
|
||||||
Name[sv]=Utseende och känsla
|
|
||||||
Name[ug]=كۆرۈنۈش ۋە تۇيغۇ
|
|
||||||
Name[uk]=Вигляд і поведінка
|
|
||||||
Name[x-test]=xxLook and Feelxx
|
|
||||||
Type=Service
|
|
||||||
|
|
||||||
X-KDE-ServiceTypes=Plasma/LookAndFeel
|
|
||||||
X-KDE-ParentApp=
|
|
||||||
X-KDE-PluginInfo-Author=Sebastian Kügler
|
|
||||||
X-KDE-PluginInfo-Category=
|
|
||||||
X-KDE-PluginInfo-Email=sebas@kde.org
|
|
||||||
X-KDE-PluginInfo-License=GPLv2+
|
|
||||||
X-KDE-PluginInfo-Name=org.kde.lookandfeel
|
|
||||||
X-KDE-PluginInfo-Version=2.0
|
|
||||||
X-KDE-PluginInfo-Website=http://www.kde.org
|
|
||||||
X-Plasma-MainScript=defaults
|
|
Loading…
x
Reference in New Issue
Block a user