🔄 Syncing final changes

This commit is contained in:
Dhruvesh Surolia authored and GitHub committed 2024-02-14 01:18:46 +05:30
1 parent 5f636697d8
commit 85eeff5aea
14 files changed
+145 -474

No files matched your search

+2 -21
View File
@@ -1,25 +1,6 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import org.kde.plasma.configuration 2.0
import QtQuick
import org.kde.plasma.configuration
ConfigModel {
ConfigCategory {
-9
View File
@@ -107,15 +107,6 @@
<default>2</default>
<label>it is used in order to inform settings window about the plasmoid form factor. 2=Horizontal and 3=Vertical</label>
</entry>
<entry name="containmentType" type="Enum">
<choices>
<choice name="Loading"/>
<choice name="Plasma"/>
<choice name="Latte"/>
</choices>
<label>it helps to enable/disable options that are specific to plasma or Latte panels</label>
<default>0</default>
</entry>
<entry name="subsMatch" type="StringList">
<default>"Telegram Desktop","Gimp-.*","soffice.bin"</default>
<label>substitutions criteria - match for application names</label>
+2 -21
View File
@@ -1,25 +1,6 @@
/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick 2.7
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.plasmoid
MouseArea {
id: actionsArea
+3 -83
View File
@@ -1,26 +1,7 @@
/*
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick 2.7
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasmoid
import org.kde.plasma.core as PlasmaCore
Item{
id: broadcaster
@@ -72,78 +53,17 @@ Item{
cooperation: plasmoid.configuration.sendActivateAppMenuCooperationFromEditMode
};
latteBridge.actions.broadcastToApplet("org.kde.windowappmenu",
"activateAppMenuCooperationFromEditMode",
values);
releaseSendActivateAppMenuCooperation.start();
}
}
function broadcoastCooperationRequest(enabled) {
if (latteBridge) {
var values = {
appletId: plasmoid.id,
cooperation: enabled
};
latteBridge.actions.broadcastToApplet("org.kde.windowappmenu", "setCooperation", values);
}
}
Connections {
target: latteBridge
onBroadcasted: {
var updateAppMenuCooperations = false;
if (broadcaster.cooperationEstablished) {
if (action === "setVisible") {
if (value === true) {
broadcaster.hiddenFromBroadcast = false;
} else {
broadcaster.hiddenFromBroadcast = true;
}
} else if (action === "menuIsPresent") {
broadcaster.menuIsPresent = value;
}
}
if (action === "isPresent") {
plasmoid.configuration.appMenuIsPresent = value;
} else if (action === "setCooperation") {
updateAppMenuCooperations = true;
} else if (action === "activateWindowTitleCooperationFromEditMode") {
plasmoid.configuration.showAppMenuOnMouseEnter = value.cooperation;
updateAppMenuCooperations = true;
}
if (updateAppMenuCooperations) {
var indexed = broadcaster.appMenusRequestCooperation.indexOf(value.appletId);
var isFiled = (indexed >= 0);
if (value.cooperation && !isFiled) {
broadcaster.appMenusRequestCooperation.push(value.appletId);
broadcaster.appMenusRequestCooperationCount++;
} else if (!value.cooperation && isFiled) {
broadcaster.appMenusRequestCooperation.splice(indexed, 1);
broadcaster.appMenusRequestCooperationCount--;
}
}
}
}
Timer{
id: broadcasterDelayer
interval: 5
onTriggered: {
if (latteBridge) {
if (broadcasterMouseArea.realContainsMouse && existsWindowActive) {
broadcaster.hiddenFromBroadcast = true;
latteBridge.actions.broadcastToApplet("org.kde.windowappmenu", "setVisible", true);
} else {
broadcaster.hiddenFromBroadcast = false;
latteBridge.actions.broadcastToApplet("org.kde.windowappmenu", "setVisible", false);
}
}
}
}
+3 -22
View File
@@ -1,26 +1,8 @@
/*
* Copyright 2019 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import QtQml.Models 2.2
import QtQuick
import QtQml.Models
import org.kde.taskmanager 0.1 as TaskManager
import org.kde.taskmanager as TaskManager
Item {
id: plasmaTasksItem
@@ -39,7 +21,6 @@ Item {
filterByVirtualDesktop: true
filterByActivity: true
}
Item{
id: taskList
Repeater{
+12 -29
View File
@@ -1,30 +1,12 @@
/*
* Copyright 2018-2019 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import QtQml.Models 2.2
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.4
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import QtQuick
import QtQml.Models
import QtQuick.Layouts
import QtQuick.Controls
import org.kde.plasma.plasmoid
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents
import org.kde.kirigami as Kirigami
GridLayout{
id: titleLayout
@@ -84,14 +66,13 @@ GridLayout{
visible: plasmoid.configuration.showIcon
PlasmaCore.IconItem{
Kirigami.Icon{
id: iconItem
anchors.fill: parent
anchors.topMargin: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? thickMargin : 0
anchors.bottomMargin: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? thickMargin : 0
anchors.leftMargin: plasmoid.formFactor === PlasmaCore.Types.Vertical ? thickMargin : 0
anchors.rightMargin: plasmoid.formFactor === PlasmaCore.Types.Vertical ? thickMargin : 0
roundToIconSize: !root.isInLatte
source: existsWindowActive ? activeTaskItem.icon : fullActivityInfo.icon
@@ -164,6 +145,8 @@ GridLayout{
return -90;
} else if (plasmoid.location === PlasmaCore.Types.RightEdge) {
return 90;
} else {
return 0;
}
}
@@ -174,7 +157,7 @@ GridLayout{
verticalAlignment: Text.AlignVCenter
text: existsWindowActive ? root.firstTitleText : root.fallBackText
color: enforceLattePalette ? latteBridge.palette.textColor : theme.textColor
color: PlasmaCore.Theme.textColor
font.capitalization: plasmoid.configuration.capitalFont ? Font.Capitalize : Font.MixedCase
font.bold: plasmoid.configuration.boldFont
font.italic: plasmoid.configuration.italicFont
+38 -58
View File
@@ -1,29 +1,9 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.9
import QtQuick.Controls 1.0
import QtQuick.Controls 2.2 as Controls22
import QtGraphicalEffects 1.0
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.kde.plasma.core as PlasmaCore
import org.kde.kirigami as Kirigami
import org.kde.plasma.components as Components
import "../../tools/Tools.js" as Tools
@@ -59,7 +39,7 @@ Item {
readonly property int minimumWidth: 220
onSelectedStyleChanged: {
if (selectedStyle === 4) { /*NoText*/
if (selectedStyle === 4) { /*NoLabel*/
showIconChk.checked = true;
}
}
@@ -70,7 +50,7 @@ Item {
ColumnLayout {
id:mainColumn
spacing: units.largeSpacing
spacing: Kirigami.Units.largeSpacing
Layout.fillWidth: true
GridLayout{
@@ -78,8 +58,8 @@ Item {
Label{
Layout.minimumWidth: Math.max(centerFactor * root.width, minimumWidth)
text: i18n("Text style:")
horizontalAlignment: Text.AlignRight
text: i18n("Label style:")
horizontalAlignment: Label.AlignRight
}
CustomComboBox{
@@ -104,13 +84,13 @@ Item {
Label{
Layout.minimumWidth: Math.max(centerFactor * root.width, minimumWidth)
text: i18n("Icon:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
CheckBox{
id: showIconChk
text: i18n("Show when available")
enabled: root.selectedStyle !== 4 /*NoText*/
enabled: root.selectedStyle !== 4 /*NoLabel*/
}
Label{
@@ -130,14 +110,14 @@ Item {
SpinBox{
id: iconSizeSpn
minimumValue: 16
maximumValue: 128
suffix: " " + i18nc("pixels","px.")
from: 16
to: 128
// suffix: " " + i18nc("pixels","px.")
enabled: !iconFillChk.checked
}
Label {
Layout.leftMargin: units.smallSpacing
Layout.leftMargin: Kirigami.Units.smallSpacing
text: "maximum"
}
}
@@ -145,12 +125,12 @@ Item {
GridLayout{
columns: 2
enabled : root.selectedStyle !== 4 /*NoText*/
enabled : root.selectedStyle !== 4 /*NoLabel*/
Label{
Layout.minimumWidth: Math.max(centerFactor * root.width, minimumWidth)
text: i18n("Font:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
CheckBox{
@@ -179,13 +159,13 @@ Item {
GridLayout{
columns: 2
enabled : root.selectedStyle !== 4 /*NoText*/
enabled : root.selectedStyle !== 4 /*NoLabel*/
Label{
id: lengthLbl2
Layout.minimumWidth: Math.max(centerFactor * root.width, minimumWidth)
text: i18n("Length:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
CustomComboBox{
@@ -215,8 +195,8 @@ Item {
Layout.preferredWidth: Layout.minimumWidth
Layout.maximumWidth: Layout.minimumWidth
minimumValue: 24
maximumValue: 1500
from: 24
to: 1500
stepSize: 2
}
Label {
@@ -237,8 +217,8 @@ Item {
Layout.preferredWidth: Layout.minimumWidth
Layout.maximumWidth: Layout.minimumWidth
minimumValue: 24
maximumValue: 1500
from: 24
to: 1500
stepSize: 2
}
Label {
@@ -257,7 +237,7 @@ Item {
Layout.maximumWidth: Layout.preferredWidth
font.italic: true
wrapMode: Text.WordWrap
wrapMode: Label.WordWrap
text: {
if (lengthCmb.currentIndex === 0 /*Contents*/){
@@ -277,19 +257,19 @@ Item {
GridLayout{
id: visualSettingsGroup1
columns: 2
enabled: showIconChk.checked && root.selectedStyle !== 4 /*NoText*/
enabled: showIconChk.checked && root.selectedStyle !== 4 /*NoLabel*/
Label{
Layout.minimumWidth: Math.max(centerFactor * root.width, minimumWidth)
text: i18n("Spacing:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
SpinBox{
id: spacingSpn
minimumValue: 0
maximumValue: 36
suffix: " " + i18nc("pixels","px.")
from: 0
to: 36
// suffix: " " + i18nc("pixels","px.")
}
}
@@ -309,23 +289,23 @@ Item {
Layout.minimumWidth: Math.max(centerFactor * root.width, minimumWidth)
text: plasmoid.configuration.formFactor===PlasmaCore.Types.Horizontal ?
i18n("Left margin:") : i18n("Top margin:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
Label{
Layout.minimumWidth: Math.max(centerFactor * root.width, minimumWidth)
text: plasmoid.configuration.formFactor===PlasmaCore.Types.Horizontal ?
i18n("Right margin:") : i18n("Bottom margin:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
enabled: !lockItem.locked
}
SpinBox{
id: lengthFirstSpn
minimumValue: 0
maximumValue: 24
suffix: " " + i18nc("pixels","px.")
from: 0
to: 24
// suffix: " " + i18nc("pixels","px.")
property int lastValue: -1
@@ -344,9 +324,9 @@ Item {
SpinBox{
id: lengthLastSpn
minimumValue: 0
maximumValue: 24
suffix: " " + i18nc("pixels","px.")
from: 0
to: 24
// suffix: " " + i18nc("pixels","px.")
enabled: !lockItem.locked
}
+11 -30
View File
@@ -1,29 +1,10 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick 2.9
import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kirigami 2.4 as Kirigami
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components
import org.kde.kirigami as Kirigami
Item {
id: behaviorPage
@@ -50,7 +31,7 @@ Item {
ColumnLayout {
id:mainColumn
spacing: units.largeSpacing
spacing: Kirigami.Units.largeSpacing
width:parent.width - anchors.leftMargin * 2
height: parent.height
anchors.top: parent.top
@@ -63,7 +44,7 @@ Item {
Label{
Layout.minimumWidth: Math.max(centerFactor * behaviorPage.width, minimumWidth)
text: i18n("Filters:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
CheckBox{
@@ -78,7 +59,7 @@ Item {
Label{
Layout.minimumWidth: Math.max(centerFactor * behaviorPage.width, minimumWidth)
text: i18n("Mouse:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
CheckBox{
@@ -159,7 +140,7 @@ Item {
Label{
Layout.minimumWidth: Math.max(centerFactor * behaviorPage.width, minimumWidth)
text: i18n("Placeholder:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
CheckBox{
@@ -186,7 +167,7 @@ Item {
Label{
Layout.minimumWidth: Math.max(centerFactor * behaviorPage.width, minimumWidth)
text: i18n("Application name:")
horizontalAlignment: Text.AlignRight
horizontalAlignment: Label.AlignRight
}
Button{
+8 -26
View File
@@ -1,28 +1,8 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick.Controls as Controls
import QtQuick.Layouts
import QtQuick 2.0
import QtQuick.Controls 1.0
import QtQuick.Controls 2.2 as Controls22
import QtQuick.Layouts 1.0
Controls22.ComboBox{
Controls.ComboBox{
id: combobox
Layout.minimumWidth: 270
Layout.preferredWidth: 350
@@ -36,7 +16,9 @@ Controls22.ComboBox{
Connections{
target: popup
onClosed: root.forceActiveFocus();
function onClosed() {
root.forceActiveFocus();
}
}
delegate: MouseArea{
@@ -66,7 +48,7 @@ Controls22.ComboBox{
readonly property color selectedColor: Qt.rgba(palette.highlight.r, palette.highlight.g, palette.highlight.b, 0.5);
Label{
Text{
id: label
anchors.left: parent.left
anchors.leftMargin: units.smallSpacing
+7 -27
View File
@@ -1,28 +1,8 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.9
import QtQuick.Controls 1.3
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.kde.plasma.components as Components
import org.kde.kirigami as Kirigami
Item{
id: main
@@ -55,11 +35,11 @@ Item{
color: palette.text
}
KQuickAddons.QIconItem{
Kirigami.Icon{
id: button
width: 24
height: 24
icon: locked ? "lock" : "unlock"
source: locked ? "lock" : "unlock"
}
Rectangle {
+7 -35
View File
@@ -1,29 +1,8 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.9
import QtQuick.Controls 1.0
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.2 as Controls22
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import QtQuick
import QtQuick.Controls as Controls
import QtQuick.Layouts
import org.kde.plasma.core as PlasmaCore
import org.kde.kirigami as Kirigami
Item{
id: box
@@ -39,8 +18,8 @@ Item{
property bool shown: false
readonly property int availableWidth: width - 2*12 - 2*units.largeSpacing
readonly property int availableHeight: contentItem.childrenRect.height + 2*units.largeSpacing
readonly property int availableWidth: width - 2*12 - 2*Kirigami.Units.largeSpacing
readonly property int availableHeight: contentItem.childrenRect.height + 2*Kirigami.Units.largeSpacing
readonly property int maximumHeight: availableHeight + 2*12
onContentItemChanged: {
@@ -115,13 +94,6 @@ Item{
radius: 1
layer.enabled: true
layer.effect: DropShadow {
id: shadowElement
radius: 12
fast: true
samples: 2 * radius
color: palette.shadow
}
}
}
}
+10 -31
View File
@@ -1,28 +1,7 @@
/*
* Copyright 2018 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.9
import QtQuick.Controls 1.0
import QtQuick.Controls 2.2 as Controls22
import QtQuick.Layouts 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import org.kde.kirigami as Kirigami
import "../../tools/Tools.js" as Tools
@@ -45,9 +24,9 @@ SlidingBox {
contentItem: ColumnLayout{
id: mainColumn
width: popup.availableWidth
anchors.margins: units.largeSpacing
anchors.margins: Kirigami.Units.largeSpacing
anchors.centerIn: parent
spacing: units.largeSpacing
spacing: Kirigami.Units.largeSpacing
Label{
Layout.fillWidth: true
@@ -79,8 +58,8 @@ SlidingBox {
onTextChanged: page.selectedMatches = popup.textAreaToList(text)
flickableItem.onContentYChanged: {
textAreaReplace.flickableItem.contentY = flickableItem.contentY
Flickable {
onContentYChanged: textAreaReplace.flickableItem.contentY = flickableItem.contentY
}
}
TextArea{
@@ -91,8 +70,8 @@ SlidingBox {
text: listToText(page.selectedReplacements)
onTextChanged: page.selectedReplacements = popup.textAreaToList(text)
flickableItem.onContentYChanged: {
textAreaMatch.flickableItem.contentY = flickableItem.contentY
Flickable {
onContentYChanged: textAreaMatch.flickableItem.contentY = flickableItem.contentY
}
}
}
+19 -82
View File
@@ -1,36 +1,18 @@
/*
* Copyright 2018-2019 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of applet-window-title
*
* Latte-Dock 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.
*
* Latte-Dock is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQuick 2.7
import QtQuick.Layouts 1.1
import QtQuick.Controls 1.4
import org.kde.plasma.plasmoid
import org.kde.plasma.core as PlasmaCore
import org.kde.plasma.components as PlasmaComponents
import org.kde.taskmanager as TaskManager
import org.kde.kirigami as Kirigami
import org.kde.plasma.plasmoid 2.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.taskmanager 0.1 as TaskManager
import org.kde.activities 0.1 as Activities
import org.kde.activities as Activities
import "../tools/Tools.js" as Tools
Item {
PlasmoidItem {
id: root
clip: true
@@ -47,7 +29,7 @@ Item {
Layout.preferredHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical ? preferredLength : -1
Layout.maximumHeight: plasmoid.formFactor === PlasmaCore.Types.Vertical ? maximumLength : -1
Plasmoid.preferredRepresentation: Plasmoid.fullRepresentation
preferredRepresentation: fullRepresentation
Plasmoid.onFormFactorChanged: plasmoid.configuration.formFactor = plasmoid.formFactor;
Plasmoid.status: {
@@ -64,7 +46,7 @@ Item {
readonly property bool inMaximumLengthMode: plasmoid.configuration.lengthPolicy === 2 /*Maximum Length Policy*/
readonly property bool inFillLengthMode: plasmoid.configuration.lengthPolicy === 3 /*Fill Length Policy*/
readonly property bool inEditMode: plasmoid.userConfiguring || latteInEditMode
readonly property bool inEditMode: plasmoid.userConfiguring
readonly property int containmentType: plasmoid.configuration.containmentType
readonly property int thickness: plasmoid.formFactor === PlasmaCore.Types.Horizontal ? root.height : root.width
@@ -174,27 +156,8 @@ Item {
return "";
}
//BEGIN Latte Dock Communicator
property bool isInLatte: false // deprecated Latte v0.8 API
property QtObject latteBridge: null // current Latte v0.9 API
onLatteBridgeChanged: {
if (latteBridge) {
plasmoid.configuration.containmentType = 2; /*Latte containment with new API*/
latteBridge.actions.setProperty(plasmoid.id, "latteSideColoringEnabled", false);
latteBridge.actions.setProperty(plasmoid.id, "windowsTrackingEnabled", true);
}
}
//END Latte Dock Communicator
//BEGIN Latte based properties
readonly property bool enforceLattePalette: latteBridge && latteBridge.applyPalette && latteBridge.palette
readonly property bool latteInEditMode: latteBridge && latteBridge.inEditMode
//END Latte based properties
Component.onCompleted: {
plasmoid.configuration.appMenuIsPresent = false;
containmentIdentifierTimer.start();
}
// START Tasks logic
@@ -215,16 +178,7 @@ Item {
Loader {
id: windowInfoLoader
sourceComponent: latteBridge
&& latteBridge.windowsTracker
&& latteBridge.windowsTracker.currentScreen.lastActiveWindow
&& latteBridge.windowsTracker.allScreens.lastActiveWindow ? latteTrackerComponent : plasmaTasksModel
Component{
id: latteTrackerComponent
LatteWindowsTracker{}
}
sourceComponent: plasmaTasksModel
Component{
id: plasmaTasksModel
PlasmaTasksModel{}
@@ -311,11 +265,11 @@ Item {
}
mainItem: RowLayout {
spacing: units.largeSpacing
Layout.margins: units.smallSpacing
PlasmaCore.IconItem {
Layout.minimumWidth: units.iconSizes.medium
Layout.minimumHeight: units.iconSizes.medium
spacing: Kirigami.Units.largeSpacing
Layout.margins: Kirigami.Units.smallSpacing
Kirigami.Icon {
Layout.minimumWidth: 32 //Kirigami.Units.iconSizes.mediumSpacing ( 32 is temporary fix to get rid of warning )
Layout.minimumHeight: 32 //Kirigami.Units.iconSizes.mediumSpacing ( above line same )
Layout.maximumWidth: Layout.minimumWidth
Layout.maximumHeight: Layout.minimumHeight
source: existsWindowActive ? activeTaskItem.icon : fullActivityInfo.icon
@@ -341,7 +295,7 @@ Item {
Loader {
id: actionsLoader
anchors.fill: inFillLengthMode ? parent : visibleContents
active: containmentType === 1 /*plasma or old latte containment*/
active: containmentType === 1
sourceComponent: ActionsMouseArea {
anchors.fill: parent
@@ -352,21 +306,4 @@ Item {
id: broadcaster
anchors.fill: parent
}
//! this timer is used in order to identify in which containment the applet is in
//! it should be called only the first time an applet is created and loaded because
//! afterwards the applet has no way to move between different processes such
//! as Plasma and Latte
Timer{
id: containmentIdentifierTimer
interval: 5000
onTriggered: {
if (latteBridge) {
plasmoid.configuration.containmentType = 2; /*Latte containment with new API*/
latteBridge.actions.broadcastToApplet("org.kde.windowappmenu", "isPresent", true);
} else {
plasmoid.configuration.containmentType = 1; /*Plasma containment or Latte with old API*/
}
}
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"KPlugin": {
"Authors": [
{
"Email": "mvourlakos@gmail.com",
"Name": "Michail Vourlakos"
}
],
"Category": "Windows and Tasks",
"Description": "Shows the application title and icon of the active window",
"Icon": "preferences-desktop",
"Id": "org.kde.windowtitle",
"License": "GPLv2",
"Name": "Window Title",
"ServiceTypes": [
"Plasma/Applet"
],
"Version": "0.7.1",
"Website": "https://github.com/psifidotos/applet-window-title"
},
"Keyword": "window title icon",
"X-Plasma-API-Minimum-Version": "6.0"
}