Skip to content

Commit

Permalink
Add FontAwesome backspace
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadRau committed Jan 4, 2019
1 parent b0782b0 commit 4771411
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions examples/Calculator.re
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ open Revery.Core.Window;
open Revery.UI;
open Revery.UI.Components;

open CamomileLibraryDefault.Camomile;

module Row = (
val component((render, ~children, ()) =>
render(
Expand Down Expand Up @@ -45,7 +47,7 @@ module Column = (
);

module Button = (
val component((render, ~contents: string, ~onClick, ~children, ()) =>
val component((render, ~fontFamily="Roboto-Regular.ttf", ~contents: string, ~onClick, ~children, ()) =>
render(
() => {
let viewStyle =
Expand All @@ -64,7 +66,7 @@ module Button = (
let textStyle =
Style.make(
~color=Colors.black,
~fontFamily="Roboto-Regular.ttf",
~fontFamily,
~fontSize=32,
(),
);
Expand Down Expand Up @@ -292,7 +294,8 @@ module Calculator = (
/>
/* TODO: Switch to a font with a backspace character */
<Button
contents="<="
fontFamily="FontAwesome5FreeSolid.otf"
contents=Zed_utf8.singleton(UChar.of_int(0xF55A))
onClick={_ => dispatch(BackspaceKeyPressed)}
/>
</Row>
Expand Down
Binary file added examples/FontAwesome5FreeSolid.otf
Binary file not shown.
3 changes: 2 additions & 1 deletion examples/dune
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
str
Revery
flex
zed
))
(install
(section bin)
(package Revery)
(files Roboto-Regular.ttf binary.dat index.html Hello.bc.js gl-matrix-min.js outrun-logo.png))
(files Roboto-Regular.ttf FontAwesome5FreeSolid.otf binary.dat index.html Hello.bc.js gl-matrix-min.js outrun-logo.png))

0 comments on commit 4771411

Please sign in to comment.