Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -153,23 +153,32 @@ class _ResetButton extends StatelessWidget {
behavior: HitTestBehavior.translucent,
onTap: onReset,
child: FlowyHover(
child: Padding(
resetHoverOnRebuild: false,
style: HoverStyle(
hoverColor: Theme.of(context).colorScheme.secondaryContainer,
),
builder: (context, isHovering) => Padding(
padding: const EdgeInsets.symmetric(
vertical: 4.0,
horizontal: 6,
),
child: Row(
children: [
const FlowySvg(
FlowySvg(
FlowySvgs.restore_s,
size: Size.square(20),
size: const Size.square(20),
color: isHovering
? Theme.of(context).iconTheme.color
: AFThemeExtension.of(context).onBackground,
),
const HSpace(6),
SizedBox(
height: 16,
child: FlowyText.regular(
LocaleKeys.settings_shortcutsPage_actions_resetDefault.tr(),
color: AFThemeExtension.of(context).strongText,
color: isHovering
? AFThemeExtension.of(context).strongText
: AFThemeExtension.of(context).onBackground,
),
),
],
Expand Down Expand Up @@ -325,6 +334,7 @@ class _ShortcutSettingTileState extends State<ShortcutSettingTile> {
builder: (context, isHovering) => Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const HSpace(8),
Expanded(
Expand All @@ -339,11 +349,9 @@ class _ShortcutSettingTileState extends State<ShortcutSettingTile> {
),
),
),
Expanded(
child: isEditing
? _renderKeybindEditor()
: _renderKeybindings(isHovering),
),
isEditing
? _renderKeybindEditor()
: _renderKeybindings(isHovering),
],
),
),
Expand All @@ -352,6 +360,7 @@ class _ShortcutSettingTileState extends State<ShortcutSettingTile> {
}

Widget _renderKeybindings(bool isHovering) => Row(
mainAxisSize: MainAxisSize.min,
children: [
if (widget.command.keybindings.isNotEmpty) ...[
..._toParts(widget.command.keybindings.first).map(
Expand All @@ -360,8 +369,8 @@ class _ShortcutSettingTileState extends State<ShortcutSettingTile> {
] else ...[
const SizedBox(height: 24),
],
const Spacer(),
if (isHovering)
if (isHovering) ...[
const HSpace(8),
GestureDetector(
onTap: () {
if (widget.canStartEditing()) {
Expand All @@ -382,7 +391,7 @@ class _ShortcutSettingTileState extends State<ShortcutSettingTile> {
),
),
),
const HSpace(8),
],
],
);

Expand Down