This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
I modeled the domain in the example like so • top stories ◦ story • comments Story element has a button to update comments, but the story shouldn't know about comments. How should I handle this? bubble effect upwards?
Yup, bubble the effect upward to someone that has the right context.
Man, that's amazing, I never did any UI work in my life and in about 3 hours of work got to this
that looks great!
I mean, not beautiful... but functional! 😄
just a warning, the built in scrollview is functional, but there's room for improvement. I haven't gotten to it yet because I personally prefer pagination over scrolling, but I should probably just fix it since it's usually one of the first things people try for some reason.
the main issue is that it stops scrolling when your mouse leaves the scroll area, but it should work other than that
let me check
not the best example, https://github.com/phronmophobic/membrane/blob/4a69da67c5924068fd9a47df77226e6529a01b99/src/membrane/re_frame.cljc#L133
nevermind, this only works with the re-frame components
one sec, it should be pretty simple, let me just double check the syntax
you should just be able to pass the body and the bounds of the scroll view and it should work
That's just the size of the scrollview
the body can be anything
sensitivity with the scroll wheel or with how it tracks your mouse?
oh weird
obviously, the scrollview should match whatever is normal for the OS, but as a work around you can wrap the scrollview with something like:
(def scroll-speed-factor 2)
(defn fix-scroll [elem]
(ui/on-scroll (fn [[sx sy] pos]
(ui/scroll elem [(* scroll-speed-factor sx) (* scroll-speed-factor sy)] pos))
elem))
;; usage
(fix-scroll
(basic/scrollview {:scroll-bounds [200 150]
:body (ui/image ( "lines.png"))}))
in fact, I think if you wrap your top level app with fix-scroll
, it should fix it for any child scrollview
If you are ever feeling extra ambitious, you could use https://github.com/phronmophobic/clj-cef to render the html
Yes.
;; label
(ui/label "my-text" (ui/font "font-path.ttf" 22))
;; text area
(basic/textarea {:text text, :font (ui/font "font-path.ttf" 22)})
not currently
yea, I'm not actually sure what the API for that should be
potentially, I could just use the https://github.com/mogenslund/liquid/blob/master/src/liq/buffer.cljcin liquid. I can't remember if they assume a mono spaced font though
which font to look up is part of rendering, no reason it should be uniform to one text area. I can imagine a sort of (with-face text {,,,})
form which overrides lookup
not sure I understand how with-face
would be used
it seems like it might work for displaying text, but I would probably want something that works with editable text as well
the liquid buffers are pretty similar to how code mirror does it.
Another idea I had was to simply embed emacs as a text editor
which sorta worked. the biggest downside is that it only works with mono spaced fonts
there exists a github issue to add a RichTextView to membrane, https://github.com/phronmophobic/membrane/issues/8
not much there, but it exists
what I would be looking for is a data format that: • supports non mono spaced fonts • is "easy" to edit • allows for markup like italics, bold, strikethrough, etc • allows for color markup
nice to haves would be: • support for multiple fonts • support for emoji Although, both of those have some undefined behavior with respect to layout
For your use case, do you need an editable text area with markup or just for display?
and which kinds of markup? • bold • italic • other?
Bold and italic first, option to switch fonts would be nice, too (i.e. monospace and regular) Support for text selection would be nice, too, but not critical
ok, that doesn't seem too bad. I'll see if there's a simple workaround