summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBj√∂rn Feber <[email protected]>2018-12-14 16:31:01 -0700
committerNate Graham <[email protected]>2018-12-14 16:36:54 -0700
commit185c0d38381ca9b34f4f06102dd3d8755010e71d (patch)
tree8c4294196718734e89c2a3323686575cdfd6b7ef
parentc1b9e8003febb1da46b110ff7a92e5b4e036b732 (diff)
[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
-rw-r--r--desktoppackage/contents/configuration/panelconfiguration/EdgeHandle.qml24
-rw-r--r--desktoppackage/contents/configuration/panelconfiguration/SizeHandle.qml24
2 files changed, 47 insertions, 1 deletions
diff --git a/desktoppackage/contents/configuration/panelconfiguration/EdgeHandle.qml b/desktoppackage/contents/configuration/panelconfiguration/EdgeHandle.qml
index dc8a130..e48f29a 100644
--- a/desktoppackage/contents/configuration/panelconfiguration/EdgeHandle.qml
+++ b/desktoppackage/contents/configuration/panelconfiguration/EdgeHandle.qml
@@ -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;
diff --git a/desktoppackage/contents/configuration/panelconfiguration/SizeHandle.qml b/desktoppackage/contents/configuration/panelconfiguration/SizeHandle.qml
index 19aa498..3e56be8 100644
--- a/desktoppackage/contents/configuration/panelconfiguration/SizeHandle.qml
+++ b/desktoppackage/contents/configuration/panelconfiguration/SizeHandle.qml
@@ -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) {