@@ -21,6 +21,7 @@ import {
2121 // SwipeableDrawer,
2222 // type SwipeableDrawerProps,
2323 Toolbar ,
24+ Typography ,
2425} from '@suid/material' ;
2526import type { DrawerProps } from '@suid/material/Drawer' ;
2627import type { SelectChangeEvent } from '@suid/material/Select' ;
@@ -30,7 +31,7 @@ import { type Accessor, createMemo, For, type JSX, Show } from 'solid-js';
3031import ListSwitchItem from '@/components/list/ListSwitchItem' ;
3132import ToolbarTitle from '@/components/toolbar/ToolbarTitle' ;
3233import { useInsets } from '@/features/insets/contexts/InsetsContext' ;
33- import { getAvailablePageSizes } from '@/features/print/utils/paperSize' ;
34+ import { getAvailablePageSizes , pageSizeNameToCm } from '@/features/print/utils/paperSize' ;
3435import { type SyncStateOptions , syncState } from '@/hooks/syncState' ;
3536import { usePreferredDarkMode } from '@/hooks/usePreferredDarkMode' ;
3637import { maybeAndroid } from '@/utils/platform' ;
@@ -209,7 +210,26 @@ export default function AdjustSheets(props: AdjustSheetsProps) {
209210 value = { typeof config . print . size === 'string' ? config . print . size : 'custom' }
210211 onChange = { handlePageSizeChange }
211212 >
212- < For each = { getAvailablePageSizes ( ) } > { ( size ) => < MenuItem value = { size } > { size } </ MenuItem > } </ For >
213+ < For each = { getAvailablePageSizes ( ) } >
214+ { ( size ) => {
215+ const [ widthCm , heightCm ] = pageSizeNameToCm ( size ) ;
216+ return (
217+ < MenuItem value = { size } sx = { { alignItems : 'baseline' } } >
218+ < span > { size } </ span >
219+ < Typography
220+ variant = "body2"
221+ color = "textSecondary"
222+ component = "span"
223+ sx = { {
224+ marginLeft : 0.5 ,
225+ } }
226+ >
227+ { `(${ widthCm } cm x ${ heightCm } cm)` }
228+ </ Typography >
229+ </ MenuItem >
230+ ) ;
231+ } }
232+ </ For >
213233 </ Select >
214234 < FormHelperText id = "adjust-panel__size__helper" >
215235 您可能需要在“打印”窗口中同时更改“纸张尺寸”才能正确打印。
0 commit comments