Bug 161296

Summary: UI: Convert the functions list in the functions deck to collapsible sections (tree-like view)
Product: LibreOffice Reporter: Ahmed Hamed <ahmedhamed3699>
Component: CalcAssignee: Ahmed Hamed <ahmedhamed3699>
Status: ASSIGNED ---    
Severity: enhancement CC: ahmedhamed3699, andreas.heinisch, heiko.tietze
Priority: medium    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 92416    

Description Ahmed Hamed 2024-05-27 15:04:01 UTC
Description:
This is a new feature that can enhance the user experience of dealing with the functions deck, it will improve searching for a specific function.

Actual Results:
The current design uses a list to show the functions, which is annoying because you need to scroll down till you find your desired section.

Expected Results:
It would be better to go quickly to your needed section using the collapsible view, then search for your function.


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 342670dc6b0fc5b93a40b9cf86b8cca67fac88a3
CPU threads: 4; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 1 Andreas Heinisch 2024-06-18 15:28:42 UTC
As discussed in the meeting here some code pointers:
Function Wizard [1]
Functions in the side pane [2]
Panel Factory [3]
UI Elements in the panel factory [4]


[1] https://opengrok.libreoffice.org/search?full=funcpage&project=core
[2] https://opengrok.libreoffice.org/search?full=functionpanel&project=core
[3] https://opengrok.libreoffice.org/xref/core/sc/source/ui/sidebar/ScPanelFactory.cxx
[4] https://opengrok.libreoffice.org/xref/core/sc/source/ui/sidebar/ScPanelFactory.cxx#48

Let me know if you need more code pointers or any help.
Comment 2 Ahmed Hamed 2024-06-25 12:19:31 UTC
I think I am a little stuck here.
I am using the weld::TreeView to implement the collapsible sections, and the list in the FD is actually implemented using weld::TreeView. So, I was going to make this conversion by appending categories, and then append functions as children to these categories, is this right ?
I am doing that by adding this function to the TreeView class:

void append(const OUString& rStr, TreeIter* pRet)
{
    insert(nullptr, -1, &rStr, nullptr, nullptr, nullptr, false, pRet);
}

So I can get a pointer to the inserted category node in pRet, and then call this function to insert the all the functions in this category:

void append(const TreeIter* pParent, const OUString& rStr)
{
     insert(pParent, -1, &rStr, nullptr, nullptr, nullptr, false, nullptr);
}

But this is not working, so how can I append a child to a parent in a TreeView ? Or is the TreeView not suitable for this job ?
Also I am showing expanders in the .ui file, but they didn't appear, do they only appear if there is a correct parent-child relation ?