mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 18:36:11 +02:00
Add flutter support for extended bitrate
This commit is contained in:
parent
4b58f0b4dd
commit
63bf4b5fa8
1 changed files with 28 additions and 3 deletions
|
@ -1220,7 +1220,8 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||
qualityInitValue =
|
||||
quality != null && quality.isNotEmpty ? quality[0].toDouble() : 50.0;
|
||||
const qualityMinValue = 10.0;
|
||||
const qualityMaxValue = 100.0;
|
||||
const qualityMoreThresholdValue = 100.0;
|
||||
const qualityMaxValue = 4000.0;
|
||||
if (qualityInitValue < qualityMinValue) {
|
||||
qualityInitValue = qualityMinValue;
|
||||
}
|
||||
|
@ -1228,6 +1229,8 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||
qualityInitValue = qualityMaxValue;
|
||||
}
|
||||
final RxDouble qualitySliderValue = RxDouble(qualityInitValue);
|
||||
final moreQualityInitValue = qualityInitValue > qualityMoreThresholdValue;
|
||||
final RxBool moreQualityChecked = RxBool(moreQualityInitValue);
|
||||
final debouncerQuality = Debouncer<double>(
|
||||
Duration(milliseconds: 1000),
|
||||
onChanged: (double v) {
|
||||
|
@ -1242,7 +1245,9 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||
child: Slider(
|
||||
value: qualitySliderValue.value,
|
||||
min: qualityMinValue,
|
||||
max: qualityMaxValue,
|
||||
max: moreQualityChecked.value
|
||||
? qualityMaxValue
|
||||
: qualityMoreThresholdValue,
|
||||
divisions: 18,
|
||||
onChanged: (double value) {
|
||||
qualitySliderValue.value = value;
|
||||
|
@ -1256,11 +1261,31 @@ customImageQualityDialog(SessionID sessionId, String id, FFI ffi) async {
|
|||
style: const TextStyle(fontSize: 15),
|
||||
)),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
flex: 1,
|
||||
child: Text(
|
||||
translate('Bitrate'),
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue