When resizing, it can be hard to get the content to appear nicely
without a black border where the window's aspect ratio doesn't match the
content's aspect ratio.
With this new action, it is possible to automatically adjust the
window's size to match the content's aspect ratio. When it is resizing,
it will maintain the width of the window, but adjust the height to match
the aspect ratio of the content.
This class had slightly confusing semantics and the added weirdness
doesn't seem worth it just so we can say "." instead of "->" when
iterating over a vector of NNRPs.
This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
This patch replaces the bespoke rendering engine in Presenter with a
simple pipeline that turns presentations into single-page HTML files.
The HTML is then loaded into an OutOfProcessWebView.
This achieves a number of things, most importantly:
- Access to all the CSS features supported by LibWeb
- Sandboxed, multi-process rendering
The code could be simplified a lot further, but I wanted to get the new
architecture in place without changing anything about the file format.
These functions return the deprecated `Core::File` class, so let's mark
it as such to avoid possible confusion between future non try_*
functions which will use Core::Stream family classes and to possibly
grab someone's attention. :^)
Rip that bandaid off!
This does the following, in one big, awkward jump:
- Replace all uses of `set_main_widget<Foo>()` with the `try` version.
- Remove `set_main_widget<Foo>()`.
- Rename the `try` version to just be `set_main_widget` because it's now
the only one.
The majority of places that call `set_main_widget<Foo>()` are inside
constructors, so this unfortunately gives us a big batch of new
`release_value_but_fixme_should_propagate_errors()` calls.
In 7c5e30daaa, the focus was "only" on
Userland/Libraries/, whereas this commit cleans up the remaining
headers in the repo, and any new badly-formatted include.
Base+Userland: Add menu item icons
This adds missing icons to Presenter Presentation menu.
This adds missing icon to Image Viewer View menu.
This adds a scale icon for the Image Viewer and Font Editor.
This moves the Fit Image to View icon to the 16x16 folder as it's now
used by Image Viewer and not only Pixel Paint.
This improves the fullscreen and play icons so that they fit together
better.
The Presentation::title() and Presentation::author() functions return a
StringView to the title/author defined in the json file or a default
value. Previously, this would return a StringView to already-freed
memory and crash the application when setting the window title. This
commit fixes that issue :^)
Note that this still keeps the old behaviour of putting things in std by
default on serenity so the tools can be happy, but if USING_AK_GLOBALLY
is unset, AK behaves like a good citizen and doesn't try to put things
in the ::std namespace.
std::nothrow_t and its friends get to stay because I'm being told that
compilers assume things about them and I can't yeet them into a
different namespace...for now.
This generally seems like a better name, especially if we somehow also
need a better name for "read the entire buffer, but not the entire file"
somewhere down the line.
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.
One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This version can already:
- load all of the defined file format except for the image type and the
frame-specific stuff
- navigate frames and slides (though frames are mostly stubbed out)
- display text with various common settings
- displays text with various fitting and scaling methods
- scale and position objects correctly no matter the window size