Commit Graph

79 Commits

Author SHA1 Message Date
abakkk 40f4f0b946 change license 2021-05-27 18:54:08 +02:00
abakkk e470e2f40d fixes for old GS versions 2021-02-20 00:56:21 +01:00
abakkk ca6baf0dc8 minor, enumeration syntax 2021-02-19 23:20:57 +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 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 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 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 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 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 60091a94b6 rework of Files.Jsons
In the same way as Files.Images.
2020-09-13 23:50:09 +02:00
abakkk e53e69efcf minor, use array instead of object for "OTHER" shortcuts
Array is more semantically appropriate.
For example 2 actions may have the same translations (error of a translator). With an object (or a map), only the second would be displayed, which is problematic to alert to the problem.

Additionally, handle the case where some GSettings keybinding values are empty.
2020-09-13 15:46:22 +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 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 c1689cac75 rework prefs, settings, locales
Although there is a lot of changes, nothing is important.
2020-09-02 16:16:23 +02:00
abakkk 89067a8dd9 use an Extension class 2020-08-31 13:05:41 +02:00
abakkk 1d95fac3bf add warning log on activation for unsupported GNOME Shell versions
As the extension may work in further GNOME Shell versions without targeted developpement, just add a small warning log without blocking anything.
2020-08-31 11:13:49 +02:00
abakkk a128664921 minor, add 'exported' directive for linters 2020-08-31 11:05:33 +02:00
abakkk b3a1a77160 replace user stylesheet with proper drawing settings
Since the most drawing params can be changed via menu or shortcuts, remove default.css and user.css.

* Missing params like palettes, dash, grid, etc, are added to prefs.
* Add palette choice to menu and shortcuts.
* Some defaults like fonts, line width, etc, are no longer modifiable by the user.
2020-08-31 09:43:00 +02:00
abakkk 01701538bb minor, rework settings 2020-08-23 11:49:26 +02:00
abakkk a1ce4aaf79 Add font family reversed switching 2020-08-06 00:26:10 +02:00
abakkk 39ec1ba888 toggle -> switch 2020-08-06 00:06:01 +02:00
abakkk 1172e9da6f new image shape
Images files are picked from `~/DrawOnYourScreen/images/` (and `extensiondir/images/`)
svg, png, jpeg, ...(pixbuf)
2020-08-01 14:08:17 +02:00
abakkk 96efac1e3f draw.js -> area.js 2020-07-04 08:42:45 +02:00
abakkk ca96e76d12 draw-to-elements 5 2020-07-04 08:35:59 +02:00
abakkk 0c311ae477 draw-to-osd 5 2020-07-03 23:16:43 +02:00
abakkk e50a8c80a7 "Modeless/modal" -> "Grab/ungrab keyboard and pointer"
And add an OSD notification.
2020-06-29 12:21:21 +02:00
abakkk be36fd4de2 Prefs, notifications and pot file
* Add a long timeout for some OSD notifications.
* Change some pref strings.
* "Stroke" -> "Outline"
* Clean pot file
2020-06-28 18:27:23 +02:00
abakkk f02d076ce2 GS 3.24 compatibility 2020-06-27 22:35:43 +02:00
abakkk fbe044a2b9 Add text alignment
Left or right.
Replace unused `rtl`.
2020-06-27 15:10:01 +02:00
abakkk 5bf0ccc4f1 Use a St.Entry for text tool.
All key events go through a hidden St Entry.

* Ibus inputs support.
* GS keyboard support, by moving the keyboard box above the drawing area.
* All convenience keybindings of a St Entry (cursor moves, delete, paste, select all ...).
* Add a writing action mode so some keybindings are disabled when writing (e.g. `Delete` and `Ctrl + A`).
* Draw a thin rectangle as text cursor instead of a text character, so moving the cursor is smoother.

Close #29, #34
2020-06-25 11:41:15 +02:00
abakkk b0c06b8a73 Fix modal toggling criterion
Use `Main._findModal` instead of `Main.actionMode` as the criterion of the toggle direction.

Main.actionMode is not a safe criterion to know if the area is modal. For example, `Main.actionMode` is modified when toggling overview while drawing.
2020-06-24 23:16:22 +02:00
abakkk 0b8786eaa0 Some fixes and polishes around modal toggling and area disabling.
* Close menu before toggling modal (before because the menu changes `Main.actionMode`).
* Hide the helper and update the grid display when toggling modal.
* Signal `stop-drawing` -> `leave-drawing-mode` for consistence.
* `area.disable` -> area `destroy` event handler.
* `area.isInDrawingMode` -> `area.reactive`.
2020-06-22 11:56:34 +02:00
abakkk 98832cec72 toggle modeless / modal
Keybinding to ungrab keyboard and mouse while drawing remains at the top.
To be aware that this create some problems with the shell (DnD #1 and maybe more ?).

related to #6, #9, #20, #24, #33
2020-06-21 01:08:45 +02:00
abakkk 3c14f72f56 osdWindowConstraint
Replace osdWindowConstraint by custom class.
DO NOT Enforce a ratio of 1.
2020-06-21 00:48:21 +02:00
abakkk b364895c7d use showOsd method exclusively 2020-06-20 13:03:21 +02:00
abakkk fa4223b7ce Introduce mirror manipulations
* Reflection (symmetry axis)
* Inversion (symmetry point)

`transformingElement` is locked after selecting it.
2020-06-19 16:54:31 +02:00
abakkk 4907e35778 Introduce resize manipulation
* `SCALE_PRESERVE` (preserve ratio)
* `SCALE` (vertical, horizontal or both)

There is a third transformation, `SCALE_ANGLE`, that is not used because it causes problems to the `elementFinder`. Probably a bug of Cairo.inStroke that do no consider scales.
2020-06-15 22:13:03 +02:00
abakkk 443d1f8662 Introduce move manipulation
* 'Shapes' -> 'Tools' ('Shapes' + 'Manipulations')
* 'TextState' -> 'TextStates'
* Rotation centers are now computed dynamically (when building Cairo or SVG paths).
* Text rotation center is now located at the beginning of the text.
* Text elements gain a 'lineIndex' attribute to retrieve the rotation center of the first line.
2020-06-15 21:09:30 +02:00
abakkk 04894a9031 add "file-rule" drawing element attribute 2020-06-08 22:25:26 +02:00
abakkk 9bde4d3013 add "Open preferences" shortcut
Available since GS 3.36, so the shortcut is hidden for previous versions.
2020-06-08 15:26:55 +02:00
abakkk b4eb418c89 key label translations
Get key label translations by using Gtk.
2020-06-08 14:30:47 +02:00
abakkk 5b7d1eedf4 new polyline shape
Mark vertices with `Enter` and finish drawing by releasing clic, like other shapes.
2020-06-07 20:05:30 +02:00
abakkk b69c4ccf97 new polygon shape
Mark vertices with `Enter` and finish drawing by releasing clic, like other shapes.
2020-06-07 18:57:11 +02:00
abakkk 360ac081ce Add grid overlay 2020-06-05 15:58:58 +02:00
abakkk 91475c8b70 Fix "Hide panel and dock" 2020-06-01 20:28:26 +02:00
abakkk 11a00a25d0 Fix font-color label color
Foreground color markup is not displayed since 3.36, use style instead but the transparency is lost.

close #31
2020-06-01 20:27:05 +02:00