1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:17:35 +00:00

Spreadsheet: Show a small inline doc window for the "current" function

If the user is typing in the cell editor and has the cursor in a
function call, try to show a tip for the arguments of that function:
(cursor denoted by `|`)
```
sum(|
```
should show:
```
sum(cell names)
```
in a tooltip-like window below the editor.
This commit is contained in:
AnotherTest 2020-12-28 23:33:16 +03:30 committed by Andreas Kling
parent aa5b43a2bc
commit f606e78556
6 changed files with 180 additions and 3 deletions

View file

@ -62,13 +62,19 @@ public:
}
private:
virtual void resize_event(GUI::ResizeEvent&) override;
explicit SpreadsheetWidget(NonnullRefPtrVector<Sheet>&& sheets = {}, bool should_add_sheet_if_empty = true);
void setup_tabs(NonnullRefPtrVector<Sheet> new_sheets);
void try_generate_tip_for_input_expression(StringView source, size_t offset);
SpreadsheetView* m_selected_view { nullptr };
RefPtr<GUI::Label> m_current_cell_label;
RefPtr<GUI::TextEditor> m_cell_value_editor;
RefPtr<GUI::Window> m_inline_documentation_window;
RefPtr<GUI::Label> m_inline_documentation_label;
RefPtr<GUI::TabWidget> m_tab_widget;
RefPtr<GUI::Menu> m_tab_context_menu;
RefPtr<SpreadsheetView> m_tab_context_menu_sheet_view;