The qualified name of a font is "<Family> <Size> <Weight>". You can
get the QN of a Font via the Font::qualified_name() API, and you can
get any system font by QN from the GUI::FontDatabase. :^)
Ref-counted objects must not be stack allocated. Make DOM::Document's
constructor private to avoid this issue. (I wish we could mark classes
as heap-only..)
We can't use current_view() before we've actually constructed the
subviews, so just ignore statusbar update requests before they get
a chance to call current_view().
This is not the most beautiful thing, and maybe we can think of a
nicer approach.
Each tool can have its own set of properties that can be modified
through a panel on the right side.
The tools I've added properties for are:
Pen:
Thickness
Brush:
Size
Hardness
Spray:
Thickness
Density
Bucket:
Threshold
Setting it as model root path in DirectoryView::setup_model() for
windowed mode as well would cause an issue with the following:
- "open ~/Desktop"
- "FileManager ~/Desktop"
- "Show in FileManager..." from Desktop context menu
When viewing the Desktop as the initial path it would be the same and
on_path_change wasn't called, leading to various widgets and window
properties not being updated.
Fixes#3772.
By allowing to specify a separate source bitmap when calling Filter::apply
the same filter can be applied to multiple areas, and also doesn't need
to use a temporary bitmap. This also enables us to apply the filter to
multiple regions properly, even if they are (almost) adjacent.
If no separate source bitmap is supplied then a temporary bitmap is still
necessary.
By moving the Bitmap and Rect out of Filter::Parameters we can re-use
the parameters more efficiently, allowing the filter to be applied
to many bitmaps without having to re-create the filter every time.
In a few places I also simplified a few format strings:
-outln("{} item{}", items, items.size() == 1 ? ' ' : 's');
+outln("{} item(s)", items);
In my opinion this is more readable and in some places it incorrectly
wrote '0 item' which is "fixed" now. In other places the placeholder
space looked weird.
When we write the format specifier '{:#08x}' we are asking for eight
significant digits, zero padding and the prefix '0x'.
However, previously we got only six significant digits because the
prefix counted towards the width. (The number '8' here is the total
width and not the number of significant digits.)
Both fmtlib and printf shared this behaviour. However, I am introducing
a special case here because when we do zero padding we really only care
about the digits and not the width.
Notice that zero padding is a special case anyways, because zero padding
goes after the prefix as opposed to any other padding which goes before
it.
The main inspiration behind this was to have a correct ex CSS unit.
The mean line is based off what it shows in the CSS Values and Units
Level 4 specification, section 6.1.1.
https://www.w3.org/TR/css-values-4/#font-relative-lengths
This also fixes a graphical bug where the decimal point was always
rendered. The number four was represented as '4.' instead of '4'. Now
the decimal point is only shown when there are decimal places.