Fix landscape reader layout and wrap long settings labels (#640)

* fix: handle mobile landscape safe area #604

* fix: adjust reader toolbars safe area

* fix: adjust multi-image reader layout after orientation change

* fix: item titles not fully displayed
This commit is contained in:
boa
2025-11-29 14:19:43 +08:00
committed by GitHub
parent 7e928d2c9c
commit b9c06779ad
4 changed files with 75 additions and 42 deletions

View File

@@ -172,6 +172,16 @@ class NaviPaneState extends State<NaviPane>
@override
Widget build(BuildContext context) {
onRebuild(context);
final mq = MediaQuery.of(context);
final sideInsets =
(App.isMobile && mq.orientation == Orientation.landscape)
? EdgeInsets.only(
left: math.max(
mq.viewPadding.left, mq.systemGestureInsets.left),
right: math.max(
mq.viewPadding.right, mq.systemGestureInsets.right),
)
: EdgeInsets.zero;
return _NaviPopScope(
action: () {
if (App.mainNavigatorKey!.currentState!.canPop()) {
@@ -185,7 +195,7 @@ class NaviPaneState extends State<NaviPane>
animation: controller,
builder: (context, child) {
final value = controller.value;
return Stack(
Widget content = Stack(
children: [
Positioned(
left: _kFoldedSideBarWidth * ((value - 2.0).clamp(-1.0, 0.0)),
@@ -202,6 +212,13 @@ class NaviPaneState extends State<NaviPane>
),
],
);
if (sideInsets != EdgeInsets.zero) {
content = Padding(
padding: sideInsets,
child: content,
);
}
return content;
},
),
);