Commit Graph

63 Commits

Author SHA1 Message Date
abakkk 40f4f0b946 change license 2021-05-27 18:54:08 +02:00
abakkk 5ad5dfffd1 not to erase the text on Escape key pressed
Related to #60.
2021-03-11 09:37:17 +01:00
abakkk 137742d471 adapt to Clutter API changes
device.get_coords() has been removed and seat.query_state() is unusable with null sequences.
2021-02-19 23:24:04 +01:00
abakkk f087570eb5 minor, param renaming
"showTextRectangle" -> "showElementBounds" and
"drawTextRectangle" -> "drawElementBounds".
2021-02-19 23:21:35 +01:00
abakkk 27a398d0e1 add convenient marks for rotation and stretch transformations 2021-02-19 23:21:04 +01:00
abakkk ca6baf0dc8 minor, enumeration syntax 2021-02-19 23:20:57 +01:00
abakkk cb49c83799 add centered text alignment 2021-02-19 23:20:29 +01:00
abakkk 3223a6fdca return to start a new text line
`Shift + Return` was not compatible with the ibusCandidatePopup.

So the only way to "validate" a text element is to click outside the text area.

Related to #56.
2021-02-19 23:19:58 +01:00
abakkk 5698f3f7cb multi-line text elements
* Can browse and break lines anywhere
* Can past multi-line texts
* Do not need lineIndex anymore and grouped lines are preserved permanently

Related to #56
2021-02-19 23:19:50 +01:00
abakkk f18e8e6ac0 add toggle animations
* background
* grid
* square area
2021-02-19 23:19:41 +01:00
abakkk e588728d3d Dot not use stateObj
Remove `Me.stateObj.areaManager`.
It caused errors on extension updated from ego (`JS ERROR: TypeError: Me.stateObj.areaManager is undefined`).
2020-10-21 09:33:40 +02:00
abakkk e99927d985 fix multi-monitor
Layer container allocation box is relative to the drawing area. So transform stage point before checking.

Fix 58677dc1.
Close #52.
2020-10-21 09:33:40 +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 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
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 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 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 129c8f584c Name GTypes and classes against extension uuid.
For DeepExtensionReloader.
2020-09-25 11:55:36 +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 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
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 23eea44661 add "Persistent over toggles' setting
* Rename "Persistent" to "Persistent over restarts".
* If disabled, "Persistent over toggles" has priority over "Persistent over restarts" and "Drawing on the desktop".

Close issue #42.
2020-09-17 17:30:30 +02:00
abakkk 072adde856 group menu items at the bottom
In addition, 'Save as a SVG file' -> "Export to a SVG file'.
2020-09-17 17:29:59 +02:00
abakkk 1d73d9f0e3 pass color and font when duplacting
Fix commit 42b4c9c0 .
2020-09-16 17:38:54 +02:00
abakkk e3b32ace3b fix ImageFromJson
Do not use the same content for insertable image and gicon. The former depends on the area size whereas the later is square.
2020-09-16 08:52:36 +02:00
abakkk 42b4c9c00c color and font
* Pass Clutter color and Pango fontDescription objects to elements, not strings.
* Do not use the color format '#rrggbbaa' in svg since it is not supported in GNOME 3.24.
2020-09-15 00:29:02 +02:00
abakkk a8633f1fbc add gicons to menu openDrawingSubMenu items 2020-09-14 01:38:00 +02:00
abakkk 60091a94b6 rework of Files.Jsons
In the same way as Files.Images.
2020-09-13 23:50:09 +02:00
abakkk 24682db69c add a lot of icons
* Complete Files.Icons.
* Add a lot of icons in the menu and the osd notifications.
2020-09-12 15:25:42 +02:00
abakkk 771bad2d59 improve images
* Let the user choose the directory.
* Rework of Files.Images.
* area.currentImage is now an ... image, not an index.
* Add 'switch-image-file-reverse' keybinding.
* Add image gicons (from thumbnails) in the submenu.
* Images are reset on drawing mode left or on images added from the clipboard.
2020-09-11 14:22:18 +02:00
abakkk 8277710510 get all icons from Files.Icons 2020-09-10 15:19:17 +02:00
abakkk 442d20b387 paste image files from clipboard 2020-09-09 22:25:56 +02:00
abakkk 56008f3041 add ranges to drawing settings schema
* It is no longer required to clamp the setting value in area.js.
* Add a "range" property, completed with another 'step' property, to PixelSpinButton in order to directly initiate the lower and upper values of the adjustment from the relevant setting range.
* Not related: fix an inversion between Pango and Cairo in element.js.
2020-09-09 12:12:29 +02:00
abakkk 03b73862cc .pot rework
* .pot file can be generated automaticaly from new locale/POTFILES.in.
* move shortcuts key and strings to new shortcut.js
2020-09-09 09:40:45 +02:00
abakkk 2dd900bddf new DisplayStrings object
Group the most strings to display in a new DisplayStrings object.
It is used by both menu and osd notifications.
2020-09-07 18:56:48 +02:00
abakkk f9769c11f2 default font and font description
* Use interface font as default font
* Work with a `Pango.FontDescription` instead of separate font properties.
2020-09-05 00:03:05 +02:00
abakkk c1689cac75 rework prefs, settings, locales
Although there is a lot of changes, nothing is important.
2020-09-02 16:16:23 +02:00
abakkk 6a8afcc20a use timestamps instead of Math.random in elementGrabber 2020-08-31 14:06:47 +02:00
abakkk 89067a8dd9 use an Extension class 2020-08-31 13:05:41 +02:00