flutter desktop: ui changes

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2022-09-01 22:36:40 -07:00
parent 2dc8c02d15
commit 722a4d3de7
4 changed files with 88 additions and 441 deletions

View File

@@ -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',