Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pxtlib/melody-editor/melodyGallery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ namespace pxtmelody {
return;
}
const [x, y] = this.selectedColRow;
const arrowToSelection = pxt.Util.isUserLanguageRtl() ? "ArrowRight" : "ArrowLeft";
const arrowToPreview = pxt.Util.isUserLanguageRtl() ? "ArrowLeft" : "ArrowRight";
switch(e.code) {
case "ArrowUp": {
this.selectedColRow = [x, Math.max(0, y - 1)];
Expand All @@ -71,11 +73,11 @@ namespace pxtmelody {
this.selectedColRow = [x, Math.min(this.selectionButtons.length - 1, y + 1)];
break;
}
case "ArrowLeft": {
case arrowToSelection: {
this.selectedColRow = [Math.max(0, x - 1), y];
break;
}
case "ArrowRight": {
case arrowToPreview: {
// Only two columns.
this.selectedColRow = [Math.min(1, x + 1), y];
break;
Expand Down
4 changes: 3 additions & 1 deletion react-common/components/controls/DraggableGraph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,8 @@ export const DraggableGraph = (props: DraggableGraphProps) => {
!isNotLast && getValue(index - 1) > getValue(index)
);

const textAnchor = (isNotLast !== pxt.Util.isUserLanguageRtl()) ? "start" : "end"

return <g key={index} className="draggable-graph-column">
{isNotLast &&
<path
Expand Down Expand Up @@ -216,7 +218,7 @@ export const DraggableGraph = (props: DraggableGraphProps) => {
className="common-draggable-graph-text"
x={isNotLast ? x + unit * 2 : x - unit}
y={shouldFlipLabel ? y + unit * 2 : Math.max(y - unit, unit)}
textAnchor={isNotLast ? "start" : "end"}
textAnchor={textAnchor}
fontSize={unit}>
{Math.round(getValue(index)) + (valueUnits || "")}
</text>
Expand Down
6 changes: 6 additions & 0 deletions theme/soundeffecteditor.less
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@
}
}

.rtl .common-button.sound-effect-play-button {
.fas.fa-play, .fas.fa-stop {
margin: 0 0.25rem 0 0;
}
}

.common-button.sound-effect-play-button:focus-visible {
outline: 3px solid var(--pxt-focus-border);
outline-offset: 3px;
Expand Down
6 changes: 4 additions & 2 deletions webapp/src/components/soundEffectEditor/SoundGallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,19 @@ export const SoundGallery = (props: SoundGalleryProps) => {
next: number,
current: number,
e: React.KeyboardEvent<HTMLElement>) => {
const arrowToSelection = pxt.Util.isUserLanguageRtl() ? "ArrowRight" : "ArrowLeft";
const arrowToPreview = pxt.Util.isUserLanguageRtl() ? "ArrowLeft" : "ArrowRight";
switch(e.code) {
case "ArrowDown":
selectedCoord.current.row = next;
break;
case "ArrowUp":
selectedCoord.current.row = prev;
break;
case "ArrowLeft":
case arrowToSelection:
selectedCoord.current.col = "select";
break;
case "ArrowRight":
case arrowToPreview:
selectedCoord.current.col = "preview";
break;
case "Space":
Expand Down