diff --git a/README.md b/README.md index d27ff518..f5c6ba7a 100644 --- a/README.md +++ b/README.md @@ -535,7 +535,7 @@ ColorPickerDialog( ) ``` -Color picker dialog +![Color picker dialog](docs/images/dialog.png) Switching space redraws the color without converting it. Confirming returns exactly the initial value if nothing was edited, or if the original half of the swatch was pressed to restore it, so an diff --git a/docs/images/dialog.png b/docs/images/dialog.png index eeb8deea..1a678fc2 100644 Binary files a/docs/images/dialog.png and b/docs/images/dialog.png differ diff --git a/docs/index.md b/docs/index.md index 5b035563..67cae638 100644 --- a/docs/index.md +++ b/docs/index.md @@ -535,7 +535,7 @@ ColorPickerDialog( ) ``` -Color picker dialog +![Color picker dialog](images/dialog.png) Switching space redraws the color without converting it. Confirming returns exactly the initial value if nothing was edited, or if the original half of the swatch was pressed to restore it, so an diff --git a/screenshot-tests/src/screenshotTest/kotlin/codes/side/colorpicker/screenshot/ColorPickerPreviews.kt b/screenshot-tests/src/screenshotTest/kotlin/codes/side/colorpicker/screenshot/ColorPickerPreviews.kt index e8e783ac..3d3c07e0 100644 --- a/screenshot-tests/src/screenshotTest/kotlin/codes/side/colorpicker/screenshot/ColorPickerPreviews.kt +++ b/screenshot-tests/src/screenshotTest/kotlin/codes/side/colorpicker/screenshot/ColorPickerPreviews.kt @@ -14,6 +14,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface @@ -299,17 +300,18 @@ fun OkhsvPlanePreview() = Frame { ChannelSlider(state, Okhsv.H) } -// A phone's dialog window keeps the dialog clear of the screen's edges. The preview's window runs edge to edge, so -// the margin is given here. +// The dialog at a phone's width, a 440 dp screen less the margins its dialog window keeps, on a canvas in the landscape +// screenshot's proportions, so the README shows the two at one size. Left to itself on a canvas this wide, the dialog +// would take Material's widest, 560 dp. @PreviewTest -@Preview(name = "Dialog", widthDp = 440, heightDp = 960) +@Preview(name = "Dialog", widthDp = 2048, heightDp = 960) @Composable fun DialogPreview() = Frame { ColorPickerDialog( initialValue = FuchsiaRose.withAlpha(0.8), onValueSelected = {}, onDismissRequest = {}, - modifier = Modifier.padding(horizontal = 24.dp), + modifier = Modifier.width(392.dp), initialSpace = Okhsl, ) } diff --git a/screenshot-tests/src/screenshotTestDebug/reference/codes/side/colorpicker/screenshot/ColorPickerPreviewsKt/DialogPreview_Dialog_142ce3f5_0.png b/screenshot-tests/src/screenshotTestDebug/reference/codes/side/colorpicker/screenshot/ColorPickerPreviewsKt/DialogPreview_Dialog_142ce3f5_0.png deleted file mode 100644 index eeb8deea..00000000 Binary files a/screenshot-tests/src/screenshotTestDebug/reference/codes/side/colorpicker/screenshot/ColorPickerPreviewsKt/DialogPreview_Dialog_142ce3f5_0.png and /dev/null differ diff --git a/screenshot-tests/src/screenshotTestDebug/reference/codes/side/colorpicker/screenshot/ColorPickerPreviewsKt/DialogPreview_Dialog_61d2e655_0.png b/screenshot-tests/src/screenshotTestDebug/reference/codes/side/colorpicker/screenshot/ColorPickerPreviewsKt/DialogPreview_Dialog_61d2e655_0.png new file mode 100644 index 00000000..1a678fc2 Binary files /dev/null and b/screenshot-tests/src/screenshotTestDebug/reference/codes/side/colorpicker/screenshot/ColorPickerPreviewsKt/DialogPreview_Dialog_61d2e655_0.png differ