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