mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
fix: library filter, sort and display menus aren't cut off in portrait (#1827)
* fix: library menus open toward the side with room, so in portrait they are no longer cut off In portrait the Filter, Sort, Display and Collections buttons sit at the left of the screen, but their menus still grew to the left and were squeezed into the space before the button, cutting the labels. A menu now opens the other way when its own side is narrower than the menu and the other side has more room. * fix: step-out menus keep their outline with the content when a resize flips the side * fix: step-out menus still take keyboard focus when the layout shifts while opening
This commit is contained in:
1 parent
2ff682a4f5
commit
0b1af34a5f
4 files changed
+62
-15
No files matched your search
@@ -37,6 +37,34 @@ class StepOutTest {
|
||||
assertEquals(300f, b.bottom, 0.5f)
|
||||
}
|
||||
|
||||
@Test fun aLeftMenuWithRoomStaysLeft() {
|
||||
assertEquals(StepSide.Left, fitStepSide(StepSide.Left, Rect(1900f, 20f, 1980f, 80f), hostWidth = 2400f, wanted = 840f))
|
||||
}
|
||||
|
||||
@Test fun aLeftMenuNearTheLeftEdgeOpensRight() {
|
||||
assertEquals(StepSide.Right, fitStepSide(StepSide.Left, Rect(300f, 20f, 420f, 80f), hostWidth = 1080f, wanted = 840f))
|
||||
}
|
||||
|
||||
@Test fun aRightMenuNearTheRightEdgeOpensLeft() {
|
||||
assertEquals(StepSide.Left, fitStepSide(StepSide.Right, Rect(900f, 20f, 1000f, 80f), hostWidth = 1080f, wanted = 840f))
|
||||
}
|
||||
|
||||
@Test fun aSqueezedMenuKeepsItsSideWhenTheOtherSideIsNarrower() {
|
||||
assertEquals(StepSide.Left, fitStepSide(StepSide.Left, Rect(600f, 20f, 700f, 80f), hostWidth = 1080f, wanted = 840f))
|
||||
}
|
||||
|
||||
@Test fun theOutlineReachFollowsTheChosenSide() {
|
||||
val wide = Rect(600f, 20f, 700f, 80f)
|
||||
assertEquals(600f to 300f, stepReach(StepSide.Left, wide, hostWidth = 1080f, width = 400))
|
||||
assertEquals(700f to 1000f, stepReach(StepSide.Right, wide, hostWidth = 1080f, width = 400))
|
||||
}
|
||||
|
||||
@Test fun theOutlineReachStaysInsideTheHost() {
|
||||
val near = Rect(100f, 20f, 200f, 80f)
|
||||
assertEquals(100f to 0f, stepReach(StepSide.Left, near, hostWidth = 1080f, width = 400))
|
||||
assertEquals(200f to 1080f, stepReach(StepSide.Right, near, hostWidth = 1080f, width = 1200))
|
||||
}
|
||||
|
||||
@Test fun aClosedOutlineIsJustThePill() {
|
||||
val path = Path()
|
||||
stepPathRight(path, pill, right = pill.right, bottom = pill.bottom, pullTop = pill.bottom + 6f, box = 16f, fillet = 10f, pillCorner = 12f)
|
||||
|
||||
Reference in new issue
Block a user