chore: update tabbar icon (#5921)

This commit is contained in:
Nathan.fooo 2024-08-10 21:06:54 +08:00 committed by GitHub
parent e2a923a796
commit e87ade6b3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,8 +3,10 @@ import 'package:appflowy/workspace/application/tabs/tabs_bloc.dart';
import 'package:appflowy/workspace/presentation/home/home_sizes.dart';
import 'package:appflowy/workspace/presentation/home/home_stack.dart';
import 'package:flowy_infra/theme_extension.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
import 'package:flowy_infra_ui/style_widget/icon_button.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:provider/provider.dart';
class FlowyTab extends StatefulWidget {
@ -26,22 +28,20 @@ class _FlowyTabState extends State<FlowyTab> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTertiaryTapUp: _closeTab,
child: MouseRegion(
onEnter: (_) => _setHovering(true),
onExit: (_) => _setHovering(),
child: Container(
width: HomeSizes.tabBarWidth,
height: HomeSizes.tabBarHeight,
decoration: BoxDecoration(
color: _getBackgroundColor(),
),
child: ChangeNotifierProvider.value(
value: widget.pageManager.notifier,
child: Consumer<PageNotifier>(
builder: (context, value, child) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
return FlowyHover(
style: HoverStyle(
borderRadius: BorderRadius.zero,
backgroundColor: _getBackgroundColor(),
),
builder: (context, onHover) {
return ChangeNotifierProvider.value(
value: widget.pageManager.notifier,
child: Consumer<PageNotifier>(
builder: (context, value, child) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0),
child: SizedBox(
width: HomeSizes.tabBarWidth,
height: HomeSizes.tabBarHeight,
child: Row(
children: [
Expanded(
@ -49,15 +49,16 @@ class _FlowyTabState extends State<FlowyTab> {
.tabBarWidget(widget.pageManager.plugin.id),
),
Visibility(
visible: _isHovering,
child: FlowyIconButton(
onPressed: _closeTab,
hoverColor: Theme.of(context).hoverColor,
iconColorOnHover:
Theme.of(context).colorScheme.onSurface,
icon: const FlowySvg(
FlowySvgs.close_s,
size: Size.fromWidth(16),
visible: onHover,
child: SizedBox(
width: 26,
height: 26,
child: FlowyIconButton(
onPressed: _closeTab,
icon: const FlowySvg(
FlowySvgs.close_s,
size: Size.square(22),
),
),
),
),
@ -66,8 +67,8 @@ class _FlowyTabState extends State<FlowyTab> {
),
),
),
),
),
);
},
);
}