Skip to content

Commit

Permalink
fix spacing and applets coloring
Browse files Browse the repository at this point in the history
  • Loading branch information
psifidotos committed Oct 24, 2020
1 parent 0961df1 commit f50dce3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,22 @@ PlasmaCore.ToolTipArea {
}
}


ColumnLayout {
id: itemColumn
anchors.fill: abstractItem
spacing: 0

Item {
id: iconContainer

property alias inVisibleLayout: abstractItem.inVisibleLayout
readonly property int size: abstractItem.inVisibleLayout ? root.itemSize : units.iconSizes.medium

Layout.alignment: Qt.AlignHCenter
implicitWidth: root.vertical && abstractItem.inVisibleLayout ? abstractItem.width : size
implicitHeight: !root.vertical && abstractItem.inVisibleLayout ? abstractItem.height : size
Layout.topMargin: abstractItem.inHiddenLayout ? units.smallSpacing : 0

visible: !colorizerLoader.active
}
PlasmaComponents3.Label {
id: label
Expand Down Expand Up @@ -175,7 +176,10 @@ PlasmaCore.ToolTipArea {
//!Latte Coloring Approach with Colorizer and BrightnessContrast for hovering effect
Loader {
id: colorizerLoader
anchors.fill: itemRow
anchors.centerIn: itemColumn
width: iconContainer.width
height: iconContainer.height

active: root.inLatte
&& !abstractItem.inHiddenLayout
&& !labelVisible
Expand All @@ -193,7 +197,10 @@ PlasmaCore.ToolTipArea {

Loader {
id: hoveredColorizerLoader
anchors.fill: itemRow
anchors.centerIn: itemColumn
width: iconContainer.width
height: iconContainer.height

active: colorizerLoader.active
z:1001

Expand All @@ -210,6 +217,5 @@ PlasmaCore.ToolTipArea {
}
}
}

}

4 changes: 2 additions & 2 deletions org.kde.plasma.private.systemtray/contents/ui/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ MouseArea {
readonly property bool vertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
readonly property bool autoSize: plasmoid.configuration.scaleIconsToFit
readonly property int cellThickness: root.vertical ? root.width : root.height
readonly property int rowsOrColumns: autoSize ? 1 : Math.max(1, Math.floor(cellThickness / (smallIconSize + PlasmaCore.Units.smallSpacing)))
readonly property int rowsOrColumns: autoSize ? 1 : Math.max(1, Math.floor(cellThickness / (smallIconSize + plasmoid.configuration.iconsSpacing)))

property alias expanded: dialog.visible
property Item activeApplet
Expand Down Expand Up @@ -181,7 +181,7 @@ MouseArea {

GridView {
id: tasksGrid
readonly property int smallSizeCellLength: root.cellThickness >= root.smallIconSize ? root.smallIconSize + units.smallSpacing * 2
readonly property int smallSizeCellLength: root.cellThickness >= root.smallIconSize ? root.smallIconSize + plasmoid.configuration.iconsSpacing
: root.smallIconSize
readonly property int autoSizeCellLength: root.cellThickness / root.rowsOrColumns
readonly property int totalLength: root.vertical ? cellHeight * Math.round(count / root.rowsOrColumns)
Expand Down

0 comments on commit f50dce3

Please sign in to comment.