Bug 162069 - New sheet opening with the functions deck puts focus on search
Summary: New sheet opening with the functions deck puts focus on search
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Ahmed Hamed
URL:
Whiteboard: target:25.2.0
Keywords:
Depends on:
Blocks: 92416
  Show dependency treegraph
 
Reported: 2024-07-17 11:03 UTC by Heiko Tietze
Modified: 2024-08-20 09:06 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Heiko Tietze 2024-07-17 11:03:17 UTC
When creating a new sheet the initial focus should be in the document.

Ahmed, I've taken the liberty to directly assign the issue to you :-).

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 450739e92e6f90060e5fdfa42ae291b1abaebd7a
CPU threads: 32; OS: Linux 6.9; UI render: default; VCL: kf5 (cairo+xcb)
Locale: de-DE (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Ahmed Hamed 2024-08-04 19:19:07 UTC
I think I need any code pointers here. There are so many classes and It is overwhelming.
Comment 2 Heiko Tietze 2024-08-05 06:34:15 UTC
Michael, do you have a code pointer at hand?
Comment 3 Michael Weghorn 2024-08-05 12:51:52 UTC
(In reply to Heiko Tietze from comment #2)
> Michael, do you have a code pointer at hand?

When hovering over the "+" button in Calc, a tooltip "Add new sheet (right click to see all non-hidden sheets)" is shown.

Searching for that shows where that string is defined:

    $ git grep "Add new sheet"
    include/svtools/strings.hrc:#define STR_TABBAR_HINT_ADDTAB_SHEETS           NC_("STR_TABBAR_HINT_ADDTAB_SHEETS", "Add new sheet (right click to see all non-hidden sheets)")

And searching where that is used gives: 


    $ git grep STR_TABBAR_HINT_ADDTAB_SHEETS
    include/svtools/strings.hrc:#define STR_TABBAR_HINT_ADDTAB_SHEETS           NC_("STR_TABBAR_HINT_ADDTAB_SHEETS", "Add new sheet (right click to see all non-hidden sheets)")
    svtools/source/control/tabbar.cxx:            m_xAddButton->set_tooltip_text(SvtResId(STR_TABBAR_HINT_ADDTAB_SHEETS));

So looking at code involving that `m_xAddButton` from svtools/source/control/tabbar.cxx could be a good starting point.
Comment 4 Ahmed Hamed 2024-08-05 22:07:12 UTC
thank you so much Michael!
Comment 5 Commit Notification 2024-08-14 09:20:50 UTC
AhmedHamed committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b8593ef96da5a6090a03812247a0a7c3651546a6

tdf#162069 Initial focus is in the document when creating a new sheet

It will be available in 25.2.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.