4 ms·
GJS: Node.js Like Runtime for Gnome
- znpy 2y agoYou go to the demo page (https://gjs.guide/showcase/ https://gjs.guide/showcase/) and look at the audio recorder thing (https://gjs.guide/showcase/gnome-sound-recorder.png https://gjs.guide/showcase/gnome-sound-recorder.png) ... why so much wasted blank space?
- aniviacat 2y agoBecause it's pretty
- pavlov 2y agoYou can put physical Post-It notes in the empty space, so you know what Recording 1, Recording 2 etc. actually are.
- c0balt 2y agoThis looks like the UI just scales well to fill an empty screen? In my experience Gnome Apps are always generous with padding however they scale down gracefully with window size.
- robinsonb5 2y agoReally? To my eyes it's a UI that doesn't scale well, and doggedly maintains an aspect ratio that doesn't match the window dimensions. I can see some value in not spreading the buttons across a vast horizontal swathe of window - much as one doesn't fill a widescreen monitor with a single column of text - but there's no excuse for the waveform not making full use of the available screen width.
- thrw42A8N 2y agoSo it'd fill out of the card? So weird. I really don't see an issue with the ui.
- robinsonb5 2y agoIt shouldn't spill out of the card - my problem is with the card itself. Or at least, the fact that the card hasn't expanded to make use of the window which contains it. But then I'm coming at it from the angle of someone who views VCD files in GtkWave, and thus expects to see as much useful information as possible in a waveform view. If it's just superficial decoration then I guess it's fine.
- thrw42A8N 2y agoYeah this is really not the app to get detailed waveform info from... Even if it was wide it probably wouldn't tell you much - it's just a decoration.
- jitl 2y agoI disagree here. For this, a memo application, I think the metadata (date, length, name, etc) is the true content here you’d want to scan, not the actual waveform itself. There’s some content like images that should scale to full bleed just fine, but for something like a table row, as-narrow-as-sensible is better for usability even if there’s a lot of unused horizontal space, because there’s not advantage to making the eye scan across a wider distance. The same goes for the width of paragraph text in general. A paragraph stretched to full screen width is much harder to read than a paragraph wrapped at paperback book width. If wide paragraphs were better, books would have a different aspect ratio.
- diggan 2y ago> however they scale down gracefully with window size Can confirm. Screenshot of the minimum width, the paddings all disappear: https://i.imgur.com/iv7frHI.png https://i.imgur.com/iv7frHI.png
- deleted 2y ago[deleted]
- wg0 2y agoThis only wants me to go back to gnome and try/create apps as I see fit. Alternative is using C with Glade designer[0] but I guess this covers almost everything already. [0]. https://help.gnome.org/users/glade3/3.8/glade3.html https://help.gnome.org/users/glade3/3.8/glade3.html
- grizzles 2y agoI want to be able to use HTML/JS to design my desktop and call APIs. Can I do that with gjs or is it this GTK namespace and GTK-CSS like language only? It would be really cool to design the background from the Ubuntu crown to a bunch of widgets of information I use daily.
- deleted 2y ago[deleted]
- maurice2k 2y agoJust from the headline, this reminds me of Microsoft Windows in the 1990s that came with it's on interpretation of JavaScript (aka "we have implemented some JavaScript like stuff that seems to work like Netscape but in fact doesn't") In general this sounds pretty cool: GJS is built on the SpiderMonkey JavaScript engine. It utilizes GObject Introspection to provide access to the GNOME APIs using ECMAScript 2021 JavaScript. Just don't compare it with Node.js; it's something else. No, your code might not run in that environment; APIs are most likely not compatible.
- deleted 2y ago[deleted]
- MadcapJake 2y agoI wish the new class format didn't require all that boilerplate. Seems like that could all be determined by the engine, unless I am missing something.
- esbranson 2y agoThere is also WebKitGTK for interacting with and rendering regular web content within GTK apps. It uses JavascriptCore AFAIK instead of SpiderMonkey. https://webkitgtk.org/ https://webkitgtk.org/ #!/usr/bin/gjs const Gtk = imports.gi.Gtk; const WebKit = imports.gi.WebKit2; class SimpleBrowser { constructor() { this.application = new Gtk.Application({ application_id: 'com.example.SimpleBrowser' }); this.application.connect('activate', () => { this.window = new Gtk.ApplicationWindow({ application: this.application, title: "Simple Browser", default_height: 600, default_width: 800 }); this.webview = new WebKit.WebView(); this.window.add(this.webview); this.webview.load_uri("http://www.example.com"); this.window.show_all(); }); } } let app = new SimpleBrowser(); app.application.run(ARGV);