Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js

Issue 1824683002: Fixes 590477: Style pane numeric property change modifier shortcuts are undiscoverable. Shift mouse… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
index 9b462083694f1c3a7b0797f5c505f7162305af29..362f3bd9c522e7059d418921e3518ff92839cdad 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js
@@ -301,9 +301,10 @@ WebInspector._valueModificationDirection = function(event)
{
var direction = null;
if (event.type === "mousewheel") {
- if (event.wheelDeltaY > 0)
+ // When shift is pressed while spinning mousewheel, delta comes as wheelDeltaX
+ if (event.wheelDeltaY > 0 || event.wheelDeltaX > 0)
direction = "Up";
- else if (event.wheelDeltaY < 0)
+ else if (event.wheelDeltaY < 0 || event.wheelDeltaX < 0)
direction = "Down";
} else {
if (event.keyIdentifier === "Up" || event.keyIdentifier === "PageUp")
@@ -363,17 +364,18 @@ WebInspector._modifiedFloatNumber = function(number, event)
if (!direction)
return number;
- var arrowKeyOrMouseWheelEvent = (event.keyIdentifier === "Up" || event.keyIdentifier === "Down" || event.type === "mousewheel");
-
- // Jump by 10 when shift is down or jump by 0.1 when Alt/Option is down.
- // Also jump by 10 for page up and down, or by 100 if shift is held with a page key.
+ // Precision modifier keys work with both mousewheel and up/down keys.
+ // When ctrl is pressed, increase by 100
+ // When shift is pressed, increase by 10
+ // When alt is pressed, increase by 0.1
+ // Otherwise increase by 1
var changeAmount = 1;
- if (event.shiftKey && !arrowKeyOrMouseWheelEvent)
+ if (event.ctrlKey)
pfeldman 2016/03/21 18:18:30 WebInspector.KeyboardShortcut.eventHasCtrlOrMeta (
nojvek 2016/03/24 16:28:38 Done.
changeAmount = 100;
- else if (event.shiftKey || !arrowKeyOrMouseWheelEvent)
- changeAmount = 10;
else if (event.altKey)
changeAmount = 0.1;
+ else if (event.shiftKey)
pfeldman 2016/03/21 18:18:30 Lets keep handlers in sorted order: 100, 10, 0.1
nojvek 2016/03/24 16:28:38 Done.
+ changeAmount = 10;
if (direction === "Down")
changeAmount *= -1;

Powered by Google App Engine
This is Rietveld 408576698