File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change 33import QtQuick
44import QtQuick.Controls
55import QtQuick.Layouts
6+ import ScratchCPP
67import ScratchCPP.UiComponents
78import ScratchCPP.Render
89
@@ -29,5 +30,23 @@ CustomDialog {
2930 checked: ! projectPlayer .spriteFencing
3031 onCheckedChanged: projectPlayer .spriteFencing = ! checked
3132 }
33+
34+ RowLayout {
35+ Label {
36+ text: qsTr (" FPS (frames per second)" )
37+ }
38+
39+ SpinBox {
40+ editable: true
41+ from: 1
42+ to: 250
43+ stepSize: 10
44+ value: projectPlayer .fps
45+ onValueChanged: {
46+ projectPlayer .fps = value;
47+ AppMenuBar .fps60Mode = (value === 60 );
48+ }
49+ }
50+ }
3251 }
3352}
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ ApplicationWindow {
1414 id: root
1515 minimumWidth: layout .implicitWidth + layout .anchors .margins * 2
1616 minimumHeight: menuBar .height + layout .implicitHeight + layout .anchors .margins * 2
17- visible: true
17+ visible: true
1818 title: Qt .application .displayName
1919 color: Material .background
2020 Material .accent : " orange"
@@ -33,6 +33,13 @@ ApplicationWindow {
3333 player .fileName = fileName;
3434 }
3535
36+ function onFps60ModeChanged () {
37+ if (AppMenuBar .fps60Mode )
38+ player .fps = 60 ;
39+ else if (player .fps === 60 )
40+ player .fps = 30 ;
41+ }
42+
3643 function onProjectSettingsTriggered () {
3744 projectSettingsDialog .open ();
3845 }
@@ -134,7 +141,6 @@ ApplicationWindow {
134141 activeFocusOnTab: true
135142 focus: true
136143 turboMode: AppMenuBar .turboMode
137- fps: AppMenuBar .fps60Mode ? 60 : 30
138144 }
139145 }
140146}
You can’t perform that action at this time.
0 commit comments