Commit 185c0d38 authored by Björn Feber's avatar Björn Feber Committed by Nate Graham

[Panel Edit Mode] Change screen edge button hover cursor, add icons to screen...

[Panel Edit Mode] Change screen edge button hover cursor, add icons to screen edge button and panel size button, add tooltips

Summary:
Modifies the screen edge button and panel size button in the panel edit mode to make them easier to understand and look better (as suggested in this Phabricator task: https://phabricator.kde.org/T10047):
- When you hover over the screen edge button it now shows a move cursor (SizeAllCursor)
- The screen edge button now has an icon (transform-move)
- The panel size button now has an icon (resizecol/resizerow)
{F6455141}
It also adds a tooltip to the screen edge and panel size buttons:
{F6461324}

Test Plan: Open the panel edit mode.

Reviewers: #plasma, #vdg, ngraham, davidedmundson

Reviewed By: #plasma, #vdg, ngraham, davidedmundson

Subscribers: Codezela, davidedmundson, matheusm, ngraham, trickyricky26, #vdg, plasma-devel, #plasma

Tags: #plasma, #vdg

Maniphest Tasks: T10047

Differential Revision: https://phabricator.kde.org/D17323
parent c1b9e800
......@@ -17,6 +17,7 @@
*/
import QtQuick 2.0
import QtQuick.Controls 2.0 as QQC2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.core 2.0 as PlasmaCore
......@@ -25,12 +26,32 @@ import org.kde.kquickcontrolsaddons 2.0 as KQuickControlsAddons
PlasmaComponents.Button {
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Screen Edge")
iconSource: "transform-move"
checkable: true
checked: mel.pressed
QQC2.ToolTip {
id: tooltip
visible: false
timeout: 10000
contentItem: PlasmaComponents.Label {
anchors.fill: parent
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Click and drag the button to a screen edge to move the panel there.")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
color: tooltip.palette.toolTipText
}
KQuickControlsAddons.MouseEventListener {
anchors.fill: parent
onPressed: tooltip.visible = false
}
}
KQuickControlsAddons.MouseEventListener {
id: mel
cursorShape: Qt.DragMoveCursor
cursorShape: Qt.SizeAllCursor
anchors.fill: parent
property int lastX
property int lastY
......@@ -42,6 +63,7 @@ PlasmaComponents.Button {
lastY = mouse.screenY
startMouseX = mouse.x
startMouseY = mouse.y
tooltip.visible = true
}
onPositionChanged: {
panel.screenToFollow = mouse.screen;
......
......@@ -17,6 +17,7 @@
*/
import QtQuick 2.0
import QtQuick.Controls 2.0 as QQC2
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.core 2.0 as PlasmaCore
......@@ -27,6 +28,9 @@ PlasmaComponents.Button {
readonly property string textLabel: panel.location == PlasmaCore.Types.LeftEdge || panel.location == PlasmaCore.Types.RightEdge ? i18nd("plasma_shell_org.kde.plasma.desktop", "Width") : i18nd("plasma_shell_org.kde.plasma.desktop", "Height")
text: panelResizeHintTimer.running ? panel.thickness : textLabel
readonly property string sizeIcon: panel.location == PlasmaCore.Types.LeftEdge || panel.location == PlasmaCore.Types.RightEdge ? "resizecol" : "resizerow"
iconSource: sizeIcon
checkable: true
checked: mel.pressed
......@@ -40,6 +44,25 @@ PlasmaComponents.Button {
onThicknessChanged: panelResizeHintTimer.restart()
}
QQC2.ToolTip {
id: tooltip
visible: false
timeout: 10000
contentItem: PlasmaComponents.Label {
anchors.fill: parent
text: i18nd("plasma_shell_org.kde.plasma.desktop", "Click and drag the button to resize the panel.")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
wrapMode: Text.WordWrap
color: tooltip.palette.toolTipText
}
KQuickControlsAddons.MouseEventListener {
anchors.fill: parent
onPressed: tooltip.visible = false
}
}
KQuickControlsAddons.MouseEventListener {
id: mel
anchors.fill: parent
......@@ -51,6 +74,7 @@ PlasmaComponents.Button {
dialogRoot.closeContextMenu();
startMouseX = mouse.x
startMouseY = mouse.y
tooltip.visible = true
}
onPositionChanged: {
switch (panel.location) {
......
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