mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
flutter_desktop: scroll, mid commit
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -432,22 +432,27 @@ class ImageModel with ChangeNotifier {
|
||||
}
|
||||
}
|
||||
|
||||
enum ScrollStyle {
|
||||
scrollbar,
|
||||
scrollmouse,
|
||||
}
|
||||
|
||||
class CanvasModel with ChangeNotifier {
|
||||
double _x = 0;
|
||||
double _y = 0;
|
||||
double _scale = 1.0;
|
||||
double _tabBarHeight = 0.0;
|
||||
String id = ""; // TODO multi canvas model
|
||||
ScrollStyle _scrollStyle = ScrollStyle.scrollbar;
|
||||
|
||||
WeakReference<FFI> parent;
|
||||
|
||||
CanvasModel(this.parent);
|
||||
|
||||
double get x => _x;
|
||||
|
||||
double get y => _y;
|
||||
|
||||
double get scale => _scale;
|
||||
ScrollStyle get scrollStyle => _scrollStyle;
|
||||
|
||||
set tabBarHeight(double h) => _tabBarHeight = h;
|
||||
double get tabBarHeight => _tabBarHeight;
|
||||
@@ -497,6 +502,16 @@ class CanvasModel with ChangeNotifier {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void updateScrollStyle() async {
|
||||
final s = await bind.getSessionOption(id: id, arg: 'scroll-style');
|
||||
if (s == 'scrollmouse') {
|
||||
_scrollStyle = ScrollStyle.scrollmouse;
|
||||
} else {
|
||||
_scrollStyle = ScrollStyle.scrollbar;
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
void update(double x, double y, double scale) {
|
||||
_x = x;
|
||||
_y = y;
|
||||
|
||||
Reference in New Issue
Block a user