mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: ai writer generate button color (#6035)
* fix: ai writer generate button color * fix: replace ai writer button with outlined rounded button
This commit is contained in:
parent
190e3bedda
commit
c371c6cd63
@ -140,9 +140,12 @@ class _AutoCompletionBlockComponentState
|
||||
if (PlatformExtension.isMobile) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return Card(
|
||||
|
||||
final child = Card(
|
||||
elevation: 5,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(10),
|
||||
@ -169,6 +172,11 @@ class _AutoCompletionBlockComponentState
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(left: 40),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInputWidget(BuildContext context) {
|
||||
@ -474,16 +482,23 @@ class AutoCompletionInputFooter extends StatelessWidget {
|
||||
return Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
FlowyTextButton.primary(
|
||||
PrimaryRoundedButton(
|
||||
text: LocaleKeys.button_generate.tr(),
|
||||
context: context,
|
||||
onPressed: onGenerate,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
radius: 8.0,
|
||||
onTap: onGenerate,
|
||||
),
|
||||
const Space(10, 0),
|
||||
FlowyTextButton.secondary(
|
||||
OutlinedRoundedButton(
|
||||
text: LocaleKeys.button_cancel.tr(),
|
||||
context: context,
|
||||
onPressed: onExit,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0,
|
||||
vertical: 10.0,
|
||||
),
|
||||
onTap: onExit,
|
||||
),
|
||||
Flexible(
|
||||
child: Container(
|
||||
@ -517,22 +532,23 @@ class AutoCompletionFooter extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
children: [
|
||||
FlowyTextButton.primary(
|
||||
context: context,
|
||||
PrimaryRoundedButton(
|
||||
text: LocaleKeys.button_keep.tr(),
|
||||
onPressed: onKeep,
|
||||
margin: const EdgeInsets.symmetric(
|
||||
horizontal: 16.0,
|
||||
vertical: 9.0,
|
||||
),
|
||||
onTap: onKeep,
|
||||
),
|
||||
const Space(10, 0),
|
||||
FlowyTextButton.secondary(
|
||||
context: context,
|
||||
const HSpace(10),
|
||||
OutlinedRoundedButton(
|
||||
text: LocaleKeys.document_plugins_autoGeneratorRewrite.tr(),
|
||||
onPressed: onRewrite,
|
||||
onTap: onRewrite,
|
||||
),
|
||||
const Space(10, 0),
|
||||
FlowyTextButton.secondary(
|
||||
context: context,
|
||||
const HSpace(10),
|
||||
OutlinedRoundedButton(
|
||||
text: LocaleKeys.button_discard.tr(),
|
||||
onPressed: onDiscard,
|
||||
onTap: onDiscard,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -185,22 +185,9 @@ class SpaceCancelOrConfirmButton extends StatelessWidget {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: const BorderSide(color: Color(0x1E14171B)),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: FlowyButton(
|
||||
useIntrinsicWidth: true,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 9.0),
|
||||
text: FlowyText.regular(
|
||||
LocaleKeys.button_cancel.tr(),
|
||||
lineHeight: 1.0,
|
||||
),
|
||||
onTap: onCancel,
|
||||
),
|
||||
OutlinedRoundedButton(
|
||||
text: LocaleKeys.button_cancel.tr(),
|
||||
onTap: onCancel,
|
||||
),
|
||||
const HSpace(12.0),
|
||||
DecoratedBox(
|
||||
@ -244,24 +231,11 @@ class SpaceOkButton extends StatelessWidget {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
color: confirmButtonColor ?? Theme.of(context).colorScheme.primary,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: FlowyButton(
|
||||
useIntrinsicWidth: true,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 9.0),
|
||||
radius: BorderRadius.circular(8),
|
||||
text: FlowyText.regular(
|
||||
confirmButtonName,
|
||||
lineHeight: 1.0,
|
||||
color: Colors.white,
|
||||
),
|
||||
onTap: onConfirm,
|
||||
),
|
||||
PrimaryRoundedButton(
|
||||
text: confirmButtonName,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 9.0),
|
||||
radius: 8.0,
|
||||
onTap: onConfirm,
|
||||
),
|
||||
],
|
||||
);
|
||||
|
@ -133,17 +133,17 @@ class _WorkspaceMoreActionWrapper extends CustomActionCell {
|
||||
},
|
||||
).show(context);
|
||||
case WorkspaceMoreAction.leave:
|
||||
await showDialog(
|
||||
await showConfirmDialog(
|
||||
context: context,
|
||||
builder: (_) => NavigatorOkCancelDialog(
|
||||
message: LocaleKeys.workspace_leaveCurrentWorkspacePrompt.tr(),
|
||||
onOkPressed: () {
|
||||
workspaceBloc.add(
|
||||
UserWorkspaceEvent.leaveWorkspace(workspace.workspaceId),
|
||||
);
|
||||
},
|
||||
okTitle: LocaleKeys.button_yes.tr(),
|
||||
),
|
||||
title: LocaleKeys.workspace_leaveCurrentWorkspace.tr(),
|
||||
description:
|
||||
LocaleKeys.workspace_leaveCurrentWorkspacePrompt.tr(),
|
||||
confirmLabel: LocaleKeys.button_yes.tr(),
|
||||
onConfirm: () {
|
||||
workspaceBloc.add(
|
||||
UserWorkspaceEvent.leaveWorkspace(workspace.workspaceId),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
},
|
||||
@ -175,7 +175,7 @@ class _WorkspaceMoreActionWrapper extends CustomActionCell {
|
||||
case WorkspaceMoreAction.leave:
|
||||
return FlowySvg(
|
||||
FlowySvgs.logout_s,
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
color: onHover ? Theme.of(context).colorScheme.error : null,
|
||||
);
|
||||
case WorkspaceMoreAction.divider:
|
||||
return const SizedBox.shrink();
|
||||
|
@ -128,6 +128,10 @@ class SingleSettingAction extends StatelessWidget {
|
||||
}
|
||||
|
||||
Color? hoverColor(BuildContext context) {
|
||||
if (buttonType.isDangerous) {
|
||||
return Theme.of(context).colorScheme.error.withOpacity(0.1);
|
||||
}
|
||||
|
||||
if (buttonType.isPrimary) {
|
||||
return Theme.of(context).colorScheme.primary.withOpacity(0.9);
|
||||
}
|
||||
|
@ -263,8 +263,7 @@ class FlowyButton extends StatelessWidget {
|
||||
(Platform.isIOS || Platform.isAndroid)
|
||||
? BoxDecoration(
|
||||
border: Border.all(
|
||||
color: borderColor ??
|
||||
Theme.of(context).colorScheme.outline,
|
||||
color: borderColor ?? Theme.of(context).colorScheme.outline,
|
||||
width: 1.0,
|
||||
),
|
||||
borderRadius: radius,
|
||||
|
@ -54,3 +54,46 @@ class PrimaryRoundedButton extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class OutlinedRoundedButton extends StatelessWidget {
|
||||
const OutlinedRoundedButton({
|
||||
super.key,
|
||||
required this.text,
|
||||
this.onTap,
|
||||
this.margin,
|
||||
this.radius,
|
||||
});
|
||||
|
||||
final String text;
|
||||
final VoidCallback? onTap;
|
||||
final EdgeInsets? margin;
|
||||
final double? radius;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
shape: RoundedRectangleBorder(
|
||||
side: Theme.of(context).brightness == Brightness.light
|
||||
? const BorderSide(color: Color(0x1E14171B))
|
||||
: const BorderSide(color: Colors.white10),
|
||||
borderRadius: BorderRadius.circular(radius ?? 8),
|
||||
),
|
||||
),
|
||||
child: FlowyButton(
|
||||
useIntrinsicWidth: true,
|
||||
margin: margin ??
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: 16.0,
|
||||
vertical: 9.0,
|
||||
),
|
||||
radius: BorderRadius.circular(radius ?? 8),
|
||||
text: FlowyText.regular(
|
||||
text,
|
||||
lineHeight: 1.0,
|
||||
),
|
||||
onTap: onTap,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user