| 1 | |
| 2 | # The bottom bar |
| 3 | |
| 4 | >See bottombar-class-diagram.dia |
| 5 | |
| 6 | Each tool is associated to a bottom bar, providing access the tool's options. |
| 7 | They're named "optionsbar(s)" in the code, and are managed mostly by the |
| 8 | window's **"options manager"**. |
| 9 | |
| 10 | Several tools can share the same bottom bar, so the optionsbars are distinct |
| 11 | from the tools. Although both work according to a "state" pattern. |
| 12 | |
| 13 | While tools are mostly defining the way the image will behave depending on the |
| 14 | user input, optionsbars also define actual GTK widgets, which have to be |
| 15 | responsive (adapt to mobile phones' window size). |
| 16 | |
| 17 | They also have to list options (of course) and actions depending on the current |
| 18 | tool, respond to a few keyboard shortcuts (<kbd>Ctrl</kbd>+<kbd>M</kbd>, |
| 19 | <kbd>Shift</kbd>+<kbd>F10</kbd>, …), and -when it's pertinent- they should |
| 20 | provide access to the minimap and/or the zoom controls. |
| 21 | |
| 22 | ## Classic optionsbar |
| 23 | |
| 24 | the distinctive feature here is the pair of color picking popovers. The default |
| 25 | associated set of options and actions is pretty rich (color, size, cairo |
| 26 | operator, zoom controls, …) and the tools each provide a `Gio.MenuModel` to plug |
| 27 | here, with their specific options. |
| 28 | |
| 29 | ## Selection optionsbar |
| 30 | |
| 31 | all selection tools have roughly the same actions, which are hardcoded in the |
| 32 | optionsbar, although tools can disable actions they don't support (e.g. "Closing |
| 33 | selection", useless for the rectangle selection). |
| 34 | |
| 35 | ## Transformation tools |
| 36 | |
| 37 | each of these tools defines its own optionsbar. All of them have a layout with a |
| 38 | "cancel" button at the left and an "apply" button at the right. The rest can |
| 39 | differ greatly, but it's usually spinbuttons to provide precise control over |
| 40 | numerical values (sizes, angles, percentages, …) in the middle, and a small menu |
| 41 | with options at the right. |
| 42 |