Live data from Hacker News

Egui – An immediate mode GUI written in Rust

egui.rs

91–100 of 143 posts

Re: Egui – An immediate mode GUI written in Rust

#91
post #58

> panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/glow-0.16.0/src/web_sys.rs:282:78: called `Option::unwrap()` on a `None` value Someone's been naughty for Christmas, forcing option unwrapping instead of pattern matching. On the mobile version of Brave.

At the very least, one should use `expect` over `unwrap` so the error is useful.

Re: Egui – An immediate mode GUI written in Rust

#93

Earlier quoted context omitted.

No, I mean with desktop UIs too. Try copying from a traditional win32 GUI or Qt or Gtk.

Care to explain? All text editable widgets in Qt[1] supports text selection and copying. [1] QTextEdit, QML TextEdit etc

The conversation isn't about text inputs but about text labels.

On the web you can usually select any text. Paragraphs? No problem. Form labels? Sure, easy.

But desktop and mobile apps don't allow that. You can only select text in editable fields.

Re: Egui – An immediate mode GUI written in Rust

#94

Earlier quoted context omitted.

No, I mean with desktop UIs too. Try copying from a traditional win32 GUI or Qt or Gtk.

Care to explain? All text editable widgets in Qt[1] supports text selection and copying. [1] QTextEdit, QML TextEdit etc

In dedicated widgets yes, but widgets that aren't specifically dedicated for text editing don't usually let you select the text.

Try selecting explanatory text, or text associated to checkboxes in a Qt app: it won't work. There are exceptions, for example you can select text in the right side file metadata pane in the Dolphin file manager. But even this is limited: you cannot cross cells. Should you copy-paste all the metadata, you'd need to do it cell by cell.

Re: Egui – An immediate mode GUI written in Rust

#95
post #54

Earlier quoted context omitted.

Selecting text can be useful, but it can also become its own usability problem. I recently created a touch interface using a websocket/browser based stack and one of the problem was that users kept selecting the text on buttons because they expected some action while holding the button.

https://caniuse.com/user-select-none + pointer-events + touch-action : )

I currently have the same issue while building a canvas web app. Safari shows a small magnifier glass on double tap/long press and none of the css properties will suppress it.

Re: Egui – An immediate mode GUI written in Rust

#96
post #94

Earlier quoted context omitted.

Care to explain? All text editable widgets in Qt[1] supports text selection and copying. [1] QTextEdit, QML TextEdit etc

In dedicated widgets yes, but widgets that aren't specifically dedicated for text editing don't usually let you select the text. Try selecting explanatory text, or text associated to checkboxes in a Qt app: it won't work. There are exceptions, for example you can select text in the right side file metadata pane in the Dolphin file manager. But even this is limited: you cannot cross cells. Should you copy-paste all th…

Gotcha, yeah the developer needs to implement text selection himself. I wrote how I implemented text selection between discrete blocks in a ListView in my block editor on my blog post: https://rubymamistvalove.com/block-editor

Re: Egui – An immediate mode GUI written in Rust

#97
post #71
post #6

Earlier quoted context omitted.

I use it in Sharpview. It's really for GUI programs, not web pages. It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs. For that, it's pretty good. It's one pass. As a result, layouts which are ordered left to right and top to bottom work well, but ones which displace or resize items above or to the left don't work well. Egui tries to fix things up on the next frame, th…

> It redraws everything on every frame, so it's most useful for 2D overlays on 3D game-type programs. So it's not a GUI. In my book a GUI only redraws when something changes, to save the user's power.

Well I guess your book needs a new edition. The type of gui you're referencing is typically referred to as a retained mode gui.

Re: Egui – An immediate mode GUI written in Rust

#98

Earlier quoted context omitted.

https://caniuse.com/user-select-none + pointer-events + touch-action : )

I currently have the same issue while building a canvas web app. Safari shows a small magnifier glass on double tap/long press and none of the css properties will suppress it.

I think you can work around it by listening on the touchstart event on your element and calling e.preventDefault(). Don't have an iPhone handy to test it right now, but I believe that's how I fixed that issue in my web game.

Re: Egui – An immediate mode GUI written in Rust

#99
post #60

I'm afraid that until browsers provide APIs to help render fonts with sub-pixel rendering (note: that would add fingerprinting bits), canvas-based UI rendering libraries will always have a big disadvantage (vs DOM-based) on all but the high pixel density devices. (This is well known by the egui authors, which is a great library!)

Why would that add fingerprint bits if everybody uses the same algorithm to render this?

Re: Egui – An immediate mode GUI written in Rust

#100
post #60

I'm afraid that until browsers provide APIs to help render fonts with sub-pixel rendering (note: that would add fingerprinting bits), canvas-based UI rendering libraries will always have a big disadvantage (vs DOM-based) on all but the high pixel density devices. (This is well known by the egui authors, which is a great library!)

I'm not sure. Phones and Macs are already all high density enough. Apparently it's been removed on Mac. Probably not too long before even cheap windows laptops and Chromebooks have hidpi screens. Plus modern displays can have all sorts of weird subpixel layouts so it's not as simple as it used to be.

Even if you are using Retina 5k 27", the subpixel rendering is still necessary to get sharper fonts.
Post reply on HN