refactor(ui): improve ComboBox layout in settings views #4222

* Wrapped `ComboBox` in a `SizedBox` to set a fixed width for better UI consistency.
* Enhanced readability and maintainability of the code structure.
This commit is contained in:
qianlifeng 2025-07-13 20:43:31 +08:00
parent 4a87001625
commit 282745707c
2 changed files with 44 additions and 38 deletions

View File

@ -118,7 +118,9 @@ class WoxSettingGeneralView extends WoxSettingBaseView {
label: controller.tr("ui_last_query_mode"), label: controller.tr("ui_last_query_mode"),
tips: controller.tr("ui_last_query_mode_tips"), tips: controller.tr("ui_last_query_mode_tips"),
child: Obx(() { child: Obx(() {
return ComboBox<String>( return SizedBox(
width: 250,
child: ComboBox<String>(
items: [ items: [
ComboBoxItem( ComboBoxItem(
value: WoxLastQueryModeEnum.WOX_LAST_QUERY_MODE_PRESERVE.code, value: WoxLastQueryModeEnum.WOX_LAST_QUERY_MODE_PRESERVE.code,
@ -135,6 +137,7 @@ class WoxSettingGeneralView extends WoxSettingBaseView {
controller.updateConfig("LastQueryMode", v); controller.updateConfig("LastQueryMode", v);
} }
}, },
),
); );
}), }),
), ),

View File

@ -13,7 +13,9 @@ class WoxSettingUIView extends WoxSettingBaseView {
label: controller.tr("ui_show_position"), label: controller.tr("ui_show_position"),
tips: controller.tr("ui_show_position_tips"), tips: controller.tr("ui_show_position_tips"),
child: Obx(() { child: Obx(() {
return ComboBox<String>( return SizedBox(
width: 200,
child: ComboBox<String>(
items: [ items: [
ComboBoxItem( ComboBoxItem(
value: "mouse_screen", value: "mouse_screen",
@ -34,6 +36,7 @@ class WoxSettingUIView extends WoxSettingBaseView {
controller.updateConfig("ShowPosition", v); controller.updateConfig("ShowPosition", v);
} }
}, },
),
); );
}), }),
), ),