Commit Graph

57 Commits

Author SHA1 Message Date
abakkk 738d06cde6 replace DATA_SUB_DIR const with 'data-dir' metadata property 2020-01-06 15:32:38 +01:00
abakkk 8159ff3f7a minor, metadata 2020-01-06 15:29:01 +01:00
abakkk f4ff709fd3 change imports
* Extension -> Me
* ExtensionJs -> Extension
* Use ExtensionUtils instead of convenience with GS 3.32+
2020-01-05 15:44:51 +01:00
abakkk 8f3fbe7aa9 replace 'smoothed-stroke' pref with 'Ctrl' key modifier 2020-01-05 13:42:05 +01:00
abakkk 74f602b268 fix cursor update when closing the menu from save entry
St.Entry clutter_text set the DEFAULT cursor on leave event with a delay and overrides the cursor set by area.updatePointerCursor().
In order to update drawing cursor on menu closed, we need to leave the saveEntry before closing menu.
Since escape key press event can't be captured easily, the job is done in the menu close function.
2020-01-05 12:36:42 +01:00
abakkk 04b119557f fix commit ec2348b1e (drawingContentsHasChanged) 2020-01-04 16:07:53 +01:00
abakkk 5997c9cba3 small trick to prevent the menu from "jumping" on first opening 2020-01-04 12:58:05 +01:00
abakkk ec2348b1ec Add asterisk to the drawing name item if the drawing has changed since last save or open operation 2020-01-04 12:50:43 +01:00
abakkk 17bbe345af new "Open" and "Save" drawing features
* Use a "drawOnYourScreen" subdir in the xdg user data dir
* Info item with the name of the last saved/open json file
* "Open drawing" sub menu with data dir content
* "Save drawing" sub menu with entry
* "Save", "Open previous" and "Open next" keybindings
2020-01-04 00:16:20 +01:00
abakkk 7c7d75a2ba minor, true -> GLib.SOURCE_CONTINUE 2020-01-02 01:44:08 +01:00
abakkk 97c8393835 getActor() utility function
Prepare save and open drawing features.
2020-01-02 01:38:57 +01:00
abakkk 7878af7157 DEFAULT_FILE_NAME and getDateString()
Prepare save and open drawing features.
2020-01-02 01:22:25 +01:00
abakkk f0ac2a21b0 add iconName param to showOsd function
Prepare save and open drawing features.
2020-01-02 00:56:40 +01:00
abakkk 1c6fa54d69 drawing menu style improvement
* Set 'max-height' property to menu actor.
* Reduce size of menu items.
* Rename 'draw-on-your-screen-menu-separator' style class to 'draw-on-your-screen-menu-separator-item' because it is relative to the item actor, not the item._separator actor.
* Rename 'draw-on-your-screen-separator' style class to 'draw-on-your-screen-helper-separator' not to confuse with menu separator.
2019-12-29 15:26:20 +01:00
abakkk 944500fc24 do not create menu when leaving drawing mode
'this.menu.close()' called the getter 'this.menu' that create the menu if it's not exist, which is not wanted when leaving drawing mode.
2019-12-28 13:28:25 +01:00
abakkk bb78937d60 minor, 'DrowOnYourScreen' -> 'DrawOnYourScreen' in licence headers 2019-12-28 13:25:41 +01:00
abakkk 6dd552ae7e fixes after test on GS 3.24
* use var to export extensionJs.manager
* remove duplicated (old) buildPrefsWidget
* set OsdWindow.HIDE_TIMEOUT in a try/catch because HIDE_TIMEOUT is not exported with 'var'
* capture i in callbacks in for(){} (i is changing)
* add 3.24 version as supported
2019-11-29 18:43:42 +01:00
abakkk fbd6ad709c replace separate emitter (DrawingAreaEmitter) by GObject signal
* signals 'show-osd' and 'stop-drawing'
* use level to set no level (null)
* increase maxLevel when level bar is full
2019-11-27 19:01:07 +01:00
abakkk 1af3554f5c improve pointer cursor management
* cross cursor for geometric shapes
* 'hand' cursor for 'ctrl' actions
* default cursor in menu
2019-11-27 06:04:37 +01:00
abakkk fb8e46bb45 fix text shape that displayed 'ctrl' shortcuts 2019-11-25 11:44:18 +01:00
abakkk 52ca619294 Fix lineWidth
* GS 3.34 compatibility for barLevel, see for example status/volume.js StreamSlider.getLevel():
  * 3.32 : "return 100 * this._stream.volume / this._control.get_vol_max_norm();"
  * 3.34 : "return this._stream.volume / this._control.get_vol_max_norm();"
* allow 0 px lineWidth because stroke lines cannot have color with some transparency
* use warning color in OSD and drawing menu when lineWidth is 0 px
2019-10-11 13:26:08 +02:00
abakkk 7d9bb459b4 Create drawing menu on demand 2019-10-11 09:39:17 +02:00
abakkk 8671a9e502 GS 3.34 compatibility
* PanelMenu.Button actor
* PopupMenu.PopupBaseMenuItem, PopupMenu.PopupSwitchMenuItem and PopupMenu.PopupSeparatorMenuItem actor
* Slider.Slider actor and 'value-changed' signal
* PopupMenu.PopupMenuManager init params
* 'org.gnome.settings-daemon.plugins.media-keys' setting values : string -> array of strings
2019-10-11 09:22:37 +02:00
abakkk c531fba30c decrease switch and icon size in menu 2019-03-29 22:57:22 +01:00
abakkk 8780e3607b Add stroke to fill
When 'fill' is selected, the stroke is also drawn.

other: add markup to font menu items
2019-03-29 22:31:13 +01:00
abakkk 7a1fc3acff improve menu icons
use Gio FileIcon instead of Pixbuf because St.Icons made with Pixbuf are
not themable
replace 'stroke' icons with 'fill' icons
bind fill and dashedLine icons with properties
2019-03-29 16:35:18 +01:00
abakkk ec2408043f change middle click
middle click: toggle fill
remove toggleShape method
update prefs and .pot
2019-03-28 22:15:31 +01:00
abakkk d2c285154b add panel indicator and prefs to disable osd notifications and indicator 2019-03-28 22:01:39 +01:00
abakkk 14205295fc add svg attributes in pot 2019-03-28 15:26:10 +01:00
abakkk 695c5a09d9 rework text shape before writing 2019-03-28 02:00:57 +01:00
abakkk 1b799da43d minor, initialize fill when leaving, as other properties 2019-03-28 00:17:13 +01:00
abakkk f7997b9336 line section and font section visibility depends on shape and fill 2019-03-27 22:11:51 +01:00
abakkk 2a0c6536f2 complete context menu implementation (27ea6a8be9)
1. close menu when leaving drawing mode
2. open menu with 'popup-menu' key (doesn't work for closing)
3. update 'disable' methods
2019-03-27 14:23:34 +01:00
abakkk 05e6c7b33f reinstate fill and change dashed shortcut 2019-03-27 00:59:48 +01:00
abakkk 27ea6a8be9 add context menu 2019-03-26 22:28:24 +01:00
abakkk 7712a7a92e wrap around global.play_theme_sound() removal
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/327
2019-03-17 00:59:49 +01:00
abakkk 764d18a090 replace DrawingArea._onStyleChanged() by DrawingArea._updateStyle()
In test of gnome-shell 32 (in VM), 'style-changed' was regularly emitted
during drawing, so all 'this.current...' style properties was
initialized and it was impossible to select style with 'Ctrl+...'
shortcuts.
Now style is gathered on drawing mode entered, which is by the way more
frugal.
Keep watch possible regressions.
2019-03-16 12:35:14 +01:00
abakkk db447b1f5b add markup in osd labels 2019-03-12 23:37:34 +01:00
abakkk da52cfa260 Drawing is hidden by default when leaving drawing mode
It doesn't stay on top of windows because of problems with "desktop"
extensions.
2019-03-12 00:29:14 +01:00
abakkk 72292c41f6 hide container when area is empty 2019-03-11 19:07:01 +01:00
abakkk 4e15c42b86 fix helper scrollbar visibility 2019-03-11 18:24:10 +01:00
abakkk 3dd6507d36 fix toggleSquare 2019-03-11 18:08:19 +01:00
abakkk 2b25958d8c add persistence feature 2019-03-11 17:53:35 +01:00
abakkk 9e6b58d3da fix multi-monitor
1. in removeArea, remove area container from the right parent and do not
remove and destroy helper since helper is child of container (15556e40f4)

2. do not set area and helper position to monitor position value, since their position is relative to the container (that already have the monitor position)
2019-03-10 15:33:38 +01:00
abakkk 39301d9367 fix commit 743d8d7644
Problems with "free drawing" when the brushstroke is very very fast
2019-03-08 13:04:45 +01:00
abakkk 3ebcec5a68 escape key: leave and erase => leave and hide 2019-03-08 12:41:38 +01:00
abakkk 91bb4b26a7 review disable 2019-03-08 12:28:03 +01:00
abakkk 743d8d7644 skip when the size is too small to be visible (3px) 2019-03-08 12:01:19 +01:00
abakkk 26ae9fd784 change class name to avoid potential conflicts with other extensions 2019-03-08 11:37:59 +01:00
abakkk 0de553c748 remind system screenshort shortcuts in helper 2019-03-07 19:22:19 +01:00