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.
In the future all (normal) output should be written by any of the
following functions:
out (currently called new_out)
outln
dbg (currently called new_dbg)
dbgln
warn (currently called new_warn)
warnln
However, there are still a ton of uses of the old out/warn/dbg in the
code base so the new functions are called new_out/new_warn/new_dbg. I am
going to rename them as soon as all the other usages are gone (this
might take a while.)
I also added raw_out/raw_dbg/raw_warn which don't do any escaping,
this should be useful if no formatting is required and if the input
contains tons of curly braces. (I am not entirely sure if this function
will stay, but I am adding it for now.)
Now, right-clicking on an image allows you to open that image in this
tab or a new tab. You can also copy the image URL, and even copy the
image itself to the clipboard! :^)
Copying to the clipboard will not work in a multi-process context yet,
since we need to send the image bitmap across the IPC boundary and this
patch does not do that.