@@ -165,12 +165,77 @@ FloatingPane {
165165 }
166166 }
167167
168- Label {
169- id: frameLabel
168+ Item {
169+ Layout .preferredWidth : previousFrameButton .width + frameMetrics .width + nextFrameButton .width
170+ Layout .preferredHeight : frameInput .height
170171
171- text: m .frame
172- Layout .preferredWidth : frameMetrics .width
172+ MouseArea {
173+ id: mouseAreaFrameLabel
174+
175+ anchors .fill : parent
176+
177+ hoverEnabled: true
178+
179+ onEntered: {
180+ previousFrameButton .opacity = 1
181+ nextFrameButton .opacity = 1
182+ }
183+
184+ onExited: {
185+ previousFrameButton .opacity = 0
186+ nextFrameButton .opacity = 0
187+ }
188+
189+ MaterialToolButton {
190+ id: previousFrameButton
191+
192+ anchors .verticalCenter : mouseAreaFrameLabel .verticalCenter
193+
194+ opacity: 0
195+
196+ text: MaterialIcons .navigate_before
197+ ToolTip .text : " Previous Frame"
198+
199+ onClicked: {
200+ m .frame -= 1 ;
201+ }
202+ }
203+
204+ TextInput {
205+ id: frameInput
206+
207+ anchors .horizontalCenter : mouseAreaFrameLabel .horizontalCenter
208+
209+ color: palette .text
210+ horizontalAlignment: Text .AlignHCenter
211+
212+ text: m .frame
213+ Layout .preferredWidth : frameMetrics .width
214+
215+ onEditingFinished: {
216+ m .frame = parseInt (text);
217+ focus = false ;
218+ }
219+ }
220+
221+ MaterialToolButton {
222+ id: nextFrameButton
223+
224+ anchors .right : mouseAreaFrameLabel .right
225+ anchors .verticalCenter : mouseAreaFrameLabel .verticalCenter
226+
227+ opacity: 0
228+
229+ text: MaterialIcons .navigate_next
230+ ToolTip .text : " Next Frame"
231+
232+ onClicked: {
233+ m .frame += 1 ;
234+ }
235+ }
236+ }
173237 }
238+
174239
175240 Slider {
176241 id: frameSlider
@@ -180,7 +245,6 @@ FloatingPane {
180245 stepSize: 1
181246 snapMode: Slider .SnapAlways
182247 live: true
183- enabled: ! m .playing
184248
185249 from: 0
186250 to: sortedViewIds .length - 1
@@ -189,6 +253,12 @@ FloatingPane {
189253 m .frame = value;
190254 }
191255
256+ ToolTip {
257+ parent: frameSlider .handle
258+ visible: frameSlider .hovered
259+ text: m .frame
260+ }
261+
192262 onPressedChanged: {
193263 m .syncSelected = ! pressed;
194264 }
@@ -227,23 +297,18 @@ FloatingPane {
227297 }
228298
229299 RowLayout {
230- Label {
231- text: " FPS:"
232- ToolTip .text : " Frame Per Second"
233- }
300+ TextInput {
301+ id: fpsTextInput
234302
235- SpinBox {
236- id: fpsSpinBox
303+ color: palette .text
237304
238- Layout .preferredWidth : fpsMetrics .width + up . implicitIndicatorWidth
305+ Layout .preferredWidth : fpsMetrics .width
239306
240- from: 1
241- to: 60
242- stepSize: 1
243- value: m .fps
307+ text: ! focus ? m .fps + " FPS" : m .fps
244308
245- onValueChanged: {
246- m .fps = value;
309+ onEditingFinished: {
310+ m .fps = parseInt (text);
311+ focus = false ;
247312 }
248313 }
249314 }
@@ -318,14 +383,14 @@ FloatingPane {
318383 TextMetrics {
319384 id: frameMetrics
320385
321- font: frameLabel .font
386+ font: frameInput .font
322387 text: " 10000"
323388 }
324389
325390 TextMetrics {
326391 id: fpsMetrics
327392
328- font: fpsSpinBox .font
329- text: " 100"
393+ font: fpsTextInput .font
394+ text: " 100 FPS "
330395 }
331396}
0 commit comments