diff --git a/lib/view/page/server/tab/content.dart b/lib/view/page/server/tab/content.dart index c12e4d04..8b3689fd 100644 --- a/lib/view/page/server/tab/content.dart +++ b/lib/view/page/server/tab/content.dart @@ -11,19 +11,7 @@ extension on _ServerPageState { builder: (_, cons) { return ConstrainedBox( constraints: BoxConstraints(maxWidth: cons.maxWidth / 2.3), - child: Hero( - tag: 'home_card_title_${s.spi.id}', - transitionOnUserGestures: true, - child: Material( - color: Colors.transparent, - child: Text( - s.spi.name, - style: UIs.text13Bold.copyWith(color: context.isDark ? Colors.white : Colors.black), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ), - ), - ), + child: Text(s.spi.name, style: UIs.text13Bold, maxLines: 1, overflow: TextOverflow.ellipsis), ); }, ), @@ -38,17 +26,9 @@ extension on _ServerPageState { Widget _buildTopRightWidget(Server s) { final (child, onTap) = switch (s.conn) { - ServerConn.connecting || ServerConn.loading || ServerConn.connected => ( - SizedBox( - width: 19, - height: 19, - child: CircularProgressIndicator( - strokeWidth: 3, - valueColor: AlwaysStoppedAnimation(UIs.primaryColor), - ), - ), - null, - ), + ServerConn.connecting || + ServerConn.loading || + ServerConn.connected => (SizedLoading(23, strokeWidth: 3, padding: 5), null), ServerConn.failed => ( const Icon(Icons.refresh, size: 21, color: Colors.grey), () { diff --git a/lib/view/page/server/tab/tab.dart b/lib/view/page/server/tab/tab.dart index 744fba58..5d187cfa 100644 --- a/lib/view/page/server/tab/tab.dart +++ b/lib/view/page/server/tab/tab.dart @@ -76,7 +76,6 @@ class _ServerPageState extends State with AutomaticKeepAliveClientMi void didChangeDependencies() { super.didChangeDependencies(); _updateOffset(); - _updateTextScaler(); } @override @@ -100,14 +99,11 @@ class _ServerPageState extends State with AutomaticKeepAliveClientMi appBar: _TopBar(tags: ServerProvider.tags, onTagChanged: (p0) => _tag.value = p0, initTag: _tag.value), body: GestureDetector( behavior: HitTestBehavior.opaque, - onTap: () => _autoHideCtrl.show(), - child: ListenableBuilder( - listenable: Stores.setting.textFactor.listenable(), - builder: (_, __) { - _updateTextScaler(); - return child; - }, - ), + onTap: _autoHideCtrl.show, + child: Stores.setting.textFactor.listenable().listenVal((val) { + _updateTextScaler(val); + return child; + }), ), floatingActionButton: AutoHide( direction: AxisDirection.right, diff --git a/lib/view/page/server/tab/utils.dart b/lib/view/page/server/tab/utils.dart index 421debe6..781ecc3a 100644 --- a/lib/view/page/server/tab/utils.dart +++ b/lib/view/page/server/tab/utils.dart @@ -170,8 +170,8 @@ extension _Utils on _ServerPageState { _offset = x * r * n; } - void _updateTextScaler() { - _textFactorDouble = Stores.setting.textFactor.fetch(); + void _updateTextScaler(double val) { + _textFactorDouble = val; _textFactor = TextScaler.linear(_textFactorDouble); }