Skip to content
Snippets Groups Projects
Verified Commit 1653f73c authored by Legy (Beini)'s avatar Legy (Beini)
Browse files

Add formatting for the icon of the battery block

parent 4f6a4e25
No related branches found
No related tags found
No related merge requests found
...@@ -78,10 +78,10 @@ updateBatteryBlock _ [] = updateBlockEmpty ...@@ -78,10 +78,10 @@ updateBatteryBlock _ [] = updateBlockEmpty
updateBatteryBlock isPlugged bs = updateBlock $ (shortText.~shortText') $ mkBlockOutput fullText' updateBatteryBlock isPlugged bs = updateBlock $ (shortText.~shortText') $ mkBlockOutput fullText'
where where
fullText' :: BlockText fullText' :: BlockText
fullText' = normalText (batteryIcon <> " ") <> overallPercentage <> optionalEachBattery <> optionalOverallEstimate fullText' = overallPercentage <> optionalEachBattery <> optionalOverallEstimate
shortText' :: Maybe BlockText shortText' :: Maybe BlockText
shortText' = Just $ normalText (batteryIcon <> " ") <> overallPercentage shortText' = Just overallPercentage
batteryIcon :: T.Text batteryIcon :: T.Text
batteryIcon batteryIcon
...@@ -106,7 +106,7 @@ updateBatteryBlock isPlugged bs = updateBlock $ (shortText.~shortText') $ mkBloc ...@@ -106,7 +106,7 @@ updateBatteryBlock isPlugged bs = updateBlock $ (shortText.~shortText') $ mkBloc
perSingleBattery b = importantText (batteryImportance [b]) $ perSingleBatteryArrow b <> (formatFloatN 0 . batteryPercentage) [b] <> "%" perSingleBattery b = importantText (batteryImportance [b]) $ perSingleBatteryArrow b <> (formatFloatN 0 . batteryPercentage) [b] <> "%"
overallPercentage :: BlockText overallPercentage :: BlockText
overallPercentage = mkText (not isPlugged) (batteryImportance bs) $ (formatFloatN 0 . batteryPercentage $ bs) <> "%" overallPercentage = mkText (not isPlugged) (batteryImportance bs) $ batteryIcon <> " " <> (formatFloatN 0 . batteryPercentage $ bs) <> "%"
optionalOverallEstimate :: BlockText optionalOverallEstimate :: BlockText
optionalOverallEstimate = maybe mempty (\s -> surroundWith normalText " (" ")" s) . batteryEstimateFormated $ bs optionalOverallEstimate = maybe mempty (\s -> surroundWith normalText " (" ")" s) . batteryEstimateFormated $ bs
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment