@@ -81,98 +81,98 @@ impl UICommand {
81
81
pub fn text_and_tooltip ( self ) -> ( & ' static str , & ' static str ) {
82
82
match self {
83
83
#[ cfg( not( target_arch = "wasm32" ) ) ]
84
- UICommand :: Save => ( "Save…" , "Save all data to a Rerun data file (.rrd)" ) ,
84
+ Self :: Save => ( "Save…" , "Save all data to a Rerun data file (.rrd)" ) ,
85
85
86
86
#[ cfg( not( target_arch = "wasm32" ) ) ]
87
- UICommand :: SaveSelection => (
87
+ Self :: SaveSelection => (
88
88
"Save loop selection…" ,
89
89
"Save data for the current loop selection to a Rerun data file (.rrd)" ,
90
90
) ,
91
91
92
- UICommand :: Open => ( "Open…" , "Open any supported files (.rrd, images, meshes, …)" ) ,
92
+ Self :: Open => ( "Open…" , "Open any supported files (.rrd, images, meshes, …)" ) ,
93
93
94
- UICommand :: CloseCurrentRecording => (
94
+ Self :: CloseCurrentRecording => (
95
95
"Close current Recording" ,
96
96
"Close the current Recording (unsaved data will be lost)" ,
97
97
) ,
98
98
99
99
#[ cfg( not( target_arch = "wasm32" ) ) ]
100
- UICommand :: Quit => ( "Quit" , "Close the Rerun Viewer" ) ,
100
+ Self :: Quit => ( "Quit" , "Close the Rerun Viewer" ) ,
101
101
102
- UICommand :: OpenWebHelp => ( "Help" , "Visit the help page on our website, with troubleshooting tips and more" ) ,
103
- UICommand :: OpenRerunDiscord => ( "Rerun Discord" , "Visit the Rerun Discord server, where you can ask questions and get help" ) ,
102
+ Self :: OpenWebHelp => ( "Help" , "Visit the help page on our website, with troubleshooting tips and more" ) ,
103
+ Self :: OpenRerunDiscord => ( "Rerun Discord" , "Visit the Rerun Discord server, where you can ask questions and get help" ) ,
104
104
105
- UICommand :: ResetViewer => (
105
+ Self :: ResetViewer => (
106
106
"Reset Viewer" ,
107
107
"Reset the Viewer to how it looked the first time you ran it" ,
108
108
) ,
109
109
110
110
#[ cfg( not( target_arch = "wasm32" ) ) ]
111
- UICommand :: OpenProfiler => (
111
+ Self :: OpenProfiler => (
112
112
"Open profiler" ,
113
113
"Starts a profiler, showing what makes the viewer run slow" ,
114
114
) ,
115
115
116
- UICommand :: ToggleMemoryPanel => (
116
+ Self :: ToggleMemoryPanel => (
117
117
"Toggle Memory Panel" ,
118
118
"View and track current RAM usage inside Rerun Viewer" ,
119
119
) ,
120
- UICommand :: ToggleBlueprintPanel => ( "Toggle Blueprint Panel" , "Toggle the left panel" ) ,
121
- UICommand :: ToggleSelectionPanel => ( "Toggle Selection Panel" , "Toggle the right panel" ) ,
122
- UICommand :: ToggleTimePanel => ( "Toggle Time Panel" , "Toggle the bottom panel" ) ,
120
+ Self :: ToggleBlueprintPanel => ( "Toggle Blueprint Panel" , "Toggle the left panel" ) ,
121
+ Self :: ToggleSelectionPanel => ( "Toggle Selection Panel" , "Toggle the right panel" ) ,
122
+ Self :: ToggleTimePanel => ( "Toggle Time Panel" , "Toggle the bottom panel" ) ,
123
123
124
124
#[ cfg( debug_assertions) ]
125
- UICommand :: ToggleStylePanel => (
125
+ Self :: ToggleStylePanel => (
126
126
"Toggle Style Panel" ,
127
127
"View and change global egui style settings" ,
128
128
) ,
129
129
130
130
#[ cfg( not( target_arch = "wasm32" ) ) ]
131
- UICommand :: ToggleFullscreen => (
131
+ Self :: ToggleFullscreen => (
132
132
"Toggle fullscreen" ,
133
133
"Toggle between windowed and fullscreen viewer" ,
134
134
) ,
135
135
#[ cfg( not( target_arch = "wasm32" ) ) ]
136
- UICommand :: ZoomIn => ( "Zoom In" , "Increases the UI zoom level" ) ,
136
+ Self :: ZoomIn => ( "Zoom In" , "Increases the UI zoom level" ) ,
137
137
#[ cfg( not( target_arch = "wasm32" ) ) ]
138
- UICommand :: ZoomOut => ( "Zoom Out" , "Decreases the UI zoom level" ) ,
138
+ Self :: ZoomOut => ( "Zoom Out" , "Decreases the UI zoom level" ) ,
139
139
#[ cfg( not( target_arch = "wasm32" ) ) ]
140
- UICommand :: ZoomReset => (
140
+ Self :: ZoomReset => (
141
141
"Reset Zoom" ,
142
142
"Resets the UI zoom level to the operating system's default value" ,
143
143
) ,
144
144
145
- UICommand :: SelectionPrevious => ( "Previous selection" , "Go to previous selection" ) ,
146
- UICommand :: SelectionNext => ( "Next selection" , "Go to next selection" ) ,
147
- UICommand :: ToggleCommandPalette => ( "Command Palette…" , "Toggle the Command Palette" ) ,
145
+ Self :: SelectionPrevious => ( "Previous selection" , "Go to previous selection" ) ,
146
+ Self :: SelectionNext => ( "Next selection" , "Go to next selection" ) ,
147
+ Self :: ToggleCommandPalette => ( "Command Palette…" , "Toggle the Command Palette" ) ,
148
148
149
- UICommand :: PlaybackTogglePlayPause => {
149
+ Self :: PlaybackTogglePlayPause => {
150
150
( "Toggle play/pause" , "Either play or pause the time" )
151
151
}
152
- UICommand :: PlaybackFollow => ( "Follow" , "Follow on from end of timeline" ) ,
153
- UICommand :: PlaybackStepBack => (
152
+ Self :: PlaybackFollow => ( "Follow" , "Follow on from end of timeline" ) ,
153
+ Self :: PlaybackStepBack => (
154
154
"Step time back" ,
155
155
"Move the time marker back to the previous point in time with any data" ,
156
156
) ,
157
- UICommand :: PlaybackStepForward => (
157
+ Self :: PlaybackStepForward => (
158
158
"Step time forward" ,
159
159
"Move the time marker to the next point in time with any data" ,
160
160
) ,
161
- UICommand :: PlaybackRestart => ( "Restart" , "Restart from beginning of timeline" ) ,
161
+ Self :: PlaybackRestart => ( "Restart" , "Restart from beginning of timeline" ) ,
162
162
163
163
#[ cfg( not( target_arch = "wasm32" ) ) ]
164
- UICommand :: ScreenshotWholeApp => (
164
+ Self :: ScreenshotWholeApp => (
165
165
"Screenshot" ,
166
166
"Copy screenshot of the whole app to clipboard" ,
167
167
) ,
168
168
#[ cfg( not( target_arch = "wasm32" ) ) ]
169
- UICommand :: PrintDatastore => (
169
+ Self :: PrintDatastore => (
170
170
"Print datastore" ,
171
171
"Prints the entire data store to the console. WARNING: this may be A LOT of text." ,
172
172
) ,
173
173
174
174
#[ cfg( target_arch = "wasm32" ) ]
175
- UICommand :: CopyDirectLink => (
175
+ Self :: CopyDirectLink => (
176
176
"Copy direct link" ,
177
177
"Copy a link to the viewer with the URL parameter set to the current .rrd data source."
178
178
)
@@ -200,58 +200,58 @@ impl UICommand {
200
200
201
201
match self {
202
202
#[ cfg( not( target_arch = "wasm32" ) ) ]
203
- UICommand :: Save => Some ( cmd ( Key :: S ) ) ,
203
+ Self :: Save => Some ( cmd ( Key :: S ) ) ,
204
204
#[ cfg( not( target_arch = "wasm32" ) ) ]
205
- UICommand :: SaveSelection => Some ( cmd_alt ( Key :: S ) ) ,
206
- UICommand :: Open => Some ( cmd ( Key :: O ) ) ,
207
- UICommand :: CloseCurrentRecording => None ,
205
+ Self :: SaveSelection => Some ( cmd_alt ( Key :: S ) ) ,
206
+ Self :: Open => Some ( cmd ( Key :: O ) ) ,
207
+ Self :: CloseCurrentRecording => None ,
208
208
209
209
#[ cfg( all( not( target_arch = "wasm32" ) , target_os = "windows" ) ) ]
210
- UICommand :: Quit => Some ( KeyboardShortcut :: new ( Modifiers :: ALT , Key :: F4 ) ) ,
210
+ Self :: Quit => Some ( KeyboardShortcut :: new ( Modifiers :: ALT , Key :: F4 ) ) ,
211
211
212
- UICommand :: OpenWebHelp => None ,
213
- UICommand :: OpenRerunDiscord => None ,
212
+ Self :: OpenWebHelp => None ,
213
+ Self :: OpenRerunDiscord => None ,
214
214
215
215
#[ cfg( all( not( target_arch = "wasm32" ) , not( target_os = "windows" ) ) ) ]
216
- UICommand :: Quit => Some ( cmd ( Key :: Q ) ) ,
216
+ Self :: Quit => Some ( cmd ( Key :: Q ) ) ,
217
217
218
- UICommand :: ResetViewer => Some ( ctrl_shift ( Key :: R ) ) ,
218
+ Self :: ResetViewer => Some ( ctrl_shift ( Key :: R ) ) ,
219
219
#[ cfg( not( target_arch = "wasm32" ) ) ]
220
- UICommand :: OpenProfiler => Some ( ctrl_shift ( Key :: P ) ) ,
221
- UICommand :: ToggleMemoryPanel => Some ( ctrl_shift ( Key :: M ) ) ,
222
- UICommand :: ToggleBlueprintPanel => Some ( ctrl_shift ( Key :: B ) ) ,
223
- UICommand :: ToggleSelectionPanel => Some ( ctrl_shift ( Key :: S ) ) ,
224
- UICommand :: ToggleTimePanel => Some ( ctrl_shift ( Key :: T ) ) ,
220
+ Self :: OpenProfiler => Some ( ctrl_shift ( Key :: P ) ) ,
221
+ Self :: ToggleMemoryPanel => Some ( ctrl_shift ( Key :: M ) ) ,
222
+ Self :: ToggleBlueprintPanel => Some ( ctrl_shift ( Key :: B ) ) ,
223
+ Self :: ToggleSelectionPanel => Some ( ctrl_shift ( Key :: S ) ) ,
224
+ Self :: ToggleTimePanel => Some ( ctrl_shift ( Key :: T ) ) ,
225
225
226
226
#[ cfg( debug_assertions) ]
227
- UICommand :: ToggleStylePanel => Some ( ctrl_shift ( Key :: U ) ) ,
227
+ Self :: ToggleStylePanel => Some ( ctrl_shift ( Key :: U ) ) ,
228
228
229
229
#[ cfg( not( target_arch = "wasm32" ) ) ]
230
- UICommand :: ToggleFullscreen => Some ( key ( Key :: F11 ) ) ,
230
+ Self :: ToggleFullscreen => Some ( key ( Key :: F11 ) ) ,
231
231
#[ cfg( not( target_arch = "wasm32" ) ) ]
232
- UICommand :: ZoomIn => Some ( egui:: gui_zoom:: kb_shortcuts:: ZOOM_IN ) ,
232
+ Self :: ZoomIn => Some ( egui:: gui_zoom:: kb_shortcuts:: ZOOM_IN ) ,
233
233
#[ cfg( not( target_arch = "wasm32" ) ) ]
234
- UICommand :: ZoomOut => Some ( egui:: gui_zoom:: kb_shortcuts:: ZOOM_OUT ) ,
234
+ Self :: ZoomOut => Some ( egui:: gui_zoom:: kb_shortcuts:: ZOOM_OUT ) ,
235
235
#[ cfg( not( target_arch = "wasm32" ) ) ]
236
- UICommand :: ZoomReset => Some ( egui:: gui_zoom:: kb_shortcuts:: ZOOM_RESET ) ,
236
+ Self :: ZoomReset => Some ( egui:: gui_zoom:: kb_shortcuts:: ZOOM_RESET ) ,
237
237
238
- UICommand :: SelectionPrevious => Some ( ctrl_shift ( Key :: ArrowLeft ) ) ,
239
- UICommand :: SelectionNext => Some ( ctrl_shift ( Key :: ArrowRight ) ) ,
240
- UICommand :: ToggleCommandPalette => Some ( cmd ( Key :: P ) ) ,
238
+ Self :: SelectionPrevious => Some ( ctrl_shift ( Key :: ArrowLeft ) ) ,
239
+ Self :: SelectionNext => Some ( ctrl_shift ( Key :: ArrowRight ) ) ,
240
+ Self :: ToggleCommandPalette => Some ( cmd ( Key :: P ) ) ,
241
241
242
- UICommand :: PlaybackTogglePlayPause => Some ( key ( Key :: Space ) ) ,
243
- UICommand :: PlaybackFollow => Some ( cmd ( Key :: ArrowRight ) ) ,
244
- UICommand :: PlaybackStepBack => Some ( key ( Key :: ArrowLeft ) ) ,
245
- UICommand :: PlaybackStepForward => Some ( key ( Key :: ArrowRight ) ) ,
246
- UICommand :: PlaybackRestart => Some ( cmd ( Key :: ArrowLeft ) ) ,
242
+ Self :: PlaybackTogglePlayPause => Some ( key ( Key :: Space ) ) ,
243
+ Self :: PlaybackFollow => Some ( cmd ( Key :: ArrowRight ) ) ,
244
+ Self :: PlaybackStepBack => Some ( key ( Key :: ArrowLeft ) ) ,
245
+ Self :: PlaybackStepForward => Some ( key ( Key :: ArrowRight ) ) ,
246
+ Self :: PlaybackRestart => Some ( cmd ( Key :: ArrowLeft ) ) ,
247
247
248
248
#[ cfg( not( target_arch = "wasm32" ) ) ]
249
- UICommand :: ScreenshotWholeApp => None ,
249
+ Self :: ScreenshotWholeApp => None ,
250
250
#[ cfg( not( target_arch = "wasm32" ) ) ]
251
- UICommand :: PrintDatastore => None ,
251
+ Self :: PrintDatastore => None ,
252
252
253
253
#[ cfg( target_arch = "wasm32" ) ]
254
- UICommand :: CopyDirectLink => None ,
254
+ Self :: CopyDirectLink => None ,
255
255
}
256
256
}
257
257
@@ -277,7 +277,7 @@ impl UICommand {
277
277
}
278
278
279
279
egui_ctx. input_mut ( |input| {
280
- for command in UICommand :: iter ( ) {
280
+ for command in Self :: iter ( ) {
281
281
if let Some ( kb_shortcut) = command. kb_shortcut ( ) {
282
282
if input. consume_shortcut ( & kb_shortcut) {
283
283
return Some ( command) ;
0 commit comments