1- use crate :: consts:: { UI_SCALE_DEFAULT , UI_SCALE_MAX , UI_SCALE_MIN , VIEWPORT_ZOOM_WHEEL_RATE , VIEWPORT_ZOOM_WHEEL_RATE_CHANGE } ;
1+ use crate :: consts:: { VIEWPORT_ZOOM_WHEEL_RATE , VIEWPORT_ZOOM_WHEEL_RATE_CHANGE } ;
22use crate :: messages:: layout:: utility_types:: widget_prelude:: * ;
33use crate :: messages:: portfolio:: document:: utility_types:: wires:: GraphWireStyle ;
44use crate :: messages:: preferences:: SelectionMode ;
@@ -155,14 +155,14 @@ impl PreferencesDialogMessageHandler {
155155 rows. extend_from_slice ( & [ header, selection_label, selection_mode] ) ;
156156 }
157157
158- // ==========
159- // UI
160- // ==========
158+ // =========
159+ // INTERFACE
160+ // =========
161161 #[ cfg( not( target_family = "wasm" ) ) ]
162162 {
163- let header = vec ! [ TextLabel :: new( "UI " ) . italic( true ) . widget_instance( ) ] ;
163+ let header = vec ! [ TextLabel :: new( "Interface " ) . italic( true ) . widget_instance( ) ] ;
164164
165- let scale_description = "Adjust the scale of the user interface (100 is default)." ;
165+ let scale_description = "Adjust the scale of the entire user interface (100% is default)." ;
166166 let scale_label = vec ! [
167167 Separator :: new( SeparatorType :: Unrelated ) . widget_instance( ) ,
168168 Separator :: new( SeparatorType :: Unrelated ) . widget_instance( ) ,
@@ -176,15 +176,18 @@ impl PreferencesDialogMessageHandler {
176176 . tooltip_description( scale_description)
177177 . mode_range( )
178178 . int( )
179- . min( ui_scale_to_display( UI_SCALE_MIN ) )
180- . max( ui_scale_to_display( UI_SCALE_MAX ) )
179+ . min( ui_scale_to_display( crate :: consts :: UI_SCALE_MIN ) )
180+ . max( ui_scale_to_display( crate :: consts :: UI_SCALE_MAX ) )
181181 . unit( "%" )
182182 . on_update( |number_input: & NumberInput | {
183183 if let Some ( display_value) = number_input. value {
184184 let scale = map_display_to_ui_scale( display_value) ;
185185 PreferencesMessage :: UIScale { scale } . into( )
186186 } else {
187- PreferencesMessage :: UIScale { scale: UI_SCALE_DEFAULT } . into( )
187+ PreferencesMessage :: UIScale {
188+ scale: crate :: consts:: UI_SCALE_DEFAULT ,
189+ }
190+ . into( )
188191 }
189192 } )
190193 . widget_instance( ) ,
@@ -376,11 +379,13 @@ fn map_zoom_rate_to_display(rate: f64) -> f64 {
376379}
377380
378381/// Maps display values in percent to actual ui scale.
382+ #[ cfg( not( target_family = "wasm" ) ) ]
379383fn map_display_to_ui_scale ( display : f64 ) -> f64 {
380384 display / 100.
381385}
382386
383387/// Maps actual ui scale back to display values in percent.
388+ #[ cfg( not( target_family = "wasm" ) ) ]
384389fn ui_scale_to_display ( scale : f64 ) -> f64 {
385390 scale * 100.
386391}
0 commit comments