Difference between revisions of "Toolbar Rewrite"

From Inkscape Wiki
Jump to navigation Jump to search
(Created page with " A page to explore rewriting the Toolbox widget == Current Situation == Toolbars: * Tools: Now a Flowbox * Snapping: Now a Popover * Main: (File ops, Undo/Redo, Copy/Paste,...")
 
 
Line 9: Line 9:
* Main: (File ops, Undo/Redo, Copy/Paste, etc.) Two possible positions/orientations.
* Main: (File ops, Undo/Redo, Copy/Paste, etc.) Two possible positions/orientations.
* Auxiliary : Changes depending on which tool is active.
* Auxiliary : Changes depending on which tool is active.
*Changing toolbar orientation (currently only Main toolbar).
Classes:
* ToolboxFactory: Only static member functions and constants. Handles:
** Creating toolboxes
** Icon sizes
** Setting which Auxiliary toolbar to show.
** Desktop interface
* UXManager, UXManagerImpl
** Controls if Main toolbar is on top or on right side.
* SPDesktopWidget
** Tightly coupled and might need to be rewritten at the same time.
** This widget should eventually be removed. Some functionality should go into InkscapeWindow and some into CanvasGrid.


=== Widget Structure ===
=== Widget Structure ===

Latest revision as of 08:16, 15 October 2021

A page to explore rewriting the Toolbox widget

Current Situation

Toolbars:

  • Tools: Now a Flowbox
  • Snapping: Now a Popover
  • Main: (File ops, Undo/Redo, Copy/Paste, etc.) Two possible positions/orientations.
  • Auxiliary : Changes depending on which tool is active.
  • Changing toolbar orientation (currently only Main toolbar).

Classes:

  • ToolboxFactory: Only static member functions and constants. Handles:
    • Creating toolboxes
    • Icon sizes
    • Setting which Auxiliary toolbar to show.
    • Desktop interface
  • UXManager, UXManagerImpl
    • Controls if Main toolbar is on top or on right side.
  • SPDesktopWidget
    • Tightly coupled and might need to be rewritten at the same time.
    • This widget should eventually be removed. Some functionality should go into InkscapeWindow and some into CanvasGrid.

Widget Structure

Tools

GtkEventBox  "ToolboxCommon"
  GtkBox     "ToolToolbox
     GtkFlowbox "tool-toolbox"
       GtkFlowboxChild
         GtkToggleButton
       GktFlowboxChild
         ...

Snap

GtkEventBox  "ToolboxCommon"
  GtkBox     "SnapToolbox
     GtkToolbar "snap-toolbox"
       GtkToggleToolButton
         GktToolButton
       GtkToolItem     "tool-item-advanced"
         GtkMenuButton "btn-advanced"
       GtkToolItem     "tool-item-simple"
         GtkMenuButton "btn-simple"

Main

GtkEventBox  "ToolboxCommon"
   GtkToolbar "CommandsToolbar"
     GtkToolButton  "FileNew"
       GtkButton
     GtkToolButton  "FileOpen"
       ...

Auxillary

GtkEventBox  "ToolboxCommon"
  GtkBox     "AuxToolBox"
    GtkGrid  "SelectToolbar"
       GtkToolbar "SubToolbar"
         GtkToolButton
          GtkButton
          ...
    GtkGrid  "NodeToolbar"
       ...