From 4419b3debf2e4ff2ecfaacb7ac87eaf8bf76d86f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Fri, 31 Oct 2014 09:34:48 +0100 Subject: [PATCH] Desktop switchers moved to kdeplasma-addons Last but not least. --- tabbox/CMakeLists.txt | 1 - tabbox/qml/CMakeLists.txt | 5 - .../desktops/previews/contents/ui/main.qml | 157 ------------------ tabbox/qml/desktops/previews/metadata.desktop | 99 ----------- 4 files changed, 262 deletions(-) delete mode 100644 tabbox/qml/CMakeLists.txt delete mode 100644 tabbox/qml/desktops/previews/contents/ui/main.qml delete mode 100644 tabbox/qml/desktops/previews/metadata.desktop diff --git a/tabbox/CMakeLists.txt b/tabbox/CMakeLists.txt index 76ba3a2499..1da33cfe72 100644 --- a/tabbox/CMakeLists.txt +++ b/tabbox/CMakeLists.txt @@ -1,4 +1,3 @@ -add_subdirectory( qml ) add_subdirectory( autotests ) # Install the KWin/WindowSwitcher service type diff --git a/tabbox/qml/CMakeLists.txt b/tabbox/qml/CMakeLists.txt deleted file mode 100644 index e6979e357c..0000000000 --- a/tabbox/qml/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -# packages -install( DIRECTORY desktops/previews DESTINATION ${DATA_INSTALL_DIR}/${KWIN_NAME}/desktoptabbox ) - -# service files -install( FILES desktops/previews/metadata.desktop DESTINATION ${SERVICES_INSTALL_DIR}/${KWIN_NAME} RENAME kwin4_desktop_switcher_previews.desktop ) diff --git a/tabbox/qml/desktops/previews/contents/ui/main.qml b/tabbox/qml/desktops/previews/contents/ui/main.qml deleted file mode 100644 index 6b709bd470..0000000000 --- a/tabbox/qml/desktops/previews/contents/ui/main.qml +++ /dev/null @@ -1,157 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2013 Martin Gräßlin - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ -import QtQuick 2.0 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.kquickcontrolsaddons 2.0 -import org.kde.kwin 2.0 as KWin - -KWin.Switcher { - id: tabBox - currentIndex: listView.currentIndex - property real screenFactor: tabBox.screenGeometry.width/tabBox.screenGeometry.height - - PlasmaCore.Dialog { - id: dialog - location: PlasmaCore.Types.Floating - visible: tabBox.visible - flags: Qt.X11BypassWindowManagerHint - x: tabBox.screenGeometry.x + tabBox.screenGeometry.width * 0.5 - dialogMainItem.width * 0.5 - y: tabBox.screenGeometry.y + tabBox.screenGeometry.height * 0.5 - dialogMainItem.height * 0.5 - - mainItem: Item { - id: dialogMainItem - property bool allDesktops: true - property int optimalWidth: (listView.thumbnailWidth + hoverItem.margins.left + hoverItem.margins.right) * listView.count - property int optimalHeight: listView.thumbnailWidth*(1.0/screenFactor) + hoverItem.margins.top + hoverItem.margins.bottom + 40 - property bool canStretchX: true - property bool canStretchY: false - width: Math.min(Math.max(tabBox.screenGeometry.width * 0.2, optimalWidth), tabBox.screenGeometry.width * 0.8) - height: Math.min(optimalHeight, tabBox.screenGeometry.height * 0.8) - - // just to get the margin sizes - PlasmaCore.FrameSvgItem { - id: hoverItem - imagePath: "widgets/viewitem" - prefix: "hover" - visible: false - } - - ListView { - id: listView - property int thumbnailWidth: 600 - height: thumbnailWidth * (1.0/screenFactor) + hoverItem.margins.bottom + hoverItem.margins.top - width: Math.min(parent.width - (anchors.leftMargin + anchors.rightMargin) - (hoverItem.margins.left + hoverItem.margins.right), thumbnailWidth * count + 5 * (count - 1)) - spacing: 5 - orientation: ListView.Horizontal - model: tabBox.model - anchors { - top: parent.top - left: parent.left - right: parent.right - } - clip: true - highlight: PlasmaCore.FrameSvgItem { - id: highlightItem - imagePath: "widgets/viewitem" - prefix: "hover" - width: listView.thumbnailWidth - height: listView.thumbnailWidth*(1.0/screenFactor) - } - delegate: Item { - property alias caption: thumbnailItem.caption - width: listView.thumbnailWidth - height: listView.thumbnailWidth*(1.0/screenFactor) - KWin.DesktopThumbnailItem { - id: thumbnailItem - property variant caption: model.caption - clip: true - clipTo: listView - desktop: model.desktop - anchors { - fill: parent - leftMargin: hoverItem.margins.left - rightMargin: hoverItem.margins.right - topMargin: hoverItem.margins.top - bottomMargin: hoverItem.margins.bottom - } - } - MouseArea { - anchors.fill: parent - onClicked: { - listView.currentIndex = index; - } - } - } - highlightMoveDuration: 250 - boundsBehavior: Flickable.StopAtBounds - Connections { - target: tabBox - onCurrentIndexChanged: {listView.currentIndex = tabBox.currentIndex;} - } - } - Item { - height: 40 - id: captionFrame - anchors { - top: listView.bottom - left: parent.left - right: parent.right - bottom: parent.bottom - topMargin: hoverItem.margins.bottom - } - Text { - function constrainWidth() { - if (textItem.width > textItem.maxWidth && textItem.width > 0 && textItem.maxWidth > 0) { - textItem.width = textItem.maxWidth; - } else { - textItem.width = undefined; - } - } - function calculateMaxWidth() { - textItem.maxWidth = dialogMainItem.width - captionFrame.anchors.leftMargin - captionFrame.anchors.rightMargin - - captionFrame.anchors.rightMargin; - } - id: textItem - property int maxWidth: 0 - text: listView.currentItem ? listView.currentItem.caption : "" - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - color: theme.textColor - elide: Text.ElideMiddle - font { - bold: true - } - anchors { - verticalCenter: parent.verticalCenter - horizontalCenter: parent.horizontalCenter - } - onTextChanged: textItem.constrainWidth() - Component.onCompleted: textItem.calculateMaxWidth() - Connections { - target: dialogMainItem - onWidthChanged: { - textItem.calculateMaxWidth(); - textItem.constrainWidth(); - } - } - } - } - } - } -} diff --git a/tabbox/qml/desktops/previews/metadata.desktop b/tabbox/qml/desktops/previews/metadata.desktop deleted file mode 100644 index 1844dd194c..0000000000 --- a/tabbox/qml/desktops/previews/metadata.desktop +++ /dev/null @@ -1,99 +0,0 @@ -[Desktop Entry] -Name=Previews -Name[bs]=Pregledi -Name[ca]=Vistes prèvies -Name[ca@valencia]=Vistes prèvies -Name[cs]=Náhledy -Name[da]=Forhåndsvisninger -Name[de]=Vorschauen -Name[el]=Προεπισκοπήσεις -Name[en_GB]=Previews -Name[es]=Vistas previas -Name[eu]=Aurrebistak -Name[fi]=Esikatselut -Name[fr]=Aperçus -Name[gl]=Vistas previas -Name[hu]=Előnézetek -Name[ia]=Vistas preliminar -Name[id]=Pratayang -Name[it]=Anteprima -Name[kk]=Алдын-ала қарау -Name[ko]=미리 보기 -Name[lt]=Peržiūros -Name[nb]=Forhåndsvisninger -Name[nds]=Vöransichten -Name[nl]=Voorbeelden -Name[pa]=ਝਲਕ -Name[pl]=Podglądy -Name[pt]=Antevisões -Name[pt_BR]=Visualizações -Name[ro]=Previzualizări -Name[ru]=Миниатюры -Name[sk]=Náhľady -Name[sl]=Predogledi -Name[sr]=Прегледи -Name[sr@ijekavian]=Прегледи -Name[sr@ijekavianlatin]=Pregledi -Name[sr@latin]=Pregledi -Name[sv]=Förhandsgranskningar -Name[tr]=Önizlemeler -Name[ug]=ئالدىن كۆزەت -Name[uk]=Ескізи -Name[x-test]=xxPreviewsxx -Name[zh_CN]=预览 -Name[zh_TW]=預覽 -Comment=A desktop switcher layout with previews of the desktops -Comment[bs]=Raspored preklapanja radnih površina s pregledima radnih površina -Comment[ca]=Una disposició del commutador d'escriptori amb vistes prèvies dels escriptoris -Comment[ca@valencia]=Una disposició del commutador d'escriptori amb vistes prèvies dels escriptoris -Comment[cs]=Přepínač oken s náhledy ploch -Comment[da]=Et layout til skrivebordsskift med forhåndsvisning af skrivebordene -Comment[de]=Ein Arbeitsflächenwechsler mit Vorschauen der Arbeitsflächen -Comment[el]=Εναλλαγή επιφάνειας εργασίας με προεπισκοπήσεις των επιφανειών -Comment[en_GB]=A desktop switcher layout with previews of the desktops -Comment[es]=Un esquema del cambiador de escritorios con vistas previas de los escritorios -Comment[eu]=Mahaigainen aurrebistak dituen mahaigain-aldatzaile diseinu bat -Comment[fi]=Työpöydänvalitsimen asettelu, jossa on esikatselut työpöydistä -Comment[fr]=Une disposition de sélecteur de bureaux avec des aperçus de bureaux -Comment[gl]=Unha disposición do selector de escritorios con vistas previas deles -Comment[hu]=Egy asztalváltó elrendezés az asztalok előnézetével -Comment[ia]=Un disposition de commutator de scriptorio con vistas preliminar de scriptorios -Comment[id]=Tata letak pengganti desktop dengan pratayang desktop -Comment[it]=Una disposizione con anteprima dello scambiafinestre -Comment[kk]=Үстелдер нобайларын көрсететін үстел ауыстырғышының қалыпы -Comment[ko]=데스크톱 미리 보기를 제공하는 데스크톱 전환기 레이아웃 -Comment[lt]=Darbastalio perjungimo išdėstymas su darbastalių peržiūromis -Comment[nb]=Utforming av KWin skrivebordsbytter med forhåndsvisning av skrivebordene -Comment[nds]=En Schriefdischwessel-Utsehn mit Vöransichten vun de Schriefdischen -Comment[nl]=Een indeling van bureaubladwisselaar met voorbeelden op de bureaubladen -Comment[pa]=ਡੈਸਕਟਾਪਾਂ ਦੀ ਝਲਕ ਨਾਲ ਡੈਸਕਟਾਪ ਬਦਲਣ ਵਾਲਾ ਲੇਆਉਟ -Comment[pl]=Układ przełączania pulpitów z podglądami pulpitów -Comment[pt]=Uma disposição de mudança de ecrã com antevisões dos mesmos -Comment[pt_BR]=Um leiaute do seletor de área de trabalho com visualizações -Comment[ru]=Переключатель с миниатюрами рабочих столов -Comment[sk]=Rozloženie prepínača plôch s náhľadmi týchto plôch -Comment[sl]=Razpored preklapljanja med namizji s predogledi namizij -Comment[sr]=Распоред мењача површи са њиховим прегледима -Comment[sr@ijekavian]=Распоред мењача површи са њиховим прегледима -Comment[sr@ijekavianlatin]=Raspored menjača površi sa njihovim pregledima -Comment[sr@latin]=Raspored menjača površi sa njihovim pregledima -Comment[sv]=En layout för skrivbordsbyte med förhandsgranskningar av skrivborden -Comment[tr]=Masaüstlerinin önizlemeleri ile bir masaüstü değiştirici düzeni -Comment[uk]=Компонування перемикача стільниць з ескізами стільниць -Comment[x-test]=xxA desktop switcher layout with previews of the desktopsxx -Comment[zh_CN]=带桌面预览的切换布局 -Comment[zh_TW]=有預覽的桌面切換器佈局 -Icon=preferences-system-desktop-switcher-previews - -X-Plasma-API=declarativeappletscript -X-Plasma-MainScript=ui/main.qml - -X-KDE-PluginInfo-Author=Martin Gräßlin -X-KDE-PluginInfo-Email=mgraesslin@kde.org -X-KDE-PluginInfo-Name=previews -X-KDE-PluginInfo-Version=1.0 - -X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL -X-KDE-ServiceTypes=KWin/DesktopSwitcher -Type=Service