mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-06-11 12:43:12 +08:00
Add flutter support for extended bitrate
This commit is contained in:
parent
4b58f0b4dd
commit
63bf4b5fa8
@ -1220,7 +1220,8 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||||||
qualityInitValue =
|
qualityInitValue =
|
||||||
quality != null && quality.isNotEmpty ? quality[0].toDouble() : 50.0;
|
quality != null && quality.isNotEmpty ? quality[0].toDouble() : 50.0;
|
||||||
const qualityMinValue = 10.0;
|
const qualityMinValue = 10.0;
|
||||||
const qualityMaxValue = 100.0;
|
const qualityMoreThresholdValue = 100.0;
|
||||||
|
const qualityMaxValue = 4000.0;
|
||||||
if (qualityInitValue < qualityMinValue) {
|
if (qualityInitValue < qualityMinValue) {
|
||||||
qualityInitValue = qualityMinValue;
|
qualityInitValue = qualityMinValue;
|
||||||
}
|
}
|
||||||
@ -1228,6 +1229,8 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||||||
qualityInitValue = qualityMaxValue;
|
qualityInitValue = qualityMaxValue;
|
||||||
}
|
}
|
||||||
final RxDouble qualitySliderValue = RxDouble(qualityInitValue);
|
final RxDouble qualitySliderValue = RxDouble(qualityInitValue);
|
||||||
|
final moreQualityInitValue = qualityInitValue > qualityMoreThresholdValue;
|
||||||
|
final RxBool moreQualityChecked = RxBool(moreQualityInitValue);
|
||||||
final debouncerQuality = Debouncer<double>(
|
final debouncerQuality = Debouncer<double>(
|
||||||
Duration(milliseconds: 1000),
|
Duration(milliseconds: 1000),
|
||||||
onChanged: (double v) {
|
onChanged: (double v) {
|
||||||
@ -1242,7 +1245,9 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||||||
child: Slider(
|
child: Slider(
|
||||||
value: qualitySliderValue.value,
|
value: qualitySliderValue.value,
|
||||||
min: qualityMinValue,
|
min: qualityMinValue,
|
||||||
max: qualityMaxValue,
|
max: moreQualityChecked.value
|
||||||
|
? qualityMaxValue
|
||||||
|
: qualityMoreThresholdValue,
|
||||||
divisions: 18,
|
divisions: 18,
|
||||||
onChanged: (double value) {
|
onChanged: (double value) {
|
||||||
qualitySliderValue.value = value;
|
qualitySliderValue.value = value;
|
||||||
@ -1256,11 +1261,31 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||||||
style: const TextStyle(fontSize: 15),
|
style: const TextStyle(fontSize: 15),
|
||||||
)),
|
)),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 2,
|
flex: 1,
|
||||||
child: Text(
|
child: Text(
|
||||||
translate('Bitrate'),
|
translate('Bitrate'),
|
||||||
style: const TextStyle(fontSize: 15),
|
style: const TextStyle(fontSize: 15),
|
||||||
)),
|
)),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Checkbox(
|
||||||
|
value: moreQualityChecked.value,
|
||||||
|
onChanged: (bool? value) {
|
||||||
|
moreQualityChecked.value = value!;
|
||||||
|
if (!value &&
|
||||||
|
qualitySliderValue.value > qualityMoreThresholdValue) {
|
||||||
|
qualitySliderValue.value = qualityMoreThresholdValue;
|
||||||
|
debouncerQuality.value = qualityMoreThresholdValue;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
).marginOnly(right: 5),
|
||||||
|
Expanded(
|
||||||
|
child: Text(translate('More')),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)),
|
||||||
],
|
],
|
||||||
));
|
));
|
||||||
// fps
|
// fps
|
||||||
|
Loading…
Reference in New Issue
Block a user