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 {
readonly property int size: abstractItem.inVisibleLayout ? root.itemSize : units.iconSizes.medium
Layout.alignment: Qt.AlignHCenter
implicitWidth: size
implicitHeight: size
implicitWidth: root.vertical && abstractItem.inVisibleLayout ? abstractItem.width : size
implicitHeight: !root.vertical && abstractItem.inVisibleLayout ? abstractItem.height : size
Layout.topMargin: abstractItem.inHiddenLayout ? units.smallSpacing : 0
}
PlasmaComponents.Label {
......
......@@ -156,13 +156,14 @@ MouseArea {
interactive: false //disable features we don't need
flow: vertical ? GridView.LeftToRight : GridView.TopToBottom
cellHeight: root.itemSize + units.smallSpacing
cellWidth: root.itemSize + units.smallSpacing
readonly property int columns: !vertical ? Math.ceil(count / rows)
: Math.max(1, Math.floor(root.width / cellWidth))
readonly property int rows: vertical ? Math.ceil(count / columns)
: Math.max(1, Math.floor(root.height / cellHeight))
cellHeight: vertical ? cellLength : root.height / rows
cellWidth: vertical ? root.width / columns : cellLength
readonly property int cellLength: root.itemSize + units.smallSpacing
readonly property int columns: !vertical ? Math.ceil(count / rows) :
Math.max(1, Math.floor(root.width / cellLength))
readonly property int rows: vertical ? Math.ceil(count / columns) :
Math.max(1, Math.floor(root.height / cellLength))
implicitHeight: rows * cellHeight
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