4 ms·
I have fond memories of XPCOM and XUL... Back in 04 we had a desktop application mostly a collection of C++ bindings to the Firebird database and for silly reas
by taf2 9y ago
I have fond memories of XPCOM and XUL... Back in 04 we had a desktop application mostly a collection of C++ bindings to the Firebird database and for silly reasons I started the GUI with Gtk+ but as we continued to struggle with porting to Win32 (like we sell this to people in Win32 not Linux) and I started to find a need to embed web content (cause like we should have written the whole thing as a web app - native apps are silly). I recall hacking the event loop to get Gtk+ and gecko to play nice in Win32. Anyways, XPCOM allowing me to write IDL files and expose my C++ work as JavaScript was at the time amazing and allowed me to quickly rewrite most of the UI in XUL and keep all the SQL work we'd done such that if I recall correctly we were able to port the application some 500k lines of code over to XUL. This was right before XulRunner... I still to this day feel good things about IDL/XPCOM and XUL for converting to see the light with JavaScript and HTML. XUL is just like a basically less well supported version of HTML and so is that MS markup language and event Gtk+'s Glade is just an XML editor for a UI... I beleive even OSX via xcode has an underlying XML format to describe the UI... and IMO HTML is light years ahead for UI.
- tzahola 9y ago> and IMO HTML is light years ahead for UI LOL. Last time I checked you still couldn't make an image fill the available space while keeping its aspect ratio :D
- Cyberdog 9y agoimg { width: 100%; height: auto; }
- bzbarsky 9y agoThat won't work right; it can overflow vertically. Consider the case of a 10x10 image in a container of width 500px and height 100px... Ideally you would want it to end up 100x100, but it will end up 500x500 with that CSS.
- mikewhy 9y agoWouldn't it be setting both "max-width" and "max-height" to 100%? Or the background-image / background-size hack.
- flomo 9y agoBelieve this is what people are looking for: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit
- bzbarsky 9y agoThis works if you set "width: 100%; height: 100%", yes (and "object-fit: contain").
- tzahola 9y agoNope. See my comment above.
- tzahola 9y agoNope. This determines how the image is rendered within the img element. The img element itself won’t be constrained in its aspect ratio. E.g. try adding a border or drop-shadow to the img and you’ll see the problem.
- tzahola 9y agoNope. This would not fit a skinny image to a fat container. But yeah, HTML is like lightyears ahead of anything else :^)
- DonHopkins 9y agoCyberdog: Now THERE was a cool web browser, email and news client. OpenDoc FTW! https://en.wikipedia.org/wiki/Cyberdog https://en.wikipedia.org/wiki/Cyberdog