Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data InternalTheme = InternalTheme {}
- defaultTheme :: InternalTheme
- internalThemes :: [InternalTheme]
- lookupTheme :: Text -> Maybe InternalTheme
- themeDocs :: ThemeDocumentation
- currentUserAttr :: AttrName
- timeAttr :: AttrName
- verbatimTruncateMessageAttr :: AttrName
- channelHeaderAttr :: AttrName
- channelListHeaderAttr :: AttrName
- currentChannelNameAttr :: AttrName
- unreadChannelAttr :: AttrName
- unreadGroupMarkerAttr :: AttrName
- mentionsChannelAttr :: AttrName
- currentTeamAttr :: AttrName
- urlAttr :: AttrName
- codeAttr :: AttrName
- emailAttr :: AttrName
- emojiAttr :: AttrName
- reactionAttr :: AttrName
- myReactionAttr :: AttrName
- channelNameAttr :: AttrName
- clientMessageAttr :: AttrName
- clientHeaderAttr :: AttrName
- strikeThroughAttr :: AttrName
- clientEmphAttr :: AttrName
- clientStrongAttr :: AttrName
- dateTransitionAttr :: AttrName
- pinnedMessageIndicatorAttr :: AttrName
- newMessageTransitionAttr :: AttrName
- gapMessageAttr :: AttrName
- errorMessageAttr :: AttrName
- helpAttr :: AttrName
- helpEmphAttr :: AttrName
- helpKeyEventAttr :: AttrName
- channelSelectPromptAttr :: AttrName
- channelSelectMatchAttr :: AttrName
- completionAlternativeListAttr :: AttrName
- completionAlternativeCurrentAttr :: AttrName
- permalinkAttr :: AttrName
- dialogAttr :: AttrName
- dialogEmphAttr :: AttrName
- recentMarkerAttr :: AttrName
- replyParentAttr :: AttrName
- loadMoreAttr :: AttrName
- urlListSelectedAttr :: AttrName
- messageSelectAttr :: AttrName
- messageSelectStatusAttr :: AttrName
- urlSelectStatusAttr :: AttrName
- misspellingAttr :: AttrName
- editedMarkingAttr :: AttrName
- editedRecentlyMarkingAttr :: AttrName
- tabSelectedAttr :: AttrName
- tabUnselectedAttr :: AttrName
- buttonAttr :: AttrName
- buttonFocusedAttr :: AttrName
- threadAttr :: AttrName
- focusedEditorPromptAttr :: AttrName
- colorUsername :: Text -> Text -> Text -> Widget a
- attrForUsername :: Text -> AttrName
- usernameColorHashBuckets :: Int
Documentation
data InternalTheme Source #
lookupTheme :: Text -> Maybe InternalTheme Source #
Attribute names
Username formatting
:: Text | The username for the user currently running Matterhorn |
-> Text | The username associated with the text to render |
-> Text | The text to render |
-> Widget a |
Render a string with a color chosen based on the text of a username.
This function takes some display text and renders it using an
attribute based on the username associated with the text. If the
username associated with the text is equal to the username of
the user running Matterhorn, the display text is formatted with
currentAttr
. Otherwise it is formatted with an attribute chosen
by hashing the associated username and choosing from amongst the
username color hash buckets with usernameAttr
.
Usually the first argument to this function will be myUsername st
,
where st
is a ChatState
.
The most common way to call this function is
@colorUsername (myUsername st) u u
The third argument is allowed to vary from the second since sometimes we call this with the user's status sigil as the third argument.
Return the attribute name to use for the specified username. The input username is expected to be the username only (i.e. no sigil).
If the input username is a special reserved username such as "all",
the clientEmphAttr
attribute name will be returned. Otherwise
a hash-bucket username attribute name will be returned based on
the hash value of the username and the number of hash buckets
(usernameColorHashBuckets
).
usernameColorHashBuckets :: Int Source #
The number of hash buckets to use when hashing usernames to choose their colors.