Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qbar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jktr
qbar
Commits
cd5daf9e
Commit
cd5daf9e
authored
5 years ago
by
Jens Nolte
Browse files
Options
Downloads
Patches
Plain Diff
Move BlockText to BlockOutput.hs
parent
9c22ec4f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/QBar/BlockOutput.hs
+39
-0
39 additions, 0 deletions
src/QBar/BlockOutput.hs
src/QBar/Core.hs
+0
-32
0 additions, 32 deletions
src/QBar/Core.hs
with
39 additions
and
32 deletions
src/QBar/BlockOutput.hs
0 → 100644
+
39
−
0
View file @
cd5daf9e
module
BlockOutput
where
import
qualified
Data.Text.Lazy
as
T
newtype
BlockText
=
BlockText
[
BlockTextSegment
]
instance
Semigroup
BlockText
where
(
BlockText
a
)
<>
(
BlockText
b
)
=
BlockText
(
a
<>
b
)
instance
Monoid
BlockText
where
mempty
=
BlockText
[]
data
BlockTextSegment
=
BlockTextSegment
{
active
::
Bool
,
importance
::
Importance
,
text
::
T
.
Text
}
|
PangoTextSegment
T
.
Text
type
Importance
=
Float
mkText
::
Bool
->
Importance
->
T
.
Text
->
BlockText
mkText
active
importance
text
=
BlockText
[
BlockTextSegment
{
text
,
active
,
importance
}]
activeImportantText
::
Importance
->
T
.
Text
->
BlockText
activeImportantText
=
mkText
True
importantText
::
Importance
->
T
.
Text
->
BlockText
importantText
=
mkText
False
activeText
::
T
.
Text
->
BlockText
activeText
=
mkText
True
0
normalText
::
T
.
Text
->
BlockText
normalText
=
mkText
False
0
pangoText
::
T
.
Text
->
BlockText
pangoText
pango
=
BlockText
[
PangoTextSegment
pango
]
surroundWith
::
(
T
.
Text
->
BlockText
)
->
T
.
Text
->
T
.
Text
->
BlockText
->
BlockText
surroundWith
format
left
right
middle
=
(
format
left
)
<>
middle
<>
(
format
right
)
This diff is collapsed.
Click to expand it.
src/QBar/Core.hs
+
0
−
32
View file @
cd5daf9e
...
@@ -85,38 +85,6 @@ data Bar = Bar {
...
@@ -85,38 +85,6 @@ data Bar = Bar {
data
BarUpdateChannel
=
BarUpdateChannel
(
IO
()
)
data
BarUpdateChannel
=
BarUpdateChannel
(
IO
()
)
type
BarUpdateEvent
=
Event
.
Event
type
BarUpdateEvent
=
Event
.
Event
newtype
BlockText
=
BlockText
[
BlockTextSegment
]
instance
Semigroup
BlockText
where
(
BlockText
a
)
<>
(
BlockText
b
)
=
BlockText
(
a
<>
b
)
instance
Monoid
BlockText
where
mempty
=
BlockText
[]
data
BlockTextSegment
=
BlockTextSegment
{
active
::
Bool
,
importance
::
Importance
,
text
::
T
.
Text
}
|
PangoTextSegment
T
.
Text
type
Importance
=
Float
mkText
::
Bool
->
Importance
->
T
.
Text
->
BlockText
mkText
active
importance
text
=
BlockText
[
BlockTextSegment
{
text
,
active
,
importance
}]
activeImportantText
::
Importance
->
T
.
Text
->
BlockText
activeImportantText
=
mkText
True
importantText
::
Importance
->
T
.
Text
->
BlockText
importantText
=
mkText
False
activeText
::
T
.
Text
->
BlockText
activeText
=
mkText
True
0
normalText
::
T
.
Text
->
BlockText
normalText
=
mkText
False
0
pangoText
::
T
.
Text
->
BlockText
pangoText
pango
=
BlockText
[
PangoTextSegment
pango
]
defaultColor
::
T
.
Text
defaultColor
::
T
.
Text
defaultColor
=
"#969896"
defaultColor
=
"#969896"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment