mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-22 16:56:19 +01:00
(Web) Hide scrollbar in viewer
This commit is contained in:
parent
afaf432ab0
commit
ef41e4516c
1 changed files with 44 additions and 40 deletions
|
@ -226,50 +226,54 @@ class _ViewerState extends State<Viewer>
|
|||
widthFactor: 1 / _viewportFraction,
|
||||
child: NotificationListener<ScrollNotification>(
|
||||
onNotification: (notif) => _onPageContentScrolled(notif, index),
|
||||
child: SingleChildScrollView(
|
||||
controller: _pageStates[index]!.scrollController,
|
||||
physics: !_isZoomed ? null : const NeverScrollableScrollPhysics(),
|
||||
child: Stack(
|
||||
children: [
|
||||
_buildItemView(context, index),
|
||||
Visibility(
|
||||
visible: !_isZoomed,
|
||||
child: AnimatedOpacity(
|
||||
opacity: _isShowDetailPane ? 1 : 0,
|
||||
duration: k.animationDurationNormal,
|
||||
onEnd: () {
|
||||
if (!_isShowDetailPane) {
|
||||
setState(() {
|
||||
_isDetailPaneActive = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: MediaQuery.of(context).size.height),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius:
|
||||
const BorderRadius.vertical(top: Radius.circular(4)),
|
||||
),
|
||||
margin: EdgeInsets.only(top: _calcDetailPaneOffset(index)),
|
||||
// this visibility widget avoids loading the detail pane
|
||||
// until it's actually opened, otherwise swiping between
|
||||
// photos will slow down severely
|
||||
child: Visibility(
|
||||
visible: _isShowDetailPane,
|
||||
child: ViewerDetailPane(
|
||||
account: widget.account,
|
||||
file: widget.streamFiles[index],
|
||||
album: widget.album,
|
||||
onSlideshowPressed: _onSlideshowPressed,
|
||||
child: ScrollConfiguration(
|
||||
behavior: ScrollConfiguration.of(context).copyWith(scrollbars: false),
|
||||
child: SingleChildScrollView(
|
||||
controller: _pageStates[index]!.scrollController,
|
||||
physics: !_isZoomed ? null : const NeverScrollableScrollPhysics(),
|
||||
child: Stack(
|
||||
children: [
|
||||
_buildItemView(context, index),
|
||||
Visibility(
|
||||
visible: !_isZoomed,
|
||||
child: AnimatedOpacity(
|
||||
opacity: _isShowDetailPane ? 1 : 0,
|
||||
duration: k.animationDurationNormal,
|
||||
onEnd: () {
|
||||
if (!_isShowDetailPane) {
|
||||
setState(() {
|
||||
_isDetailPaneActive = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
alignment: Alignment.topLeft,
|
||||
constraints: BoxConstraints(
|
||||
minHeight: MediaQuery.of(context).size.height),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(4)),
|
||||
),
|
||||
margin:
|
||||
EdgeInsets.only(top: _calcDetailPaneOffset(index)),
|
||||
// this visibility widget avoids loading the detail pane
|
||||
// until it's actually opened, otherwise swiping between
|
||||
// photos will slow down severely
|
||||
child: Visibility(
|
||||
visible: _isShowDetailPane,
|
||||
child: ViewerDetailPane(
|
||||
account: widget.account,
|
||||
file: widget.streamFiles[index],
|
||||
album: widget.album,
|
||||
onSlideshowPressed: _onSlideshowPressed,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue