Improve autocomplete options height on mobile (#5709)

This commit is contained in:
Clément Pasteau
2023-10-03 16:27:12 +02:00
committed by GitHub
parent 6180016b51
commit 6f59a3ba03
2 changed files with 15 additions and 1 deletions

View File

@@ -31,6 +31,7 @@ import { type ResourceManagementProps } from '../ResourcesList/ResourceSource';
import { type HotReloadPreviewButtonProps } from '../HotReload/HotReloadPreviewButton';
import PublicGameProperties from '../GameDashboard/PublicGameProperties';
import PreviewIcon from '../UI/CustomSvgIcons/Preview';
import { useResponsiveWindowWidth } from '../UI/Reponsive/ResponsiveWindowMeasurer';
type Props = {|
project: gdProject,
@@ -210,6 +211,9 @@ const ProjectPropertiesDialog = (props: Props) => {
setUseDeprecatedZeroAsDefaultZOrder,
] = React.useState(initialProperties.useDeprecatedZeroAsDefaultZOrder);
const windowWidth = useResponsiveWindowWidth();
const isMobile = windowWidth === 'small';
const defaultPackageName = 'com.example.mygame';
const defaultVersion = '1.0.0';
@@ -302,7 +306,13 @@ const ProjectPropertiesDialog = (props: Props) => {
<FlatButton
key="hot-reload-preview-button"
leftIcon={<PreviewIcon />}
label={<Trans>Run a preview (with loading & branding)</Trans>}
label={
isMobile ? (
<Trans>Preview</Trans>
) : (
<Trans>Run a preview (with loading & branding)</Trans>
)
}
onClick={
hotReloadPreviewButtonProps.launchProjectWithLoadingScreenPreview
}

View File

@@ -300,6 +300,10 @@ export function getMuiOverrides({
paper: {
backgroundColor: alternateCanvasBackgroundColor,
},
option: {
// Avoid the default min-height of 48px, which is too big to display options.
minHeight: 35,
},
},
};
}