Commit fd78da89 authored by Michail Vourlakos's avatar Michail Vourlakos Committed by Nate Graham
Browse files

systemtray items respect Fitt's Law when in panel

--systemtray items are now using a rectangular form
in order to specify their hit area. So they take into
account the panel thickness in order to calculate
properly their cell length and thickness to
respect Fitt's Law. Items that are nearer to the
screen edge can now trigger all their events when
the user uses its mouse at the farest of the screen edge.
parent 72cebd84
...@@ -136,8 +136,8 @@ PlasmaCore.ToolTipArea { ...@@ -136,8 +136,8 @@ PlasmaCore.ToolTipArea {
readonly property int size: abstractItem.inVisibleLayout ? root.itemSize : units.iconSizes.medium readonly property int size: abstractItem.inVisibleLayout ? root.itemSize : units.iconSizes.medium
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
implicitWidth: size implicitWidth: root.vertical && abstractItem.inVisibleLayout ? abstractItem.width : size
implicitHeight: size implicitHeight: !root.vertical && abstractItem.inVisibleLayout ? abstractItem.height : size
Layout.topMargin: abstractItem.inHiddenLayout ? units.smallSpacing : 0 Layout.topMargin: abstractItem.inHiddenLayout ? units.smallSpacing : 0
} }
PlasmaComponents.Label { PlasmaComponents.Label {
......
...@@ -156,13 +156,14 @@ MouseArea { ...@@ -156,13 +156,14 @@ MouseArea {
interactive: false //disable features we don't need interactive: false //disable features we don't need
flow: vertical ? GridView.LeftToRight : GridView.TopToBottom flow: vertical ? GridView.LeftToRight : GridView.TopToBottom
cellHeight: root.itemSize + units.smallSpacing cellHeight: vertical ? cellLength : root.height / rows
cellWidth: root.itemSize + units.smallSpacing cellWidth: vertical ? root.width / columns : cellLength
readonly property int columns: !vertical ? Math.ceil(count / rows) readonly property int cellLength: root.itemSize + units.smallSpacing
: Math.max(1, Math.floor(root.width / cellWidth)) readonly property int columns: !vertical ? Math.ceil(count / rows) :
readonly property int rows: vertical ? Math.ceil(count / columns) Math.max(1, Math.floor(root.width / cellLength))
: Math.max(1, Math.floor(root.height / cellHeight)) readonly property int rows: vertical ? Math.ceil(count / columns) :
Math.max(1, Math.floor(root.height / cellLength))
implicitHeight: rows * cellHeight implicitHeight: rows * cellHeight
implicitWidth: columns * cellWidth implicitWidth: columns * cellWidth
......
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