Previously, items such as audio, video, and widget items could not be
cut and pasted because when the page was saved, any item that had been
deleted was permanently removed (including its source file, in the case
of these mulitmedia items).
This commit prevents the deletion any item in the undoStack
(i.e, items that have been deleted) when the document is persisted,
meaning the source file is still available when pasting the item on
another page (or document).
Note that this can lead to cases where the source file is kept in the
document even when no item is present. This should be a relatively rare
occurence, however.
This fixes two related issues:
1) When taking a partial screenshot of the desktop, then copying it
(Ctrl-C) and pasting it in a new document, it was not saved
2) When a page of one document was copied into another (in document
mode, by dragging the page onto another document), media files
disappeared from the new page.
This was observed in some cases on low-resolution screens, at least on
Linux and Windows.
The previously hardcoded value for the width of the text items' titlebar
(consisting of the buttons for formatting text) was replaced by a
method calculating its width (which varies based on screen resolution).
- Selecting multiple media items then grouping them didn't behave as it
should for other items => fixed by adding type tests
- A group containing several media items wasn't saved to SVG with those media
items as children, due to incorrect UUID copying in the mediaItems's
deepCopy() methods
This allows users to change the color of the background grid e.g if they
are using a projector or other low-contrast display.
The settings are in the `Board` category and are named `CrossColorDarkBackground`
and `CrossColorLightBackground`. They take strings representing the
color in any of the following formats:
- #RGB (Hexadecimal digits)
- #RRGGBB
- #AARRGGBB
- #RRRGGGBBB
- #RRRRGGGGBBBB
- Any SVG color keyword name (as defined by W3C)
- The background selection palette now includes a slider to change the
size of the background grid. Default min/max values are 16 and 64px,
defined in UBSettings. Grid resizes dynamically as the slider is moved.
- Measuring tools' (ruler, triangle) markers follow grid size: 1 square
of the background grid corresponds to 1cm
- Grid size can be different for each page of a document
- Grid size is saved in the .svg
- Documents with a background grid but no specified grid size follow the
default size defined in UBSettings.
Previously, grid size was calculated based on DPI, which can vary from
one OS, computer or display to the next. This new setting allows
documents to be migrated from one machine to another with no unexpected
changes in grid size happening. It also makes it easy to correct any
problems importing old documents (whose grid size might be smaller or
larger than expected when imported on a new version of OpenBoard).