mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-10 20:01:27 +03:00
flutter desktop: ui changes
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -472,9 +472,17 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
});
|
||||
final quality =
|
||||
await bind.sessionGetCustomImageQuality(id: widget.id);
|
||||
final double initValue = quality != null && quality.isNotEmpty
|
||||
double initValue = quality != null && quality.isNotEmpty
|
||||
? quality[0].toDouble()
|
||||
: 50.0;
|
||||
const minValue = 10.0;
|
||||
const maxValue = 100.0;
|
||||
if (initValue < minValue) {
|
||||
initValue = minValue;
|
||||
}
|
||||
if (initValue > maxValue) {
|
||||
initValue = maxValue;
|
||||
}
|
||||
final RxDouble sliderValue = RxDouble(initValue);
|
||||
final rxReplay = rxdart.ReplaySubject<double>();
|
||||
rxReplay
|
||||
@@ -489,10 +497,9 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
final slider = Obx(() {
|
||||
return Slider(
|
||||
value: sliderValue.value,
|
||||
min: 10.0,
|
||||
max: 100.0,
|
||||
min: minValue,
|
||||
max: maxValue,
|
||||
divisions: 90,
|
||||
// label: sliderValue.value.round().toString(),
|
||||
onChanged: (double value) {
|
||||
sliderValue.value = value;
|
||||
rxReplay.add(value);
|
||||
@@ -502,7 +509,12 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
||||
final content = Row(
|
||||
children: [
|
||||
slider,
|
||||
Obx(() => Text('${sliderValue.value.round()}% Bitrate'))
|
||||
SizedBox(
|
||||
width: 90,
|
||||
child: Obx(() => Text(
|
||||
'${sliderValue.value.round()}% Bitrate',
|
||||
style: const TextStyle(fontSize: 15),
|
||||
)))
|
||||
],
|
||||
);
|
||||
msgBoxCommon(widget.ffi.dialogManager, 'Custom Image Quality',
|
||||
|
||||
Reference in New Issue
Block a user