Description: Create an object of a default size if the user does not specify a size by dragging. Object will be placed centered under the click. May be a little more intuitive for new users that expect a mouse-click to place the object. And allows for fast creation of many identically sized objects when combined with double click tool selection. Drag functionality will remain in place. Steps to Reproduce: 1.Select any shape tool 2.Click and release on the document without dragging Actual Results: No object is created Expected Results: Object of a default size should be created under cursor Reproducible: Always User Profile Reset: No Additional Info: Object of a default size should be created under cursor
Let's add design team into the loop. Btw. you should refer to the bug id in your patch in the form tdf#149141 You can amend your patch https://wiki.documentfoundation.org/Development/gerrit/SubmitPatch#Submitting_a_new_version
Do users really expect an object to be created with some default size? Do you have an application in mind that works like that? Could imagine benefit for accessibility, OTOH. Keyboard only _Insert > _Shape > _Basic Shapes > _Rectangle + F4 (properties) to enter the exact size. Doing so means to loose the Point & Draw functionality - you cannot click the menu item anymore and have either a default size or a mouse interaction. So my take is to not do it. Little benefit with some costs on consistency comes with high effort. Other ideas?
"Creation of default shape by single click" is implemented in MS Office and SoftMaker Office. Users coming from these office suites might expect it. (In reply to Heiko Tietze from comment #2) > Keyboard only _Insert > > _Shape > _Basic Shapes > _Rectangle + F4 (properties) to enter the exact > size. Do you mean this in F6 keyboard mode? If yes, the proposed additional mouse action would not conflict with the keyboard only workflow. The proposed patch is in https://gerrit.libreoffice.org/c/core/+/134499
Tested the patch and it works like a charm. In fact one has to click twice, first in the menu/toolbar and second at the target position. Unless before the patch, where zero-sized objects got removed, it creates now a shape with 1cm width/height. This is a sensible default and I wouldn't make it variable. And I also wouldn't make this feature optional. So +2 to the patch. Does not work for 3D objects, lines and polygons, and not at all in Writer.
Thanks Buovjaga I'll be sure to add tdf# to the commit message in the next amendment. I should point out a couple of things I'm aware of. Grid snapping rules should be followed. So if the user has grid snapping enabled the object should be created centered to the nearest grid rather than the exact click position. Secondly, in the patch bReturn value will always be true. There is no path where it can be false. I think bReturn represents wether or not the mouse up event has been handled successfully, but also seems to be tied to object creation success. Either way I should check if the default object was created before assigning bReturn to true. This would maintain the same behaviour as before.
Ok in latest patch revision the objects now snap to grid if enabled, which feels better. And bReturn can be false if the object is not successfully inserted. Thanks for testing Heiko Tietze. I suppose if this was to become a default behaviour then it would make sense that 3D objects, lines, and anything else can follow the same rules.
Patch 4 has defaults for Lines/Connectors and 3D objects. The only type missing is freehand Polygons and curves, but because the tool clearly shows a freehand icon by default, I'm not sure how useful it would be to create defaults for any of those. Having said that I've also got it working in Writer for I think every shape type (even the freehand tools seem to all have a default specified). So it wasn't actually that much work. I haven't submitted the Writer changes yet. I'm not sure if I should submit as part of the same patch or not.
Actually no Writer has defaults for freeform lines, but not polygons or curves. Which makes sense. I'll submit tomorrow to the same patch once I've checked it over.
(In reply to AshSinc from comment #7) > I'm not sure if I should submit as part of the same patch or not. My take: in case of shared code do one patch, if the modules are completely independent make it two.
That sounds like a sensible rule. Ok Writer patch is here : https://gerrit.libreoffice.org/c/core/+/134682 Everything has a default except polygons and curves. There is a little code duplication now. There are a few ways to fix this but I'll leave it open to discuss before doing anything. The only place that the existing CreateDefaultObject() function is used is in /home/ash/projects/libreoffice/sw/source/uibase/uiview/viewdraw.cxx. Although I don't know how this works. In Draw its Ctrl+Click on a tool. In Writer nothing seems to happen.
AshSinc committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3aa5aa83039b04f1412185e49cad9e3b694d49ca tdf#149141 - Writer - Added default object creation when drag size too low It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
AshSinc committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/9e7597a1cc92e06d61acf87a8c560de3b4fdabf8 tdf#149141 - Added default object creation when drag size too low It will be available in 7.4.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.