|
1 | 1 | package net.rpcs3.ui.settings.components.preference |
2 | 2 |
|
| 3 | +import androidx.compose.foundation.layout.Arrangement |
| 4 | +import androidx.compose.foundation.layout.Column |
| 5 | +import androidx.compose.foundation.text.KeyboardOptions |
3 | 6 | import androidx.compose.material.icons.Icons |
4 | 7 | import androidx.compose.material.icons.filled.Refresh |
5 | | -import androidx.compose.foundation.layout.* |
6 | | -import androidx.compose.foundation.text.KeyboardOptions |
7 | | -import androidx.compose.material3.* |
8 | | -import androidx.compose.runtime.* |
| 8 | +import androidx.compose.material3.AlertDialog |
| 9 | +import androidx.compose.material3.OutlinedTextField |
| 10 | +import androidx.compose.material3.Slider |
| 11 | +import androidx.compose.material3.SliderColors |
| 12 | +import androidx.compose.material3.SliderDefaults |
| 13 | +import androidx.compose.material3.Text |
| 14 | +import androidx.compose.material3.TextButton |
| 15 | +import androidx.compose.runtime.Composable |
| 16 | +import androidx.compose.runtime.getValue |
| 17 | +import androidx.compose.runtime.mutableFloatStateOf |
| 18 | +import androidx.compose.runtime.mutableStateOf |
| 19 | +import androidx.compose.runtime.remember |
| 20 | +import androidx.compose.runtime.setValue |
9 | 21 | import androidx.compose.ui.Modifier |
10 | 22 | import androidx.compose.ui.graphics.vector.ImageVector |
11 | | -import androidx.compose.ui.tooling.preview.PreviewLightDark |
12 | 23 | import androidx.compose.ui.text.input.KeyboardType |
| 24 | +import androidx.compose.ui.tooling.preview.PreviewLightDark |
13 | 25 | import androidx.compose.ui.unit.dp |
14 | 26 | import net.rpcs3.ui.common.ComposePreview |
15 | 27 | import net.rpcs3.ui.settings.components.core.PreferenceIcon |
@@ -91,16 +103,18 @@ fun SliderPreference( |
91 | 103 | } |
92 | 104 | ) |
93 | 105 |
|
94 | | - Slider( |
95 | | - value = tempValue, |
96 | | - onValueChange = { newValue -> |
97 | | - tempValue = newValue |
98 | | - textValue = newValue.toInt().toString() |
99 | | - }, |
100 | | - valueRange = valueRange, |
101 | | - steps = steps, |
102 | | - colors = sliderColors |
103 | | - ) |
| 106 | + if ((valueRange.endInclusive - valueRange.start) < 1000) { |
| 107 | + Slider( |
| 108 | + value = tempValue, |
| 109 | + onValueChange = { newValue -> |
| 110 | + tempValue = newValue |
| 111 | + textValue = newValue.toInt().toString() |
| 112 | + }, |
| 113 | + valueRange = valueRange, |
| 114 | + steps = steps, |
| 115 | + colors = sliderColors |
| 116 | + ) |
| 117 | + } |
104 | 118 | } |
105 | 119 | }, |
106 | 120 | confirmButton = { |
|
0 commit comments