Skip to content

Commit

Permalink
fix(ui): mouse over FloatInput/IntInput->drag zone should show move c…
Browse files Browse the repository at this point in the history
…ursor
  • Loading branch information
yyc-git committed May 29, 2019
1 parent a085859 commit b0c4b57
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
5 changes: 4 additions & 1 deletion public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,10 @@ html, body {
.wonder-app-component .wonder-mainEditor-component .right-component .inspector-parent::-webkit-scrollbar-thumb:hover {
background: #fc7100; }
.wonder-app-component .wonder-mainEditor-component .right-component .inspector-parent .wonder-inspector-component .wonder-float-input .component-label {
cursor: move;
cursor: move !important;
user-select: none; }
.wonder-app-component .wonder-mainEditor-component .right-component .inspector-parent .wonder-inspector-component .wonder-int-input .component-label {
cursor: move !important;
user-select: none; }
.wonder-app-component .wonder-mainEditor-component .right-component .inspector-parent .wonder-inspector-component .wonder-three-float-input {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@import "../../../../../utils/inspectorItemMixin";
.wonder-inspector-component {
@import "../../../../ui/floatInput";
@import "../../../../ui/intInput";
@import "../../../../ui/threeFloatInput";
.wonder-inspector-sceneTree {
padding-top: 5px;
Expand Down
2 changes: 1 addition & 1 deletion public/sass/components/ui/_floatInput.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.wonder-float-input {
.component-label {
cursor: move;
cursor: move !important;
user-select: none;
}
}
6 changes: 6 additions & 0 deletions public/sass/components/ui/_intInput.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.wonder-int-input {
.component-label {
cursor: move !important;
user-select: none;
}
}
4 changes: 3 additions & 1 deletion src/core/atom_component/floatInput/FloatInput.re
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ module Method = {
computeNewValue(
state.inputValue |> OptionService.unsafeGet |> float_of_string,
state.canBeZero,
MouseEventService.getMovementDeltaWhenPointerLockedAndFixBug(e)|> WonderLog.Log.print,
MouseEventService.getMovementDeltaWhenPointerLockedAndFixBug(
e,
),
)
|> string_of_float,
),
Expand Down
12 changes: 6 additions & 6 deletions src/core/atom_component/intInput/IntInput.re
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ module Method = {
},
);
| Some(value) =>
ReasonReactUtils.sideEffects(_state =>
triggerOnBlur(value, onBlurFunc)
);
ReasonReactUtils.sideEffects(_state => triggerOnBlur(value, onBlurFunc))
};

let computeNewValue = (currentValue, (movementX, movementY)) => {
Expand Down Expand Up @@ -89,7 +87,9 @@ module Method = {
Some(
computeNewValue(
state.inputValue |> OptionService.unsafeGet |> int_of_string,
MouseEventService.getMovementDeltaWhenPointerLockedAndFixBug(e),
MouseEventService.getMovementDeltaWhenPointerLockedAndFixBug(
e,
),
)
|> string_of_int,
),
Expand Down Expand Up @@ -123,7 +123,7 @@ module Method = {
let renderContent = ((send, state)) =>
<div className="item-content">
<input
className="input-component float-input"
className="input-component int-input"
type_="text"
value={
switch (state.inputValue) {
Expand Down Expand Up @@ -159,7 +159,7 @@ let render =
(onBlurFunc, onDragDropFunc),
{state, handle, send}: ReasonReact.self('a, 'b, 'c),
) =>
<article className="inspector-item wonder-float-input">
<article className="inspector-item wonder-int-input">
{Method.renderLabel((send, state), label, title, onDragDropFunc)}
{Method.renderContent((send, state))}
</article>;
Expand Down

0 comments on commit b0c4b57

Please sign in to comment.