support padding width

This commit is contained in:
Siyi Guo committed 2023-04-13 16:55:24 +08:00
1 parent 90f53a0578
commit b430697b5c
2 files changed
+27 -5

No files matched your search

+3 -2
View File
@@ -9,7 +9,8 @@ import 'package:px_eye/widget/button.dart';
import 'package:window_manager/window_manager.dart';
class ImagePage extends StatefulWidget {
const ImagePage({Key? key}) : super(key: key);
const ImagePage({Key? key, this.paddingWidth = 100}) : super(key: key);
final int paddingWidth;
@override
State<ImagePage> createState() => _ImagePageState();
@@ -114,7 +115,7 @@ class _ImagePageState extends State<ImagePage> with WindowListener {
double dy = 0,
Function(double dx, double dy)? moveChanged,
}) {
var width = MediaQuery.of(context).size.width - 100;
var width = MediaQuery.of(context).size.width - widget.paddingWidth;
if (!show || imageFile == null) {
return const SizedBox();
}