fix: the cursor will jump up when creating a new document on desktop. (#5269)

* fix: the cursor will jump up when creating a new document on desktop

* fix: the titlbar flashes when switching to another page

* fix: unit test

* fix: default font family copy
This commit is contained in:
Lucas.Xu
2024-05-06 15:50:32 +08:00
committed by GitHub
parent b2c366f6ae
commit 9f44ae959a
11 changed files with 38 additions and 23 deletions

View File

@ -89,7 +89,7 @@ class _DocumentCoverWidgetState extends State<DocumentCoverWidget> {
bool get hasIcon => viewIcon.isNotEmpty;
bool get hasCover =>
coverType != CoverType.none ||
cover?.type != PageStyleCoverImageType.none;
(cover != null && cover?.type != PageStyleCoverImageType.none);
String viewIcon = '';
PageStyleCover? cover;

View File

@ -18,7 +18,7 @@ enum OpenAIRequestType {
case OpenAIRequestType.textCompletion:
return Uri.parse('https://api.openai.com/v1/completions');
case OpenAIRequestType.textEdit:
return Uri.parse('https://api.openai.com/v1/v1/chat/completions');
return Uri.parse('https://api.openai.com/v1/chat/completions');
case OpenAIRequestType.imageGenerations:
return Uri.parse('https://api.openai.com/v1/images/generations');
}

View File

@ -163,6 +163,11 @@ class _FontButton extends StatelessWidget {
Widget build(BuildContext context) {
return BlocBuilder<DocumentPageStyleBloc, DocumentPageStyleState>(
builder: (context, state) {
String fontFamily = state.fontFamily ?? builtInFontFamily();
if (fontFamily == builtInFontFamily()) {
fontFamily =
LocaleKeys.settings_appearance_fontFamily_defaultFont.tr();
}
return GestureDetector(
onTap: () => _showFontSelector(context),
behavior: HitTestBehavior.opaque,
@ -177,7 +182,7 @@ class _FontButton extends StatelessWidget {
const HSpace(16.0),
FlowyText(LocaleKeys.titleBar_font.tr()),
const Spacer(),
FlowyText(state.fontFamily ?? builtInFontFamily()),
FlowyText(fontFamily),
const HSpace(6.0),
const FlowySvg(FlowySvgs.m_page_style_arrow_right_s),
const HSpace(12.0),