Default multiline text to factor = 1 instead of 0.01

This commit is contained in:
Francisco Vallarino 2021-02-27 16:37:46 -03:00
parent ca881e3d0d
commit 65132dc9fe
4 changed files with 14 additions and 14 deletions

View File

@ -194,7 +194,7 @@ makeLabel config state = widget where
| otherwise = fmap sizeReqMaxBounded (style ^. L.sizeReqW)
Size w h = getTextSize_ wenv style mode trim targetW maxLines caption
defaultFactor
| mode == MultiLine = 0.01
| mode == MultiLine = 1
| otherwise = 0
factorW = fromMaybe defaultFactor (_lscFactorW config)
factorH = fromMaybe defaultFactor (_lscFactorH config)

View File

@ -528,6 +528,11 @@
- Review dialogs after change is in place
- Move SizeReq to Core
- Add concept of active layout direction (needed to have a single spacer/filler)
- Make button use label + box (way too much duplicated code)
- Add option to not use theme on label
- Follow the same ideas as on Dropdown
- Review dialogs after change is in place (button currently uses expandSize)
- Remove clearExtra from dialog buttons
- Pending
- Add header in all files, indicating license and documenting what the module does
@ -541,11 +546,6 @@ Next
- Composite example
- Validate nested structures update correctly when disabling/enabling parent
- Something of generative art (OpenGL example)
- Make button use label + box (way too much duplicated code)
- Add option to not use theme on label
- Follow the same ideas as on Dropdown
- Review dialogs after change is in place (button currently uses expandSize)
- Remove clearExtra from dialog buttons
- Make label default to clip text (currently ellipsis). Same for trim
- Think about text related combinators
- Is the Text/text prefix needed?

View File

@ -72,8 +72,8 @@ getSizeReq = describe "getSizeReq" $ do
it "should return width = Fixed 50" $
sizeReqW3 `shouldBe` fixedSize 50
it "should return height = Flex 60 0.01" $
sizeReqH3 `shouldBe` expandSize 60 0.01
it "should return height = Flex 60 1" $
sizeReqH3 `shouldBe` expandSize 60 1
where
wenv = mockWenv ()

View File

@ -51,8 +51,8 @@ getSizeReqMulti = describe "getSizeReq" $ do
it "should return width = Fixed 50" $
sizeReqW `shouldBe` fixedSize 50
it "should return height = Flex 60 0.01" $
sizeReqH `shouldBe` expandSize 60 0.01
it "should return height = Flex 60 1" $
sizeReqH `shouldBe` expandSize 60 1
where
wenv = mockWenv ()
@ -64,8 +64,8 @@ getSizeReqMultiKeepSpaces = describe "getSizeReq" $ do
it "should return width = Max 50 1" $
sizeReqW `shouldBe` maxSize 50 1
it "should return height = Flex 100 0.01" $
sizeReqH `shouldBe` expandSize 100 0.01
it "should return height = Flex 100 1" $
sizeReqH `shouldBe` expandSize 100 1
where
wenv = mockWenv ()
@ -78,8 +78,8 @@ getSizeReqMultiMaxLines = describe "getSizeReq" $ do
it "should return width = Max 50 1" $
sizeReqW `shouldBe` maxSize 50 1
it "should return height = Flex 80 0.01" $
sizeReqH `shouldBe` expandSize 80 0.01
it "should return height = Flex 80 1" $
sizeReqH `shouldBe` expandSize 80 1
where
wenv = mockWenv ()