Commit Graph

322 Commits

Author SHA1 Message Date
abakkk baf5e7c968 hide square area outline
Hide the square area outline when the drawing area is not reactive.

Fix 58677dc1.
2020-10-21 09:33:40 +02:00
abakkk 28a9d79d03 fix french localization 2020-10-21 09:28:57 +02:00
O. Giesmann 1437091725 update deutsch localization
close !20
2020-10-16 11:06:02 +02:00
abakkk 022fb02556 update french localization 2020-10-12 11:32:22 +02:00
abakkk ea11a92689 Merge branch 'dev' into 'master'
v9

See merge request abakkk/DrawOnYourScreen!19
2020-10-12 11:25:25 +02:00
abakkk c9c214c6d5 version -> 9 2020-10-12 11:22:48 +02:00
abakkk 9731ebecb7 start a new line with "Shift + Enter"
Text tool:
* Enter: valid text and close text entry.
* Escape: close text entry.
* Shift + Enter: Start a new line.

related to #30.
2020-10-12 11:09:20 +02:00
abakkk cddfa3172f Font size markup bug workaround
The "small" font size attribute was applied to the whole text.

https://gitlab.gnome.org/GNOME/mutter/-/issues/1467
2020-10-11 13:09:28 +02:00
abakkk 80b49f2a1d SVG size and layer container
Fix SVG size by taking the size of the layers.
2020-10-11 09:28:02 +02:00
abakkk bb90ab6040 bind grid layer visibility and hasGrid
Repaint an empty grid layer is useless.
2020-10-10 15:05:12 +02:00
abakkk dd45e87f01 layers and eraser
Paint the current element in the `backLayer` when it is in "eraser mode".
2020-10-10 15:02:01 +02:00
abakkk 556cbb2ab3 remove debug constants
Remove CAIRO_DEBUG_EXTENDS and SVG_DEBUG_EXTENDS.
2020-10-09 11:56:47 +02:00
abakkk 58677dc175 Split the drawing area in several layer widgets.
The drawing area is now a container and the layers are the proper drawing widgets. There is a separated layer for the current element so only the current element is redisplayed when drawing.
2020-10-09 11:51:01 +02:00
abakkk ed167f8d1b fix transformation stopping
* Handle case where grabbed element does not have transformation to stop.
* Update cursor after erasing drawing while an element is grabbed.
2020-10-09 08:48:42 +02:00
O. Giesmann 44ba9ba17d create deutsch localization
related to #47.
2020-10-07 09:48:09 +02:00
abakkk b3fffc193e Merge branch 'dev' into 'master'
v8.1

Closes #46 and #45

See merge request abakkk/DrawOnYourScreen!18
2020-10-06 17:31:03 +02:00
abakkk 42eff0fa05 version -> 8.1 2020-10-06 17:20:59 +02:00
abakkk ff350130a4 rework of key event handling
* Handle stage key events only when the area is reactive. Any reason to handle key events in other cases?
* Move `Escape` key handling to the stage `key-press-event` handler. So leaving the drawing mode with `Escape` is still possible when the overview mode has been entered inadvertently.
2020-10-05 16:46:16 +02:00
abakkk 28def0059d finish undo/redo rework
* "Undo(Redo) last brushstroke" -> "Undo(Redo)".
* Sync `_updateActionSensitivity` menu method with the new undo/redo behavior.
* Smooth button action is no longer destructive.
* Clean undone smooth transformations when doing a new smooth transformation.
2020-10-04 22:48:40 +02:00
abakkk 236e4db236 transformation notUndoable => undoable
The `undoable` transformation property is not preserved when the element is "stringified". So transformations cannot be undone, once the element is loaded from JSON.
2020-10-04 22:17:13 +02:00
abakkk ccf928c048 make smooth transformations undoable/redoable 2020-10-04 20:55:06 +02:00
abakkk e218819edd make transformations undoable/redoable 2020-10-04 17:20:03 +02:00
abakkk 6374cc8c47 motion timeout
Add intermediate points to make quick free drawings smoother.
Do not redisplay the area at this step (crashes).
Use device.get_coords rather than global.get_pointer because the later return rounded (floor) values.

Fix #45.
2020-10-04 11:12:47 +02:00
abakkk 82aee30657 fix unsanitized GType names
With old GS/GJS, some GType names were generated from class names without sanitizing it (e.g. Menu.ActionButton).

Instead of defining all GType names, sanitize all class name as it was GType name, and let GJS generated GType name securely when it is necessary.

Fix #46.
2020-10-04 10:01:55 +02:00
abakkk 6e99e380cb Merge branch 'dev' into 'master'
Dev

See merge request abakkk/DrawOnYourScreen!17
2020-09-27 19:35:29 +02:00
abakkk 950881d1c3 version -> 8 2020-09-27 19:33:49 +02:00
abakkk bf75da8fa8 add some media to the readme 2020-09-27 19:20:38 +02:00
abakkk 79f27d1b25 improve menu max-height
* Take scale factor into account.
* Put it in '_onMenuOpenStateChanged' so the max-height will be updated if the monitor size change.

See PanelMenu.Button.
2020-09-25 12:50:10 +02:00
abakkk 129c8f584c Name GTypes and classes against extension uuid.
For DeepExtensionReloader.
2020-09-25 11:55:36 +02:00
abakkk 6892b9c582 fix NEWS 2020-09-22 23:45:55 +02:00
abakkk 1db60b6d4e Merge branch 'dev' into 'master'
v7

See merge request abakkk/DrawOnYourScreen!16
2020-09-22 23:28:17 +02:00
abakkk fba13926c4 version -> 7 2020-09-22 23:24:17 +02:00
abakkk 3c67bf3398 colored SVG images
Color (fill) SVG images by pressing the `Shift` key.
2020-09-22 23:21:48 +02:00
abakkk 532b9242c9 image element, minor
* image.toJson -> image.toJSON.
* remove unused 'fill' and 'operator' properties.
2020-09-22 18:22:41 +02:00
abakkk 27e194905b add gpl import
* Import palettes from a .gpl file (one palette for each column).
* Add possibility to use more than 9 palettes.
* Color display names support.
* color.toJSON for svg and drawing saves, color.toString for display.
2020-09-22 17:31:48 +02:00
abakkk 4cc0c9e028 Mention Color Picker extension in the readme 2020-09-21 15:21:12 +02:00
abakkk dd18ca3051 bunch of menu optimizations
* A minimum width for the menu, the same as the aggregate menu, in order to prevent the menu with from growing on submenu open.
* A maximum width for uncontrolled content (font, image and drawing names). Same value and same reason.
* Style the font family labels in idle loop to open the submenu fastly.
* Add the drawing gicons in idle loop to open the submenu smoothly.
2020-09-20 15:40:45 +02:00
abakkk 737bc856c4 color-picker extension support
The color picker use the ["Color Picker" extensions](https://github.com/tuberry/color-picker) if it is available thanks to `pickAsync` "api". In comparaison to the GS color picker, it provides a colored cursor and a menu to adjust the color.
2020-09-20 15:40:45 +02:00
abakkk af694382c8 add color picker
It wraps the upstream color picker, that is designed for DBus access.
There is a shortcut and a menu button.
2020-09-20 15:40:45 +02:00
tuberry 9977a037ec Simplified Chinese localization update 2020-09-20 15:39:19 +02:00
abakkk b1cbc63f0b French localization update 2020-09-20 14:27:51 +02:00
abakkk 8af42fbad8 version -> v6.4 2020-09-19 00:38:09 +02:00
abakkk 34eb8e930b Merge branch 'dev' into 'master'
v6.4

See merge request abakkk/DrawOnYourScreen!15
2020-09-19 00:34:29 +02:00
abakkk d20040b135 fix textEntry position
* element.x and element.y are relative to the area, not to the stage.
* Do not hide and do not set opacity to 0 because ibusCandidatePopup need a mapped text entry to init correctly its position.
2020-09-19 00:24:50 +02:00
abakkk eb87714adc area._stopAll
* pros: the function is shared and it decreases bugs.
* cons: drawing/writing/transfo are not deleted if unfinished.
2020-09-18 19:13:10 +02:00
abakkk 324c066685 PangoCairo.show_layout_line
use `PangoCairo.show_layout_line` instead of `PangoCairo.show_layout`. It is equivalent.

show_layout (doc): "The top-left corner of the PangoLayout will be drawn at the current point of the cairo context."
show_layout_line (doc): "The origin of the glyphs (the left edge of the line) will be drawn at the current point of the cairo context."
So it is no longer necessary to query `layout.get_baseline()`.
2020-09-18 18:37:01 +02:00
abakkk 5e43b05740 fix Jsons directory monitor
`directory.monitor(...)` -> `directory.monitor_directory(...)`.
It is important to specify that the file to monitor is a directory because maybe the directory does not exist yet and remove events would not be monitored.
2020-09-18 12:54:06 +02:00
abakkk 1677425413 "Unlock image ratio" -> "Do not preserve image ratio" 2020-09-18 11:53:19 +02:00
abakkk f7d1f15cf5 add tooltips to "Open drawing" submenu buttons 2020-09-18 11:42:16 +02:00
abakkk 277a3b244b trim clipboad text lines
Since 3.38 there is a line terminator character, that has to be removed with .trim().
2020-09-18 11:05:44 +02:00