mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
adjust scrollbar style, peers view support touch pad scroll, settings tab
remove horizontal touch pad scroll Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -273,11 +273,29 @@ class MyTheme {
|
||||
: EdgeInsets.only(left: dialogPadding / 3);
|
||||
|
||||
static ScrollbarThemeData scrollbarTheme = ScrollbarThemeData(
|
||||
thickness: MaterialStateProperty.all(kScrollbarThickness),
|
||||
thickness: MaterialStateProperty.all(6),
|
||||
thumbColor: MaterialStateProperty.resolveWith<Color?>((states) {
|
||||
if (states.contains(MaterialState.dragged)) {
|
||||
return Colors.grey[900];
|
||||
} else if (states.contains(MaterialState.hovered)) {
|
||||
return Colors.grey[700];
|
||||
} else {
|
||||
return Colors.grey[500];
|
||||
}
|
||||
}),
|
||||
crossAxisMargin: 4,
|
||||
);
|
||||
|
||||
static ScrollbarThemeData scrollbarThemeDark = scrollbarTheme.copyWith(
|
||||
thumbColor: MaterialStateProperty.all(Colors.grey[500]),
|
||||
thumbColor: MaterialStateProperty.resolveWith<Color?>((states) {
|
||||
if (states.contains(MaterialState.dragged)) {
|
||||
return Colors.grey[100];
|
||||
} else if (states.contains(MaterialState.hovered)) {
|
||||
return Colors.grey[300];
|
||||
} else {
|
||||
return Colors.grey[500];
|
||||
}
|
||||
}),
|
||||
);
|
||||
|
||||
static ThemeData lightTheme = ThemeData(
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'dart:collection';
|
||||
import 'package:dynamic_layouts/dynamic_layouts.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hbb/desktop/widgets/scroll_wrapper.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:visibility_detector/visibility_detector.dart';
|
||||
@@ -95,6 +96,8 @@ class _PeersViewState extends State<_PeersView> with WindowListener {
|
||||
return width;
|
||||
}();
|
||||
|
||||
final _scrollController = ScrollController();
|
||||
|
||||
_PeersViewState() {
|
||||
_startCheckOnlines();
|
||||
}
|
||||
@@ -197,14 +200,31 @@ class _PeersViewState extends State<_PeersView> with WindowListener {
|
||||
: SizedBox(width: mobileWidth, child: visibilityChild);
|
||||
}
|
||||
|
||||
final child = DynamicGridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithWrapping(
|
||||
mainAxisSpacing: space / 2, crossAxisSpacing: space),
|
||||
itemCount: peers.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return buildOnePeer(peers[index]);
|
||||
},
|
||||
);
|
||||
final Widget child;
|
||||
if (isMobile) {
|
||||
child = DynamicGridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithWrapping(
|
||||
mainAxisSpacing: space / 2, crossAxisSpacing: space),
|
||||
itemCount: peers.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return buildOnePeer(peers[index]);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
child = DesktopScrollWrapper(
|
||||
scrollController: _scrollController,
|
||||
child: DynamicGridView.builder(
|
||||
controller: _scrollController,
|
||||
physics: DraggableNeverScrollableScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithWrapping(
|
||||
mainAxisSpacing: space / 2, crossAxisSpacing: space),
|
||||
itemCount: peers.length,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
return buildOnePeer(peers[index]);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (updateEvent == UpdateEvent.load) {
|
||||
_curPeers.clear();
|
||||
_curPeers.addAll(peers.map((e) => e.id));
|
||||
|
||||
@@ -88,6 +88,11 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
|
||||
Get.put<RxInt>(selectedIndex, tag: _kSettingPageIndexTag);
|
||||
controller = PageController(initialPage: widget.initialPage);
|
||||
Get.put<PageController>(controller, tag: _kSettingPageControllerTag);
|
||||
controller.addListener(() {
|
||||
if (controller.page != null) {
|
||||
selectedIndex.value = controller.page!.toInt();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -154,7 +159,7 @@ class _DesktopSettingPageState extends State<DesktopSettingPage>
|
||||
scrollController: controller,
|
||||
child: PageView(
|
||||
controller: controller,
|
||||
physics: DraggableNeverScrollableScrollPhysics(),
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
children: _children(),
|
||||
)),
|
||||
),
|
||||
@@ -330,9 +335,11 @@ class _GeneralState extends State<_General> {
|
||||
child: _OptionCheckBox(context, "Always use software rendering",
|
||||
'allow-always-software-render'),
|
||||
));
|
||||
children.add(
|
||||
_OptionCheckBox(context, 'Check for software update on startup','enable-check-update',
|
||||
isServer: false,
|
||||
children.add(_OptionCheckBox(
|
||||
context,
|
||||
'Check for software update on startup',
|
||||
'enable-check-update',
|
||||
isServer: false,
|
||||
));
|
||||
if (bind.mainShowOption(key: 'allow-linux-headless')) {
|
||||
children.add(_OptionCheckBox(
|
||||
|
||||
Reference in New Issue
Block a user