Skip to content

Commit

Permalink
fix: windows 搜索框过长
Browse files Browse the repository at this point in the history
  • Loading branch information
MiaoMint committed Jul 20, 2023
1 parent 2c8ae7c commit 70d4da7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 49 deletions.
4 changes: 3 additions & 1 deletion lib/pages/search/pages/search_extension.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ class _SearchExtensionPageState extends fluent.State<SearchExtensionPage> {
style: fluent.FluentTheme.of(context).typography.subtitle,
),
),
Expanded(
const Spacer(),
SizedBox(
width: 300,
child: fluent.TextBox(
controller: TextEditingController(
text: _keyWord,
Expand Down
101 changes: 54 additions & 47 deletions lib/pages/search/view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,54 +168,61 @@ class _SearchPageState extends State<SearchPage> {
height: 30,
child: Row(
children: [
fluent.ToggleButton(
checked: c.cuurentExtensionType.value == null,
onChanged: (value) {
if (value) {
c.getRuntime();
}
},
child: Row(
children: [
Text("search.all".i18n),
],
),
),
const SizedBox(width: 8),
fluent.ToggleButton(
checked: c.cuurentExtensionType.value ==
ExtensionType.bangumi,
onChanged: (value) {
if (value) {
c.getRuntime(type: ExtensionType.bangumi);
}
},
child: Text('extension-type.video'.i18n),
),
const SizedBox(width: 8),
fluent.ToggleButton(
checked:
c.cuurentExtensionType.value == ExtensionType.manga,
onChanged: (value) {
if (value) {
c.getRuntime(type: ExtensionType.manga);
}
},
child: Text('extension-type.comic'.i18n),
),
const SizedBox(width: 8),
fluent.ToggleButton(
checked: c.cuurentExtensionType.value ==
ExtensionType.fikushon,
onChanged: (value) {
if (value) {
c.getRuntime(type: ExtensionType.fikushon);
}
},
child: Text('extension-type.novel'.i18n),
),
const Spacer(),
Expanded(
child: ListView(
scrollDirection: Axis.horizontal,
children: [
fluent.ToggleButton(
checked: c.cuurentExtensionType.value == null,
onChanged: (value) {
if (value) {
c.getRuntime();
}
},
child: Row(
children: [
Text("search.all".i18n),
],
),
),
const SizedBox(width: 8),
fluent.ToggleButton(
checked: c.cuurentExtensionType.value ==
ExtensionType.bangumi,
onChanged: (value) {
if (value) {
c.getRuntime(type: ExtensionType.bangumi);
}
},
child: Text('extension-type.video'.i18n),
),
const SizedBox(width: 8),
fluent.ToggleButton(
checked: c.cuurentExtensionType.value ==
ExtensionType.manga,
onChanged: (value) {
if (value) {
c.getRuntime(type: ExtensionType.manga);
}
},
child: Text('extension-type.comic'.i18n),
),
const SizedBox(width: 8),
fluent.ToggleButton(
checked: c.cuurentExtensionType.value ==
ExtensionType.fikushon,
onChanged: (value) {
if (value) {
c.getRuntime(type: ExtensionType.fikushon);
}
},
child: Text('extension-type.novel'.i18n),
),
],
)),
const SizedBox(width: 16),
SizedBox(
width: 300,
child: fluent.TextBox(
controller:
TextEditingController(text: c.search.value),
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/search/widgets/search_all_tile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class _SearchAllTileState extends State<SearchAllTile> {
itemBuilder: (context, index) {
return Container(
width: 170,
margin: const EdgeInsets.symmetric(horizontal: 8),
margin: const EdgeInsets.only(right: 8),
child: ExtensionItemCard(
key: ValueKey(data[index].url),
title: data[index].title,
Expand Down

0 comments on commit 70d4da7

Please sign in to comment.