Fix some bits in the Plasma style

Use properties that exist
Remove unused warningy code
Make sure we don't call null objects

Reviewed by Marco
This commit is contained in:
Aleix Pol 2019-12-11 14:42:25 +01:00
parent e4e1613b0f
commit 2649878108
3 changed files with 6 additions and 12 deletions

View File

@ -53,13 +53,13 @@ QtObject {
property color selectionTextColor: theme.highlightedTextColor
property color selectionBackgroundColor: theme.highlightColor
property color selectionAlternateBackgroundColor: Qt.darker(theme.selectionBackgroundColor, 1.05)
property color selectionAlternateBackgroundColor: Qt.darker(theme.highlightColor, 1.05)
property color selectionHoverColor: theme.buttonHoverColor
property color selectionFocusColor: theme.buttonFocusColor
property color tooltipTextColor: theme.complementaryTextColor
property color tooltipBackgroundColor: theme.complementaryBackgroundColor
property color tooltipAlternateBackgroundColor: Qt.darker(theme.tooltipBackgroundColor, 1.05)
property color tooltipAlternateBackgroundColor: Qt.darker(theme.complementaryBackgroundColor, 1.05)
property color tooltipHoverColor: theme.complementaryHoverColor
property color tooltipFocusColor: theme.complementaryFocusColor

View File

@ -70,11 +70,5 @@ T.ProgressBar {
imagePath: "widgets/bar_meter_horizontal"
prefix: "bar-inactive"
colorGroup: PlasmaCore.ColorScope.colorGroup
onRepaintNeeded: {
implicitHeight = barSvg.elementSize("hint-bar-size").height
if (implicitHeight == 0) {
implicitHeight = barSvg.elementSize("bar-inactive-top").height + barSvg.elementSize("bar-inactive-bottom").height
}
}
}
}

View File

@ -35,18 +35,18 @@ Popup {
closePolicy: Popup.NoAutoClose
property bool shouldBeVisible: false
x: controlRoot ? Math.min(Math.max(0, controlRoot.mapToItem(root.parent, controlRoot.positionToRectangle(controlRoot.selectionStart).x, 0).x - root.width/2), controlRoot.Window.contentItem.width - root.width) : 0
x: parent ? Math.min(Math.max(0, controlRoot.mapToItem(root.parent, controlRoot.positionToRectangle(controlRoot.selectionStart).x, 0).x - root.width/2), parent.width - root.width) : 0
y: {
if (!controlRoot) {
if (!parent) {
return false;
}
var desiredY = controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionStart).y).y - root.height;
if (desiredY >= 0) {
return Math.min(desiredY, controlRoot.Window.contentItem.height - root.height);
return Math.min(desiredY, parent.height - root.height);
} else {
return Math.min(Math.max(0, controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionEnd).y + Math.round(units.gridUnit*1.5)).y), controlRoot.Window.contentItem.height - root.height);
return Math.min(Math.max(0, controlRoot.mapToItem(root.parent, 0, controlRoot.positionToRectangle(controlRoot.selectionEnd).y + Math.round(units.gridUnit*1.5)).y), parent.height - root.height);
}
}