Commit bf1eb34c authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[kicker] Fix a few unqualified property access

Summary: Those will break in Qt 6. Port a few trivial ones suggested by qmllint

Test Plan: Did kicker and dashboard things

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26224
parent 8e479c82
......@@ -131,7 +131,7 @@ Item {
checked : actionItem.checked ? actionItem.checked : false
onClicked: {
actionClicked(actionItem.actionId, actionItem.actionArgument);
root.actionClicked(actionItem.actionId, actionItem.actionArgument);
}
}
}
......
......@@ -69,7 +69,7 @@ Item {
Connections {
target: units.iconSizeHints
onPanelChanged: updateSizeHints()
onPanelChanged: root.updateSizeHints()
}
PlasmaCore.IconItem {
......@@ -77,10 +77,10 @@ Item {
anchors.fill: parent
readonly property double aspectRatio: (vertical ? implicitHeight / implicitWidth
readonly property double aspectRatio: (root.vertical ? implicitHeight / implicitWidth
: implicitWidth / implicitHeight)
source: useCustomButtonImage ? plasmoid.configuration.customButtonImage : plasmoid.configuration.icon
source: root.useCustomButtonImage ? plasmoid.configuration.customButtonImage : plasmoid.configuration.icon
active: mouseArea.containsMouse && !justOpenedTimer.running
......@@ -88,9 +88,9 @@ Item {
// A custom icon could also be rectangular. However, if a square, custom, icon is given, assume it
// to be an icon and round it to the nearest icon size again to avoid scaling artifacts.
roundToIconSize: !useCustomButtonImage || aspectRatio === 1
roundToIconSize: !root.useCustomButtonImage || aspectRatio === 1
onSourceChanged: updateSizeHints()
onSourceChanged: root.updateSizeHints()
}
MouseArea
......@@ -100,7 +100,7 @@ Item {
anchors.fill: parent
hoverEnabled: !dashWindow || !dashWindow.visible
hoverEnabled: !root.dashWindow || !root.dashWindow.visible
onPressed: {
if (!isDash) {
......@@ -110,7 +110,7 @@ Item {
onClicked: {
if (isDash) {
dashWindow.toggle();
root.dashWindow.toggle();
justOpenedTimer.start();
} else {
plasmoid.expanded = !wasExpanded;
......
......@@ -104,8 +104,8 @@ Kirigami.FormLayout {
id: iconDialog
function setCustomButtonImage(image) {
cfg_customButtonImage = image || cfg_icon || "start-here-kde"
cfg_useCustomButtonImage = true;
configGeneral.cfg_customButtonImage = image || configGeneral.cfg_icon || "start-here-kde"
configGeneral.cfg_useCustomButtonImage = true;
}
onIconNameChanged: setCustomButtonImage(iconName);
......@@ -123,7 +123,7 @@ Kirigami.FormLayout {
anchors.centerIn: parent
width: units.iconSizes.large
height: width
source: cfg_useCustomButtonImage ? cfg_customButtonImage : cfg_icon
source: configGeneral.cfg_useCustomButtonImage ? configGeneral.cfg_customButtonImage : configGeneral.cfg_icon
}
}
......@@ -144,8 +144,8 @@ Kirigami.FormLayout {
text: i18nc("@item:inmenu Reset icon to default", "Clear Icon")
icon.name: "edit-clear"
onClicked: {
cfg_icon = "start-here-kde"
cfg_useCustomButtonImage = false
configGeneral.cfg_icon = "start-here-kde"
configGeneral.cfg_useCustomButtonImage = false
}
}
}
......@@ -187,7 +187,7 @@ Kirigami.FormLayout {
CheckBox {
id: showIconsRootLevel
visible: !isDash
visible: !configGeneral.isDash
text: i18n("Show icons on the root level of the menu")
}
......@@ -244,7 +244,7 @@ Kirigami.FormLayout {
CheckBox {
id: alignResultsToBottom
visible: !isDash
visible: !configGeneral.isDash
text: i18n("Align search results to bottom")
}
......
......@@ -124,7 +124,7 @@ Kicker.DashboardWindow {
target: kicker
onReset: {
if (!searching) {
if (!root.searching) {
filterList.applyFilter();
if (tabBar.activeTab == 0) {
......@@ -211,7 +211,7 @@ Kicker.DashboardWindow {
repeat: false
onTriggered: {
if (done || searching) {
if (done || root.searching) {
return;
}
......@@ -247,11 +247,11 @@ Kicker.DashboardWindow {
visible: (plasmoid.immutability !== PlasmaCore.Types.SystemImmutable)
onActiveTabChanged: {
updateWidgetExplorer();
reset();
root.updateWidgetExplorer();
root.reset();
}
onHoveredTabChanged: updateWidgetExplorer()
onHoveredTabChanged: root.updateWidgetExplorer()
Keys.onDownPressed: {
mainColumn.tryActivate(0, 0);
......@@ -272,7 +272,7 @@ Kicker.DashboardWindow {
if (tabBar.activeTab == 0) {
runnerModel.query = searchField.text;
} else {
widgetExplorer.widgetsModel.searchTerm = searchField.text;
root.widgetExplorer.widgetsModel.searchTerm = searchField.text;
}
}
......@@ -291,7 +291,7 @@ Kicker.DashboardWindow {
horizontalCenter: parent.horizontalCenter
}
y: (middleRow.anchors.topMargin / 2) - (smallScreen ? (height/10) : 0)
y: (middleRow.anchors.topMargin / 2) - (root.smallScreen ? (height/10) : 0)
font.pointSize: dummyHeading.font.pointSize * 1.5
wrapMode: Text.NoWrap
......@@ -302,7 +302,7 @@ Kicker.DashboardWindow {
color: "white"
text: searching ? i18n("Searching for '%1'", searchField.text) : i18n("Type to search...")
text: root.searching ? i18n("Searching for '%1'", searchField.text) : i18n("Type to search...")
function updateSelection() {
if (!searchField.selectedText) {
......@@ -367,7 +367,7 @@ Kicker.DashboardWindow {
horizontalCenter: parent.horizontalCenter
}
width: (root.columns * cellSize) + (2 * spacing)
width: (root.columns * root.cellSize) + (2 * spacing)
spacing: units.gridUnit * 2
......@@ -379,7 +379,7 @@ Kicker.DashboardWindow {
bottom: parent.bottom
}
width: (columns * cellSize) + units.gridUnit
width: (columns * root.cellSize) + units.gridUnit
property int columns: 3
......@@ -440,14 +440,14 @@ Kicker.DashboardWindow {
}
property int rows: (Math.floor((parent.height - favoritesColumnLabel.height
- favoritesColumnLabelUnderline.height - units.largeSpacing) / cellSize)
- favoritesColumnLabelUnderline.height - units.largeSpacing) / root.cellSize)
- systemFavoritesGrid.rows)
width: parent.width
height: rows * cellSize
height: rows * root.cellSize
cellWidth: cellSize
cellHeight: cellSize
cellWidth: root.cellSize
cellHeight: root.cellSize
iconSize: root.iconSize
model: globalFavorites
......@@ -477,7 +477,7 @@ Kicker.DashboardWindow {
if (tabBar.visible) {
tabBar.focus = true;
} else if (searching) {
} else if (root.searching) {
cancelSearchButton.focus = true;
} else {
mainColumn.tryActivate(0, 0);
......@@ -502,13 +502,13 @@ Kicker.DashboardWindow {
top: globalFavoritesGrid.bottom
}
property int rows: Math.ceil(count / Math.floor(width / cellSize))
property int rows: Math.ceil(count / Math.floor(width / root.cellSize))
width: parent.width
height: rows * cellSize
height: rows * root.cellSize
cellWidth: cellSize
cellHeight: cellSize
cellWidth: root.cellSize
cellHeight: root.cellSize
iconSize: root.iconSize
model: systemFavorites
......@@ -536,7 +536,7 @@ Kicker.DashboardWindow {
globalFavoritesGrid.tryActivate(0, 0);
} else if (tabBar.visible) {
tabBar.focus = true;
} else if (searching && !runnerModel.count) {
} else if (root.searching && !runnerModel.count) {
cancelSearchButton.focus = true;
} else {
mainColumn.tryActivate(0, 0);
......@@ -546,7 +546,7 @@ Kicker.DashboardWindow {
if (filterList.enabled) {
filterList.forceActiveFocus();
} else if (searching && !runnerModel.count) {
} else if (root.searching && !runnerModel.count) {
cancelSearchButton.focus = true;
} else {
mainColumn.tryActivate(0, 0);
......@@ -561,8 +561,8 @@ Kicker.DashboardWindow {
anchors.top: parent.top
width: (columns * cellSize) + units.gridUnit
height: Math.floor(parent.height / cellSize) * cellSize + mainGridContainer.headerHeight
width: (columns * root.cellSize) + units.gridUnit
height: Math.floor(parent.height / root.cellSize) * root.cellSize + mainGridContainer.headerHeight
property int columns: root.columns - favoritesColumn.columns - filterListColumn.columns
property Item visibleGrid: mainGrid
......@@ -584,7 +584,7 @@ Kicker.DashboardWindow {
property int headerHeight: mainColumnLabel.height + mainColumnLabelUnderline.height + units.largeSpacing
opacity: {
if (tabBar.activeTab == 0 && searching) {
if (tabBar.activeTab == 0 && root.searching) {
return 0.0;
}
......@@ -649,7 +649,7 @@ Kicker.DashboardWindow {
width: parent.width
height: systemFavoritesGrid.y + systemFavoritesGrid.height - mainGridContainer.headerHeight
cellWidth: (tabBar.activeTab == 0 ? cellSize : cellSize * 2)
cellWidth: (tabBar.activeTab == 0 ? root.cellSize : root.cellSize * 2)
cellHeight: cellWidth
iconSize: (tabBar.activeTab == 0 ? root.iconSize : cellWidth - (units.largeSpacing * 2))
......@@ -747,7 +747,7 @@ Kicker.DashboardWindow {
grabFocus: true
opacity: (tabBar.activeTab == 0 && searching) ? 1.0 : 0.0
opacity: (tabBar.activeTab == 0 && root.searching) ? 1.0 : 0.0
onOpacityChanged: {
if (opacity == 1.0) {
......@@ -782,7 +782,7 @@ Kicker.DashboardWindow {
} else if (event.key === Qt.Key_Backtab) {
event.accepted = true;
if (searching) {
if (root.searching) {
cancelSearchButton.focus = true;
} else if (tabBar.visible) {
tabBar.focus = true;
......@@ -804,7 +804,7 @@ Kicker.DashboardWindow {
bottom: parent.bottom
}
width: columns * cellSize
width: columns * root.cellSize
property int columns: 3
......@@ -818,11 +818,11 @@ Kicker.DashboardWindow {
width: parent.width
height: mainGrid.height
enabled: !searching
enabled: !root.searching
property alias currentIndex: filterList.currentIndex
opacity: root.visible ? (searching ? 0.30 : 1.0) : 0.3
opacity: root.visible ? (root.searching ? 0.30 : 1.0) : 0.3
Behavior on opacity { SmoothedAnimation { duration: units.longDuration; velocity: 0.01 } }
......@@ -1012,12 +1012,12 @@ Kicker.DashboardWindow {
}
}
filterListColumn.columns = Math.ceil(width / cellSize);
filterListColumn.columns = Math.ceil(width / root.cellSize);
filterListScrollArea.width = width + hItemMargins + (units.gridUnit * 2);
}
function applyFilter() {
if (!searching && currentIndex >= 0) {
if (!root.searching && currentIndex >= 0) {
if (tabBar.activeTab == 1) {
root.widgetExplorer.widgetsModel.filterQuery = currentItem.m.filterData;
root.widgetExplorer.widgetsModel.filterType = currentItem.m.filterType;
......
......@@ -39,7 +39,7 @@ Item {
color: tab.parent.focus ? theme.highlightColor : "black"
opacity: active ? 0.4 : 0.15
opacity: tab.active ? 0.4 : 0.15
Behavior on opacity { SmoothedAnimation { duration: units.shortDuration; velocity: 0.01 } }
}
......@@ -50,7 +50,7 @@ Item {
elide: Text.ElideNone
wrapMode: Text.NoWrap
opacity: active ? 1.0 : 0.6
opacity: tab.active ? 1.0 : 0.6
Behavior on opacity { SmoothedAnimation { duration: units.shortDuration; velocity: 0.01 } }
color: tab.parent.focus ? theme.highlightedTextColor : "white"
......@@ -68,7 +68,7 @@ Item {
}
onContainsMouseChanged: {
tab.parent.containsMouseChanged(index, containsMouse);
tab.parent.containsMouseChanged(tab.index, containsMouse);
}
}
}
......@@ -61,10 +61,10 @@ Item {
PlasmaCore.IconItem {
id: icon
y: showLabel ? (2 * highlightItemSvg.margins.top) : undefined
y: item.showLabel ? (2 * highlightItemSvg.margins.top) : undefined
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: showLabel ? undefined : parent.verticalCenter
anchors.verticalCenter: item.showLabel ? undefined : parent.verticalCenter
width: iconSize
height: width
......@@ -80,7 +80,7 @@ Item {
PlasmaComponents.Label {
id: label
visible: showLabel
visible: item.showLabel
anchors {
top: icon.bottom
......
......@@ -81,14 +81,14 @@ Item {
autoPopulate: false
appNameFormat: plasmoid.configuration.appNameFormat
flat: isDash ? true : plasmoid.configuration.limitDepth
flat: kicker.isDash ? true : plasmoid.configuration.limitDepth
sorted: plasmoid.configuration.alphaSort
showSeparators: !isDash
showSeparators: !kicker.isDash
appletInterface: plasmoid
showAllApps: isDash
showAllApps: kicker.isDash
showAllAppsCategorized: true
showTopLevelItems: !isDash
showTopLevelItems: !kicker.isDash
showRecentApps: plasmoid.configuration.showRecentApps
showRecentDocs: plasmoid.configuration.showRecentDocs
showRecentContacts: plasmoid.configuration.showRecentContacts
......@@ -160,7 +160,7 @@ Item {
runners: {
var runners = new Array("services");
if (isDash) {
if (kicker.isDash) {
runners = runners.concat(new Array("desktopsessions", "PowerDevil",
"calculator", "unitconverter"));
}
......@@ -172,7 +172,7 @@ Item {
return runners;
}
deleteWhenEmpty: isDash
deleteWhenEmpty: kicker.isDash
}
Kicker.DragHelper {
......@@ -263,7 +263,7 @@ Item {
Component.onCompleted: {
if (plasmoid.hasOwnProperty("activationTogglesExpanded")) {
plasmoid.activationTogglesExpanded = !isDash
plasmoid.activationTogglesExpanded = !kicker.isDash
}
windowSystem.focusIn.connect(enableHideOnWindowDeactivate);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment