From 2851fe3aaa34a484f2c927b3794dc2145bc64d68 Mon Sep 17 00:00:00 2001 From: Julian Schacher Date: Wed, 12 May 2021 14:11:25 +0200 Subject: [PATCH] Docs: Describe `Panel._addToPanelBox` logic Describe what `Panel._addToPanelBox` does with the role and indicator it gets. --- docs/About_the_Top_(Menu)Bar.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/About_the_Top_(Menu)Bar.md b/docs/About_the_Top_(Menu)Bar.md index aa6205e..670a4ae 100644 --- a/docs/About_the_Top_(Menu)Bar.md +++ b/docs/About_the_Top_(Menu)Bar.md @@ -16,3 +16,14 @@ These functions basically make sure, that the top bar has a `Panel._leftBox`, `P ### Adding Items to the Top Bar Extensions can add new items to the top bar using `Panel.addToStatusArea()`. + +### About `Panel._addToPanelBox` + +#### Indicator + +`Panel._somethingBox` is an instance of [`St.BoxLayout`](https://gjs-docs.gnome.org/st10~1.0_api/st.boxlayout). +`Panel._addToPanelBox`, then uses `Panel._somethingBox.insert_child_at_index` (which is a method `Panel._somethingBox` inherits from [`Clutter.Actor`](https://gjs-docs.gnome.org/clutter7/clutter.actor)) to add an indicator container to the relevant box. + +#### Role + +`Panel._addToPanelBox` then saves the indicator into `Panel.statusArea` using the role as an index.