chore: adjust icon size
This commit is contained in:
parent
9da26e9ae1
commit
712dcfbf9d
@ -38,16 +38,12 @@ instance Finite CourseFavouriteToggleButton
|
||||
nullaryPathPiece ''CourseFavouriteToggleButton $ camelToPathPiece' 4
|
||||
|
||||
instance Button UniWorX CourseFavouriteToggleButton where
|
||||
btnLabel BtnCourseFavouriteToggleManual = toWidget iconCourseFavouriteManual
|
||||
btnLabel BtnCourseFavouriteToggleAutomatic = toWidget iconCourseFavouriteAutomatic
|
||||
btnLabel BtnCourseFavouriteToggleOff = [whamlet|
|
||||
$newline never
|
||||
<span .fa-stack .fa-xs>
|
||||
<i .fa-stack-1x>
|
||||
^{iconCourseFavouriteManual}
|
||||
<i .fa-stack-2x>
|
||||
^{iconCourseFavouriteOff}
|
||||
|]
|
||||
btnLabel BtnCourseFavouriteToggleManual
|
||||
= toWidget $ icon2x IconCourseFavouriteManual
|
||||
btnLabel BtnCourseFavouriteToggleAutomatic
|
||||
= toWidget $ icon2x IconCourseFavouriteAutomatic
|
||||
btnLabel BtnCourseFavouriteToggleOff
|
||||
= toWidget $ iconStacked IconCourseFavouriteManual IconCourseFavouriteOff
|
||||
|
||||
btnClasses _ = [BCIsButton, BCLink]
|
||||
|
||||
@ -324,7 +320,6 @@ getCShowR tid ssh csh = do
|
||||
mayCreateEvents <- hasWriteAccessTo $ CourseR tid ssh csh CEventsNewR
|
||||
mayEdit <- hasWriteAccessTo $ CourseR tid ssh csh CEditR
|
||||
|
||||
-- TODO use different style for button (neutral background?)
|
||||
let favouriteReason = case favouriteReason' of
|
||||
-- (reason, blacklist)
|
||||
(Just (_reason, True)) -> Nothing
|
||||
@ -347,7 +342,8 @@ getCShowR tid ssh csh = do
|
||||
$if not courseVisible && mayEdit
|
||||
\ #{iconInvisible}
|
||||
$if isJust muid
|
||||
^{favouriteToggleWgt}
|
||||
<span style="font-size: 0.25em">
|
||||
^{favouriteToggleWgt}
|
||||
|]
|
||||
|
||||
siteLayout heading $ do
|
||||
|
||||
@ -195,6 +195,25 @@ icon ic = [shamlet|
|
||||
<i .fas .fa-#{iconText ic}>
|
||||
|]
|
||||
|
||||
-- Create an icon from font-awesome without additional space at 2x size
|
||||
icon2x :: Icon -> Markup
|
||||
icon2x ic
|
||||
= [shamlet|
|
||||
$newline never
|
||||
<i .fas .fa-2x .fa-#{iconText ic}>
|
||||
|]
|
||||
|
||||
-- Stack two icons from font-awesome without additional space (both at 2x size)
|
||||
-- stacked Icons are always double size, so they are correctly aligned with those produced by 'icon2x'
|
||||
iconStacked :: Icon -> Icon -> Markup
|
||||
iconStacked ic0 ic1
|
||||
= [shamlet|
|
||||
$newline never
|
||||
<span .fa-stack style="vertical-align: top;">
|
||||
<i .fas .fa-stack-2x .fa-#{iconText ic0}>
|
||||
<i .fas .fa-stack-2x .fa-#{iconText ic1}>
|
||||
|]
|
||||
|
||||
-- Create an icon (defaults to "?") with a specified tooltip
|
||||
iconTooltip :: forall site. WidgetFor site () -> Maybe Icon -> Bool -> WidgetFor site ()
|
||||
iconTooltip tooltip mIcon isInlineTooltip = let
|
||||
|
||||
Loading…
Reference in New Issue
Block a user