Commit Graph

350 Commits

Author SHA1 Message Date
abakkk 3ddaa28400 Update Simplified Chinese translation
related to #34, #35
2020-06-30 14:43:58 +02:00
abakkk 8ce87b8f1f Create french translation
related to #35
2020-06-30 14:33:49 +02:00
abakkk 55efba0b3c Small pot fix
"stroke" -> "outline"

related to #35
2020-06-30 13:01:47 +02:00
abakkk 1e8a9492ba Merge branch 'dev' into 'master'
v6.1

Closes #28, #31, #30, #27, #34, and #29

See merge request abakkk/DrawOnYourScreen!12
2020-06-29 16:07:29 +02:00
abakkk 040b0138bb version -> v6.1 2020-06-29 15:58:09 +02:00
abakkk 3f0fce3bc6 Add "duplicate an element" how-to in readme 2020-06-29 15:40:37 +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 0d42d69f91 Pointer cursor when writing 2020-06-28 18:37:42 +02:00
abakkk 9199fbd82b Reorder pot file 2020-06-28 18:28:15 +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 75c20c34d2 Fix elementGrabberHandler
* Do not start several handler.
* Do not stop handler when toggling drawing mode.
2020-06-27 22:31:31 +02:00
abakkk 6a5481ff05 Clean prefs and fix pot file 2020-06-27 16:55:26 +02:00
abakkk 06e931ffd2 Fix color icon
Reduce svg size to avoid strange behaviour on menu opened.
2020-06-27 16:23:28 +02:00
abakkk fbe044a2b9 Add text alignment
Left or right.
Replace unused `rtl`.
2020-06-27 15:10:01 +02:00
abakkk dc73000a1d Minor, reorder pot file 2020-06-27 14:00:21 +02:00
abakkk c5f604a80a Evenodd switch and svg attributes
* Menu: `fillRule` submenu -> `Evenodd` switch.
* Rework SVG attributes in order to bypass useless attributes.
* Fix gjs bug: `Cairo.LineCap.SQUASH` -> `SQUARE`.
* Not to draw dashes if dash.array is `[0, 0]` (case line width is 0).
2020-06-27 13:59:07 +02:00
abakkk 8fae815ed8 Change color and tool icons 2020-06-27 11:42:53 +02:00
abakkk e341b36d65 cr.$dispose on painting error
Put repaint process in a "try catch" so cr.$dispose is always called.
2020-06-27 11:41:46 +02:00
abakkk 119c6725ef Font stretch and variant
Add minimal (no UI) `font-stretch` and `font-variant` support.
`font-stretch` css attribute is not recognized.
Cannot find a working usage for both.
2020-06-26 19:01:56 +02:00
abakkk 8519948c3b Render texts with Pango
Cairo "toy" text tool does not render non-latin and emoji characters.
Moreover Pango provides a larger set of font attributes.

Fixes #29, #34
2020-06-26 13:04:28 +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 3c72b84a5c Improve text shape
* transform: translate
* add rtl capacity (currently disabled)
2020-06-24 09:18:24 +02:00
abakkk 579a6bfa32 Persistent attributes
While attributes are not changed in user.css, they are persistent through drawing mode toggling. Css attributes that are modifiable in the user interface are just default attributes.

Close #27
2020-06-23 09:10:25 +02:00
abakkk 64507ba483 Fix menu
* Populate 'Open' and 'Save' submenu on opening. It prevents the 'jump'.
* By removing the previous trick, it now give the key-focus to the first item when opening the menu with 'Menu' key.
2020-06-22 14:42:24 +02:00
abakkk 10384c06e6 Minor, key symbols 2020-06-22 12:45:54 +02:00
abakkk 7f039398d0 Idlize savePersistent 2020-06-22 12:16:17 +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 9c351b5724 Rework of pref and osd texts 2020-06-20 11:17:56 +02:00
abakkk ca943ddd9e Fix and polish transformation builds
* Fix reflection and inversion SVG transformations.
* Remove the Cairo wrappers (crRotate, crScale, crTranslate).
* Cairo transformation builds are now similar to SVG transformation builds.
2020-06-19 20:58:23 +02:00
abakkk f0b3876bac fourth point for curves
Third and fourth points are available by pressing `Ctrl` or `Enter`.
2020-06-19 17:01:16 +02:00
abakkk 4d901db080 use constants for extremum values 2020-06-19 17:01:16 +02:00
abakkk 1e4a847565 replace Mainloop by GLib 2020-06-19 17:01:16 +02:00
abakkk 879fad367c SCALE_DIRECTIONAL -> STRETCH 2020-06-19 17:01:16 +02:00
abakkk a84d71bd5e Remove unnecessary 'setDash' 2020-06-19 17:01:16 +02:00
abakkk 6f9b07b64d Reduce computing by skipping the most 'getContains' calls without notable effect 2020-06-19 17:01:16 +02:00
abakkk 5ca7a5e4a6 fix transformed center getter
Since reflection and inversion introductions, compute center only with the slides of the traslations is not correct.

* `_getCenter` -> `_getOriginalCenter`
* `_getCenterWithSlide` -> `_getTransformedCenter`
* Use pango matrices to compute the new center position since matrices from Cairo, Graphene, ..., are not available with GJS.
* Stock original center and transformed center to not compute it numerous time.
2020-06-19 17:01:16 +02:00
abakkk a33f7b8324 add isStraightLine method to elements 2020-06-19 17:01:16 +02:00
abakkk a569eed459 elementFinder -> elementGrabber 2020-06-19 17:01:16 +02:00
abakkk 22ffa69f68 scale_directional transformation
It combines former `SCALE` and `SCALE_ANGLE` transformations.
2020-06-19 16:55:18 +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 15d3efcbd5 user.css
* Add a warning about updates.
* Add alternative color palettes.
* Change background color (pure dark gray).
2020-06-17 17:59:42 +02:00
abakkk 2658926c44 Add debug constants and helpers 2020-06-17 15:43:23 +02:00
abakkk 317f9e4176 invert fill and stroke painting
Use `cr.fillPreserve, ..., then cr.stroke` instead of `cr.copyPath, ..., cr.stroke, cr.appendPath, cr.fill`
Was there a reason for painting stroke before fill ?
Is something broken ?
2020-06-17 15:37:37 +02:00
abakkk 6a0c0e525a cr.save, cr.stroke, cr.identityMatrix
* Use `cr.save` and `cr.stroke` (Restore the context but not the path).
* Use `cr.identityMatrix` to clean context after transformations.
  Inverting transformations was not enough, in particular with combinations of scale and rotate (`SCALE_ANGLE`, `REFLECTION`, ...).
  Now all elements can be grabbed correctly.
2020-06-17 15:27:18 +02:00
abakkk c26c8cd2b5 misc dash fixes
* Use `setDash([0,0], 0)` to disable dash.
* Disable dashes when drawing the grid.
* Add `crSetDummyStroke` utility function.
2020-06-16 00:06:52 +02:00