Difference between revisions of "Sidebar"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Added notes about controller items.)
m (Overview)
 
(74 intermediate revisions by 7 users not shown)
Line 1: Line 1:
The sidebar (working title) is a new feature likely to be in the 4.0 release.  It combines ideas and code from both the [[Symphony]] sidebar and the OpenOffice [[Impress]] task pane.
+
The sidebar is a UI feature that was introduced for all OpenOffice applications in version 4.0.  It is based on the [[Symphony]] Properties Panel which in turn is based on the old [[Impress]] task pane. The sidebar looks like this:
  
The UX part of the work is described on another [[AOO_UX_Design_Exploration_-_Task_Pane_Content_-_Information_Design|page]].  This page focuses on the API design and implementation.
+
[[File:Sidebar-Writer.png|600px|center]]
  
Help in whatever form (writing code, designing the UI, testing) is welcome.
 
  
==Status==
+
Information about the implementation of the sidebar and how to extend it with new panels can be found in the [[Sidebar for Developers]] page.
  
*Designed API (new services and interfaces) and configuration for declaration of sidebar decks and panels and notification of context changes.
+
A [[#Glossary|glossary]] is available below.
*Initial implementation as test of the design.  Most of the changes can be found in [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/sfx2/source/sidebar/ sfx2/source/sidebar] and [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/svx/source/sidebar/ svx/source/sidebar].
+
* You can find the SidebarWorkbench extension [http://people.apache.org/~af/sidebar/SidebarWorkbench.oxt here].  Note that these work only with the recent changes in branch <code>sidebar</code>.  A developer build is available for Windows [http://people.apache.org/~af/sidebar/Apache_OpenOffice_3.5.0_Win_x86_install-arc_en-US.zip here].
+
* Migration of first Symphony panel is progressing well.  Simple theming is already in place, see screenshots below.
+
  
Current screenshots:
 
  
Migration of Symphony text properties panel (work in progress).  With original Symphony icons (far left) and OpenOffice icons (all other) and with different colors for panel titles and panel backgrounds:
+
==Overview==
  
[[File:sidebar-2013-01-18-a.png|200px]], [[File:sidebar-2013-01-18-b.png|200px]], [[File:sidebar-2013-01-18-c.png|200px]], [[File:sidebar-2013-01-18-d.png|200px]]
+
The sidebar window is located on the right side of the edit views of Writer, Calc, Impress, Draw, Base.  It contains one or more [[#Panels|panels]], based on the current document context.  Panels are organized into [[#Decks|decks]].  A [[#Tab_Bar|tab bar]] on the right side of the sidebar allows to switch between different decks.
  
Simple panels, provided by a Java extensionMenu for switching between decks and for hiding or showing decks:
+
The [[#Properties|Properties]] deck is context sensitiveWhen text is being edited then it contains panels for changing the font or text attributes,  when a graphical object is selected then other panels give access to fill and line style as well as the object's position and size.
  
[[File:sidebar-a-2013-01-16.png|150px]], [[File:sidebar-b-2013-01-16.png|200px]], [[File:sidebar-c-2013-01-16.png|100px]]
+
<br>[[Image:Sidebar-Screenshot-Writer-Context-Text.png|300px]] [[Image:Sidebar-Screenshot-Writer-Context-Shape.png|300px]] [[Image:Sidebar-Screenshot-Writer-Context-Graphic.png|300px]]<br>''Different panels in Properties deck for different contexts (from left to right): text editing, logo pasted as outline, logo pasted as bitmap''
  
Past activities:
 
* Created a new sidebar that at this moment can display panels that are provided
 
** by a new extension (see above),
 
** by already existing extensions using the XUIElementProvider interface family,
 
** by Impress (but there are still severe painting problems).
 
* The sidebar menu already works.  It is almost identical to its Symphony counterpart with one additional entry for docking or undocking the sidebar.
 
* Individual panels can be collapsed or expanded.
 
* The older and unfinished sidebar support that was done when OpenOffice was developed by Oracle is still active as a reference.
 
  
==Resources==
+
A panel is basically a mix of a toolbar and a non-modal dialog.  That means that sidebar panels do not lock the document.  The user can freely mix working in the edit view to eg enter text and use the [[#Text|Text]] panel to change text attributes.
  
* UX
+
At the moment, toolbars and sidebar panels share many functions.  For example, the buttons for making text bold or italic exist in both the text toolbar and the [[#Text|Text]] panel. This duplicity is the result of a design decision to allow users to gradually learn to use the sidebar. It is our plan to reduce functions provided in toolbars and provide them only in the sidebar. The speed and scope of this change depends on feedback from our users.
**[[AOO_UX_Design_Exploration_-_Task_Pane_Content_-_Information_Design|UX design exploration]]
+
**[[AOO_UX_Design_Exploration_-_Docked_Task_Pane_Container_-_Pane_Header_User_Interface_Design|Pane Header UI Design]]
+
**[[AOO_UX_Design_Exploration_-_Task_Pane_Content_Panel_-_User_Interface_Design_Proposals|UX Design propoals]]
+
* Symphony
+
** Assessment of the [[AOO_Symphony_UX_Migration/Merge_Analysis_-_Task_Pane|migrating the Symphony sidebar]].
+
** Older proposal to use the [[Sidebar_Proposal_by_IBM|Symphony sidebar]].
+
* AOO
+
** Overview of an existing but unfinished attempt of implementing [[Framework/Article/Tool_Panels_Internals|tool panels]].
+
** Introduction to [[Framework/Article/Tool Panels|writing tool panels]].
+
** Description of the [[Drawing framework|drawing framework]], that is used by the Impress tool panel.
+
  
==Glossary==
+
The width of the sidebar is variableThe controls in its panels are adjusted accordingly. When the sidebar becomes too small to be usable it collapses to the tab bar.  This transitional state is indicated by an arrow that is displayed in place of the deck. A click on one of the buttons on the tab bar restores the deck to its former width.
Work in progressComments are welcome.
+
  
[[File:SidebarNames.png|thumb|200px|Schematic overview of sidebar components.  Location of elements do not reflect UX design.]]
+
[[File:Sidebar-Different-Widths.png|640px]]
;sidebar: Name of the feature and name of the control including all its components (icon bar, content panels).
+
:Also known as task pane(l) or tool pane(l)
+
;tab bar: Similar to a vertical tool bar.  Clicking on buttons switches between sidebar decks.
+
;deck: Contains one or more content panels.  Only one deck is visible at any one time.
+
;content panel: Displays information about the document and/or provides the means for document modification.
+
:Each content panel focuses on one topic like font, table or shape properties.
+
:There may be more than one content panel in a deck.
+
:Examples are the task panels of the Impress task pane or the property views of the Symphony sidebar.
+
;title bar: Displays the title for the current sidebar deck.
+
:Can contain a closer button.
+
;content panel title: Displays the title for one content panel. Optional when there is only one content panel.
+
;configuration menu button: Opens a popup menu that allows switching between decks and also allows the activation and deactivation (tab is not shown) of decks.
+
  
==Implemenation design==
+
==Panels==
 +
Eleven property panels have been migrated from IBM Lotus Symphony: Alignment, Area, Cell Appearance, Graphic, Line, Number Format, Page, Paragraph, Position and Size, Text and Wrap.
 +
Seven panels come from the old Impress tool panel: Available for Use, Custom Animation, Layouts, Recently Used, Slide Transition, Table Design, Used in This Presentation.
 +
Four are non-modal (ie non locking) dialogs: Functions, Gallery, Navigator, Styles and Formatting.
 +
One is new: Insert Shapes.
  
The sidebar consists of two major components:
+
[[File:Sidebar-Panels.png|500px]]
*The buttons in the vertical tab bar on the right switch manually between sidebar decks.
+
*The content area contains a two-tier hierarchy of deck and content panels.  There is exactly one deck visible at any one time.  It contains one or more content panels.  A content panel can be displayed expanded or collapsed.
+
  
The set of visible deck and content panels changes when a context change is broadcastContext changes occur for example when in Writer the cursor is moved from text into a table or when in Impress text editing of a shape is activated.
+
Some of these are displayed in the context sensitive 'Properties' deck, others are displayed in a deck on their own.  In that case the panel title bar is usually not displayed and the deck title is the same as the panel titleWhen the panel title bar is shown then a mouse click on it collapses the panel to just its title bar.  Another click and the panel is expanded to its former size.
  
Decks and context panels are specified via configuration and UNO interfaces and thus can be implemented not only in the AOO core code but also by extensions.
+
[[File:Sidebar-Expand-Collapse.png|350px]]
  
 +
Some panels have a 'More Options' button in their title bar.  A click on it opens a dialog with many more options than would fit into the panel.  These dialogs, however, are modal, ie. the edit view is locked while the dialogs are open.
  
===Context change notification===
+
[[File:Sidebar-more-options.png|500px]]
  
Context changes are broadcast via the new
+
===Alignment (Calc only)===
ui::ContextSwitchEventMultiplexer singleton (which is based on the equally
+
Alignment of cell text (horizontal, vertical, rotation)
new ui::EventMultiplexer service).
+
  
Context change broadcasts have to be manually inserted into
+
[[File:Sidebar-Panel-Alignment.png|100px]]
application code.
+
  
Notifications about context changes are restricted to single views by using the XController as
+
===Area===
selector: an XController object is passed to ui::EventMultiplexer::addEventListener() and
+
Fill style of shapes like color, gradient, bitmap, hatch, transparency.
ui::EventMultiplexer::broadcastEvent() methods.
+
  
The sidebars (there is one per document window) listen for context change
+
[[File:Sidebar-Panel-Area.png|100px]]
notifications and rearrange the set of visible decks and panels
+
according to the configuration entries for each deck and panel.
+
  
There will be a predefined standard set of contexts but extensions can
+
===Available for Use (Impress only)===
provide decks and panels for new contexts and can also notify context changes for them.
+
List of all available templates.
  
===Content panels===
+
[[File:Sidebar-Panel-AvailableForUse.png|100px]]
  
Decks and content panels are specified via the configuration.  The
+
===Cell Appearance (Calc only)===
new Sidebar.xcs defines schemas for decks and content panels that
+
Cell background color and border.
contain:
+
* UI title
+
* Application and context names for which a deck or a content panel is to be visible.
+
* Icons for normal and high-contrast mode.
+
* Simple layout information. Two different schemas will be supported
+
*# Use all the available space (distributed equally when more than one panel reuests this)
+
*# Vertical stack.  The default for content panels migrated from Symphony.  Requres content panels to support a new interface ui::XVerticalStackLayoutElement with the method getHeightForWidth()
+
 
+
For the actual creation of panel objects (decks do not need per-object implementation) the existing ui::UIElementFactoryManager and the configuration entries in the
+
<application>WindowState configuration files are used.
+
  
===Sidebar===
+
[[File:Sidebar-Panel-CellAppearance.png|100px]]
  
It is the responsibility of the sidebar to display the right set of
+
===Custom Animation (Impress only)===
content panels for the current combination of application (writer,
+
Add or modify animations of shapes.
calc, impress, draw, base) and context (eg text-editing,
+
table-is-selected).
+
  
The visible set of deck and content panels changes on three occasions:
+
[[File:Sidebar-Panel-CustomAnimation.png|100px]]
# A context change is notified via the ContextSwitchEventMultiplexer
+
# User clicks on one of the buttons in the sidebar tab bar.
+
# Explicit requests to show a certain deck or panel (used by Impress to show the layout panel when the user opens the page context menu and clicks Slide->Slide Layout)
+
  
 +
===Functions (Calc only)===
 +
Insert functions (mathematical, string related, other) to a Calc cell.
  
==Implementation Work==
+
[[File:Sidebar-Panel-Functions.png|100px]]
  
Using bugzilla issue [https://issues.apache.org/ooo/show_bug.cgi?id=121420 121420].
+
===Gallery===
 +
Gallery dialog as sidebar panel.
  
The list of open and done parts of the sidebar implementation are (to be expanded and color coded):
+
[[File:Sidebar-Panel-Gallery.png|100px]]
  
=== Content Change Notification ===
+
===Graphic===
* EventMultiplexer
+
Adjust bitmap attributes like brightness, contrast, colors, gamma.
** New service/singleton [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/ContextChangeEventMultiplexer.idl?view=markup ui::ContextChangeEventMultiplexer]
+
** New interface [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventMultiplexer.idl?view=markup ui::XContextChangeEventMultiplexer]
+
** New interface [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/XContextChangeEventListener.idl?view=markup ui::XContextChangeEventListener]
+
** New struct [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/offapi/com/sun/star/ui/ContextChangeEventObject.idl?view=markup ui::ContextChangeEventObject]
+
** Implementation of [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/framework/source/services/ContextChangeEventMultiplexer.cxx?view=markup ContextChangeEventMultiplexer]
+
* Add context change notification for Writer, Calc, Impress, Draw, Base
+
  
=== Decks and content panels ===
+
[[File:Sidebar-Panel-Graphic.png|100px]]
* Configuration (all done)
+
** New configuration Schema [http://svn.apache.org/viewvc/openoffice/branches/sidebar/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs?view=markup org/openoffice/Office/UI/Sidebar.xcs]
+
*** New template for decks
+
*** New template for content panels
+
* Implement manager for decks and panels (done)
+
* Example code for testing and as tutorial (work in progress)
+
* Migration of Symphony decks and content panels for Writer, Calc, Base (started)
+
* Migration of AOO decks and content panels for Impress
+
  
=== Sidebar ===
+
===Insert Shapes (Draw only)===
* Tab bar (done)
+
Buttons and drop down menus for inserting shapes into Draw documents.
* Tabs (done)
+
** Icons and high contrast icons, read from configuration (done)
+
** Test with internal and external (extension) code (done)
+
* Title bars for decks and content panels (done)
+
* Outer layouting of content panels (done)
+
** Distribution of vertical space between panels
+
** Collaps and expand panels (done)
+
* Management of context changes (done)
+
** Read specification of decks and content panels from configuration (done)
+
** Connect to EventMultiplexer and listen for content changes
+
** Update visible deck and panels on context change
+
* Dockable child window as container of sidebar
+
* Configuration menu (done)
+
  
==How to help==
+
[[File:Sidebar-Panel-InsertShapes.png|100px]]
  
The migration of the Symphony panels to OpenOffice is a lot of workHere is how you can help.
+
===Layouts (Impress only)===
 +
Assign a predefined layout to a slideThere are different sets of layouts for the different edit modes standard, handout and notes.
  
===Introduction===
+
[[File:Sidebar-Panel-Layout-Standard.png|100px|top]] [[File:Sidebar-Panel-Layout-Handout.png|100px|top]] [[File:Sidebar-Panel-Layout-Notes.png|100px|top]]
The content in the sidebar is organized into decks, panels and tabs. There is always exactly one deck visible. It can contain one or more panels.  Tabs are allow manual switching between decks.
+
In general the current deck and its panels is defined by the current context.  A context consists of an identifier for the application and one identifier for the actual context like text editing, cursor in table, image editing and so on.
+
  
 +
===Line===
 +
Adjust color, width and style of lines and outlines.
  
Both UNO API and configuration represent a context with two strings:
+
[[File:Sidebar-Panel-Line.png|100px]]
; UNO : com/sun/star/ui/ContextChangeEventObject
+
; registry : org/openoffice/Office/UI/Sidebar.xcs / Context
+
For the C++ implementation there is a enum wrapper that allows switch() statements:
+
    sfx2/sidebar/EnumContext.hxx
+
  
===Notification of context changes===
+
===Navigator===
 +
The navigator dialog as sidebar panel.  Small differences between the different applications.
  
Notification of context changes is done via one single event multiplexer that is used by all documents and views:
+
[[File:Sidebar-Panel-Navigator-Writer.png|100px]] [[File:Sidebar-Panel-Navigator-Calc.png|100px]] [[File:Sidebar-Panel-Navigator-Impress.png|100px]]
;service: com/sun/star/ui/ContextChangeEventMultiplexer.idl
+
;interface: com/sun/star/ui/XContextChangeEventMultiplexer.idl
+
There is a C++ convenience wrapper in svx:
+
    svx/inc/sidebar/ContextChangeEventMultiplexer.hxx
+
that has a single static method:
+
    static void NotifyContextChange (
+
        const cssu::Reference<css::frame::XController>& rxController,
+
        const ::sfx2::sidebar::EnumContext::Context eContext);
+
It hides the messy instantiation of the UNO singleton and conversion of the parameters.
+
The rxController is used for two things:
+
# Determine the application and fill in the right string/identifier in the resulting context change event.
+
# Allow listeners to be notified only for context changes of a single view
+
The eContext argument is defined in
+
    sfx2/sidebar/EnumContext.hxx
+
  
====Task====
+
===Number Format (Calc only)===
* Add calls to ContextChangeEventMultiplexer::NotifyContextChange() whenever a relevant context change occurs so that the sidebar can display the appropriate deck and panels.
+
Set the number format of selected cells.
* Add missing contexts to EnumContext.hxx and Sidebar.xcs and provide a word or two of explanation.
+
  
====Tips====
+
[[File:Sidebar-Panel-NumberFormat.png|100px]]
Look for Update calls for SID_SVX_PROPERTY_CONTEXT
+
    in sfx2/source/control/dispatch.cxx, SfxDispatcher::Update_Impl()
+
    and sfx2/source/control/bindings.cxx, IMPL_LINK(SfxBindings, NextJob_Impl...)
+
and for calls to   
+
    sfx2/source/view/viewfrm.cxx, SfxViewFrame::GetPropertyContextId()
+
  
====Examples====
+
===Page (Writer only)===
 +
Set page properties like orientation, margin or size.
  
Notification of start of text editing in Draw/Impress:
+
[[File:Sidebar-Panel-Page.png|100px]]
    sd/source/ui/func/futext.cxx, FuText::DoExecute()
+
  
Notification of Draw/Impress having been started:
+
===Paragraph===
    sd/source/ui/view/ViewShellBase.cxx, ViewShellBase::Activate()
+
Adjust paragraph properties.
  
 +
There are small differences for different contexts.<br>From left to right: Impress/Table, Writer/Annotation, Writer/DrawText, Writer/Table, Writer/Text.
  
===Migration of property pages===
+
[[File:Sidebar-Panel-Paragraph-Impress-Table.png|100px|top|Impress/Table]]
 +
[[File:Sidebar-Panel-Paragraph-Writer-Annotation.png|100px|top|Writer/Annotation]]
 +
[[File:Sidebar-Panel-Paragraph-Writer-DrawText.png|100px|top|Writer/DrawText]]
 +
[[File:Sidebar-Panel-Paragraph-Writer-Table.png|100px|top|Writer/Table]]
 +
[[File:Sidebar-Panel-Paragraph-Writer-Text.png|100px|top|Writer/Text]]
  
The Symphony property pages represent much functionality that in AOO can be found in toolbarsThat may explain the extensive use of ToolBox controls in the panels.
+
===Position and Size===
 +
Change position, size and rotation of shapes.  Not all of these attributes can be modified in any contextFree positioning is not supported in Writer.  Bitmaps can not be rotated in Writer.
  
====Task====
+
This results in three different versions of the panel: with position, size and rotation (left) with size and rotation (center) only size (right)
* Migrate the panels listed in http://wiki.openoffice.org/wiki/AOO_Symphony_UX_Migration/Merge_Analysis_-_Task_Pane or come up with a better list.
+
* Locate the panel implementation in the Symphony code branch.  Typical places are:
+
** svx/source/propertypanel/
+
** sw/source/ui/propertypanel/
+
** sc/source/ui/propertypanel/
+
** sd/source/ui/propertypanel/
+
* Use ::sfx2::sidebar::SidebarPanelBase and ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
+
as base classes.
+
These take care registering at the ContextChangeEventMultiplexer and item controllers.
+
* Replace member declarations of controls with scoped_ptrs, so that the controls can be created by a factory and can have a different, derived class.
+
Replace
+
  ToolBox maToolBoxIncDec;
+
with
+
  ::boost::scoped_ptr<ToolBox> mpToolBoxIncDec;
+
Then, in the constructor replace
+
  maToolBoxIncDec (this, SVX_RES(TB_INCREASE_DECREASE)),
+
with
+
  mpToolBoxIncDec(sfx2::sidebar::ControlFactory::CreateToolBox(this, SVX_RES(TB_INCREASE_DECREASE))),
+
* Handle context changes:
+
Replace
+
    virtual void Init(PropertyContextType nContextId);
+
with
+
    virtual void HandleContextChange (
+
        const ::sfx2::sidebar::EnumContext aContext);
+
In the implementation replace
+
    void SvxTextPropertyPage::Init(PropertyContextType nContextId)
+
    {
+
        meContextType = nContextId;
+
        if(  nContextId == PROPERTY_CONTEXT_SC_CELL ||  nContextId == PROPERTY_CONTEXT_SC_PIVOT ) //modified::add s
+
with
+
    void TextPropertyPanel::HandleContextChange (
+
        const ::sfx2::sidebar::EnumContext aContext)
+
    {
+
        if (maContext == aContext)
+
        {
+
            // Nothing to do.
+
            return;
+
        }
+
        maContext = aContext;
+
        switch (maContext.GetCombinedContext())
+
        {
+
            case CombinedEnumContext(Application_Calc, Context_Cell):
+
            case CombinedEnumContext(Application_Calc, Context_Pivot):
+
The first lines (above the switch() statement) could be moved into the base class.
+
* Make a similar replacement wherever meContextType is used in if() statements.
+
* Replace the use of SfxPropertyPageController with ::sfx2::sidebar::ControllerItem.  Controller items connect items (basically the model of toolbar buttons) and state change listeners (the panel that you are migrating).
+
In the header replace
+
  SfxPropertyPageController maFontNameControl;
+
with
+
  ::sfx2::sidebar::ControllerItem maFontNameControl;
+
In the constructor replace
+
    maFontNameControl (SID_ATTR_CHAR_FONT, this, GetBindings())
+
with
+
    maFontNameControl (SID_ATTR_CHAR_FONT, *pBindings, *this)
+
  
Also transform
+
[[File:Sidebar-Panel-PositionAndSize-Impress.png|100px|top|Impress]]
    void SvxTextPropertyPage::StateChangedImpl(USHORT nSID, SfxItemState eState, const SfxPoolItem* pState)
+
[[File:Sidebar-Panel-PositionAndSize-Writer-Draw.png|100px|top|Writer/Draw]]
into
+
[[File:Sidebar-Panel-PositionAndSize-Writer-Bitmap.png|100px|top|Writer/Graphic]]
    virtual void NotifyItemUpdate(
+
        const sal_uInt16 nSId,
+
        const SfxItemState eState,
+
        const SfxPoolItem* pState);
+
to be informed of state changes.
+
  
* Replace icons
+
===Recently Used (Impress only)===
Where possible we should use the standard AOO icons (although in same places we should thing about replacing the AOO icons with Symphony icons).
+
List the recently used templates/master pages.
Find the uno command name and do a replacement like:
+
    maToolBoxIncDec.SetItemImage(TBI_INCREASE, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgIncreaseHigh : maImgIncrease);
+
    maToolBoxIncDec.SetItemImage(TBI_DECREASE, Application::GetSettings().GetStyleSettings().GetHighContrastMode()? maImgDecreaseHigh : maImgDecrease);
+
with
+
    mpToolBoxIncDec->SetItemImage(TBI_INCREASE, GetIcon(A2S(".uno:Grow")));
+
    mpToolBoxIncDec->SetItemImage(TBI_DECREASE, GetIcon(A2S(".uno:Shrink")));
+
The GetIcon() method takes care (hopefully) of the high contrast mode.
+
* One source file may contain more than one class definition.  It is good practice to separate these into their own files.  And it makes it easier for others to work on other panels in the same source file.
+
* Use namespaces instead of the Svx class prefixes, ie use svx::sidebar namespace (or sw::sidebar, etc) and get rid of the Svx class prefixes.
+
  
====Tips====
+
[[File:Sidebar-Panel-RecentlyUsed.png|100px|top]]
Do the Draw/Impress panels last, these are more complicated than the others due to their use of an Impress specific framework.
+
  
====Examples====
+
===Slide Transition (Impress only)===
See svx/source/sidebar/text/TextPropertyPanel.cxx in the sidebar branch for the first migrated panel.
+
Add or modify transition animations between slides.
  
==Existing implementation==
+
[[File:Sidebar-Panel-SlideTransition.png|100px|top]]
  
Not all the API design and implementation work has to be started from scratch.  There several parts that can be used/reused/adapted.
+
===Styles and Formatting===
 +
The styles and formatting dialog, aka Stylist, as sidebar panel.
  
===In main/sd/===
+
There are small differences between the applications: (from left to right) Writer, Calc, Impress
The [[drawing framework]] is used for the Impress taskpane, all Impress views and the slide show.  A tree of URLs (called a configuration) defines the different layers of containers (windows) and views (taskpane panels).  SD views only modify a configuration, update and synchronization of the associated view shells is left to the ConfigurationController.
+
  
Contextual changes of tool bars are handled in SD in a single place by the ToolBarManager. It receives notifications about context changes by registering as listener at the EventMultiplexer.
+
[[File:Sidebar-Panel-StylesAndFormatting-Writer.png|100px|top]]
 +
[[File:Sidebar-Panel-StylesAndFormatting-Calc.png|100px|top]]
 +
[[File:Sidebar-Panel-StylesAndFormatting-Impress.png|100px|top]]
  
Example:
+
===Table Design (Impress only)===
When an Impress shape enters text edit mode then sd::View sends an
+
Properties of tables in Impress.
event to the EventMultiplexer.  That forwards the event to the
+
ToolBarManager.
+
The ToolBarManager checks its set of rules, finds the one that
+
activates the text edit tool bar and replaces the current context bar
+
with the text edit bar.
+
  
 +
[[File:Sidebar-Panel-TableDesign.png|100px|top]]
  
 +
===Text===
 +
Adjust text properties like font, size, bold, colors.
  
 +
There are small differences in different applications and contexts.  Not all controls/attributes are available everywhere.
  
Screenshots from the developer snapshots.
+
[[File:Sidebar-Panel-Text-Calc.png|100px|top]]
In all three screenshots mouse is over the third button from the top in the sidebar, button above is selected.
+
[[File:Sidebar-Panel-Text-Impress-Table.png|100px|top]]
Click to enlarge.
+
[[File:Sidebar-Panel-Text-Writer.png|100px|top]]
 +
[[File:Sidebar-Panel-Text-Writer-Annotation.png|100px|top]]
  
Linux: [http://people.apache.org/~af/sidebar/screenshots/screenshot-linux-sidebar.png http://people.apache.org/~af/sidebar/screenshots/screenshot-linux-sidebar-small.png] Mac: [http://people.apache.org/~af/sidebar/screenshots/screenshot-mac-sidebar.png http://people.apache.org/~af/sidebar/screenshots/screenshot-mac-sidebar-small.png] Windows: [http://people.apache.org/~af/sidebar/screenshots/screenshot-windows-sidebar.png http://people.apache.org/~af/sidebar/screenshots/screenshot-windows-sidebar-small.png]
+
===Used in This Presentation (Impress only)===
 +
List of the templates/master pages that are currently used by the document.
  
Detail views of regular toolbar buttons. Right "abc" button is selected, mouse is over left "abc" button.
+
[[File:Sidebar-Panel-UsedInThisPresentation.png|100px|top]]
  
Linux: http://people.apache.org/~af/sidebar/screenshots/screenshot-linux-toolbar.png Mac: http://people.apache.org/~af/sidebar/screenshots/screenshot-mac-toolbar.png Windows: http://people.apache.org/~af/sidebar/screenshots/screenshot-windows-toolbar-detail.png
+
===Wrap (Writer only)===
 +
Select how to wrap text around a graphical object.
  
Examples of toolbars in other applications:
+
[[File:Sidebar-Panel-Wrap.png|100px|top]]
  
Linux (file explorer): [http://people.apache.org/~af/sidebar/screenshots/screenshot-linux-explorer.png http://people.apache.org/~af/sidebar/screenshots/screenshot-linux-explorer-small.png]
+
==Decks==
Mac (Garageband): [http://people.apache.org/~af/sidebar/screenshots/screenshot-mac-GarageBand.png http://people.apache.org/~af/sidebar/screenshots/screenshot-mac-GarageBand-small.png] Windows (File Explorer): [http://people.apache.org/~af/sidebar/screenshots/screenshot-windows-Explorer.png http://people.apache.org/~af/sidebar/screenshots/screenshot-windows-Explorer-small.png]
+
  
 +
A deck is a container for one or more panels.  In some cases, where there is only one panel and the panel title and deck title are the same, the panel title bar is not painted.
  
For comparison here is a screenshot from Symphony (on Windows):
+
The deck title bar is not an active element, ie mouse clicks are ignored, but it can receive the keyboard focus.  That is an accessibility feature.
  
http://people.apache.org/~af/sidebar/screenshots/screenshot-sidebar-symphony.png
+
===Custom Animation (Impress only)===
 +
Contains only the [[#Custom_Animation_.28Impress_only.29|Custom Animation]] panel.
  
 +
Icon is [[file:Sidebar-Icon-CustomAnimation.png]].
  
===In main/svtools/ and main/sfx2/===
+
===Functions (Calc only)===
 +
Contains only the [[#Functions_.28Calc_only.29|Functions]] panel.
  
The unfinished implementation of an office wide toolpane with Symphony like functionality can be found in svtools/source/toolpanel/ and sfx2/source/dialog/taskpane/.  See [[Framework/Article/Tool Panels Internals]] for details.
+
Icon is [[file:Sidebar-Icon-Functions.png]].
  
===Existing API (main/offapi/)===
+
===Gallery===
 +
Contains only the [[#Gallery|Gallery]] panel.
  
XUIElement and XToolPanel from com::sun::star::ui provide an API abstraction of the toolpanel.
+
Icon is [[file:Sidebar-Icon-Gallery.png]].
  
It is already possible to provide [[Framework/Article/Tool_Panels|new tool panels]] from an extension.
+
===Master Pages (Impress only)===
 +
Contains the [[#Used_in_This_Presentation_.28Impress_only.29|Used in This Presentation]],
 +
[[#Recently_Used_.28Impress_only.29|Recently Used]],
 +
[[#Available_for_Use_.28Impress_only.29|Available for Use]] panels.
  
 +
Icon is [[file:Sidebar-Icon-MasterPages.png]].
  
===In the symphony branch===
+
===Navigator===
 +
Contains only the [[#Navigator|Navigator]] panel.
 +
 
 +
Icon is [[file:Sidebar-Icon-Navigator.png]].
 +
 
 +
===Properties===
 +
Contains a selection of the panels [[#Alignment_.28Calc_only.29|Alignment]], [[#Area|Area]], [[#Cell_Appearance_.28Calc_only.29|Cell Appearance]], [[#Graphic|Graphic]], [[#Insert_Shapes_.28Draw_only.29|Insert Shapes]], [[#Line|Line]], [[#Number_Format_.28Calc_only.29|Number Format]], [[#Page_.28Writer_only.29|Page]], [[#Paragraph|Paragraph]], [[#Position_and_Size|Position and Size]], [[#Text|Text]] and [[#Wrap_.28Writer_only.29|Wrap]].
 +
 
 +
Icon is [[file:Sidebar-Icon-Properties.png]].
 +
 
 +
This is the only deck that is context sensitive by default.  A list of which panels are belong to which contexts can be found [[Sidebar_for_Developers#Contexts|here]].
 +
 
 +
===Slide Transition (Impress only)===
 +
Contains only the [[#Slide_Transition_.28Impress_only.29|Slide Transition]] panel.
 +
 
 +
Icon is [[file:Sidebar-Icon-SlideTransition.png]].
 +
 
 +
===Styles and Formatting===
 +
Contains only the [[#Styles_and_Formatting|Styles and Formatting]] panel.
 +
 
 +
Icon is [[file:Sidebar-Icon-StylesAndFormatting.png]].
 +
 
 +
==Tab Bar==
 +
The tab bar is a column of icons on the right side of the sidebar.  Its buttons switch between decks.  The top button opens a menu that offers another way to switch decks.  A sub menu allows individual decks to be hidden.
 +
 
 +
==Glossary==
 +
[[File:SidebarNames.png|thumb|200px|Schematic overview of sidebar components. Location of elements do not reflect UX design.]]
 +
;sidebar: Name of the feature and name of the control including all its components (icon bar, content panels).
 +
:Also known as task pane(l) or tool pane(l)
 +
;tab bar: Similar to a vertical tool bar. Clicking on buttons switches between sidebar decks.
 +
;deck: Contains one or more content panels. Only one deck is visible at any one time.
 +
;content panel: Displays information about the document and/or provides the means for document modification.
 +
:Each content panel focuses on one topic like font, table or shape properties.
 +
:There may be more than one content panel in a deck.
 +
:Examples are the task panels of the Impress task pane or the property views of the Symphony sidebar.
 +
;title bar: Displays the title for the current sidebar deck.
 +
:Can contain a closer button.
 +
;content panel title: Displays the title for one content panel. Optional when there is only one content panel.
 +
;configuration menu button: Opens a popup menu that allows switching between decks and also allows the activation and deactivation (tab is not shown) of decks.
  
The sidebar is implemented in sfx2/source/propertypanel.
 
Base functionality for sidebar and content panes can be found in svx/source/propertypanel.
 
  
Find application specific content panels in sw/source/ui/propertypanel, sc/source/ui/propertypanel, sd/source/ui/propertypanel.
+
==References==
In these directories the files propertydlg.cxx defines the set of panels that are to be displayed.  These lists are hardcoded and can not be modified by extensions.
+
The UX part of the work is described on another [[AOO_UX_Design_Exploration_-_Task_Pane_Content_-_Information_Design|page]]. This page focuses on the API design and implementation.
  
Painting of control backgrounds is also hardcoded.  Look for instance at svx/source/propertypanel/paragraphpropertypage.cxx and search for calls to DrawGradient().  Colors for the background gradients are defined in every file that paints button backgrounds.
+
[[Category:Development]]

Latest revision as of 14:55, 16 June 2022

The sidebar is a UI feature that was introduced for all OpenOffice applications in version 4.0. It is based on the Symphony Properties Panel which in turn is based on the old Impress task pane. The sidebar looks like this:

Sidebar-Writer.png


Information about the implementation of the sidebar and how to extend it with new panels can be found in the Sidebar for Developers page.

A glossary is available below.


Overview

The sidebar window is located on the right side of the edit views of Writer, Calc, Impress, Draw, Base. It contains one or more panels, based on the current document context. Panels are organized into decks. A tab bar on the right side of the sidebar allows to switch between different decks.

The Properties deck is context sensitive. When text is being edited then it contains panels for changing the font or text attributes, when a graphical object is selected then other panels give access to fill and line style as well as the object's position and size.


Sidebar-Screenshot-Writer-Context-Text.png Sidebar-Screenshot-Writer-Context-Shape.png Sidebar-Screenshot-Writer-Context-Graphic.png
Different panels in Properties deck for different contexts (from left to right): text editing, logo pasted as outline, logo pasted as bitmap


A panel is basically a mix of a toolbar and a non-modal dialog. That means that sidebar panels do not lock the document. The user can freely mix working in the edit view to eg enter text and use the Text panel to change text attributes.

At the moment, toolbars and sidebar panels share many functions. For example, the buttons for making text bold or italic exist in both the text toolbar and the Text panel. This duplicity is the result of a design decision to allow users to gradually learn to use the sidebar. It is our plan to reduce functions provided in toolbars and provide them only in the sidebar. The speed and scope of this change depends on feedback from our users.

The width of the sidebar is variable. The controls in its panels are adjusted accordingly. When the sidebar becomes too small to be usable it collapses to the tab bar. This transitional state is indicated by an arrow that is displayed in place of the deck. A click on one of the buttons on the tab bar restores the deck to its former width.

Sidebar-Different-Widths.png

Panels

Eleven property panels have been migrated from IBM Lotus Symphony: Alignment, Area, Cell Appearance, Graphic, Line, Number Format, Page, Paragraph, Position and Size, Text and Wrap. Seven panels come from the old Impress tool panel: Available for Use, Custom Animation, Layouts, Recently Used, Slide Transition, Table Design, Used in This Presentation. Four are non-modal (ie non locking) dialogs: Functions, Gallery, Navigator, Styles and Formatting. One is new: Insert Shapes.

Sidebar-Panels.png

Some of these are displayed in the context sensitive 'Properties' deck, others are displayed in a deck on their own. In that case the panel title bar is usually not displayed and the deck title is the same as the panel title. When the panel title bar is shown then a mouse click on it collapses the panel to just its title bar. Another click and the panel is expanded to its former size.

Sidebar-Expand-Collapse.png

Some panels have a 'More Options' button in their title bar. A click on it opens a dialog with many more options than would fit into the panel. These dialogs, however, are modal, ie. the edit view is locked while the dialogs are open.

Sidebar-more-options.png

Alignment (Calc only)

Alignment of cell text (horizontal, vertical, rotation)

Sidebar-Panel-Alignment.png

Area

Fill style of shapes like color, gradient, bitmap, hatch, transparency.

Sidebar-Panel-Area.png

Available for Use (Impress only)

List of all available templates.

Sidebar-Panel-AvailableForUse.png

Cell Appearance (Calc only)

Cell background color and border.

Sidebar-Panel-CellAppearance.png

Custom Animation (Impress only)

Add or modify animations of shapes.

Sidebar-Panel-CustomAnimation.png

Functions (Calc only)

Insert functions (mathematical, string related, other) to a Calc cell.

Sidebar-Panel-Functions.png

Gallery

Gallery dialog as sidebar panel.

Sidebar-Panel-Gallery.png

Graphic

Adjust bitmap attributes like brightness, contrast, colors, gamma.

Sidebar-Panel-Graphic.png

Insert Shapes (Draw only)

Buttons and drop down menus for inserting shapes into Draw documents.

Sidebar-Panel-InsertShapes.png

Layouts (Impress only)

Assign a predefined layout to a slide. There are different sets of layouts for the different edit modes standard, handout and notes.

Sidebar-Panel-Layout-Standard.png Sidebar-Panel-Layout-Handout.png Sidebar-Panel-Layout-Notes.png

Line

Adjust color, width and style of lines and outlines.

Sidebar-Panel-Line.png

Navigator

The navigator dialog as sidebar panel. Small differences between the different applications.

Sidebar-Panel-Navigator-Writer.png Sidebar-Panel-Navigator-Calc.png Sidebar-Panel-Navigator-Impress.png

Number Format (Calc only)

Set the number format of selected cells.

Sidebar-Panel-NumberFormat.png

Page (Writer only)

Set page properties like orientation, margin or size.

Sidebar-Panel-Page.png

Paragraph

Adjust paragraph properties.

There are small differences for different contexts.
From left to right: Impress/Table, Writer/Annotation, Writer/DrawText, Writer/Table, Writer/Text.

Impress/Table Writer/Annotation Writer/DrawText Writer/Table Writer/Text

Position and Size

Change position, size and rotation of shapes. Not all of these attributes can be modified in any context. Free positioning is not supported in Writer. Bitmaps can not be rotated in Writer.

This results in three different versions of the panel: with position, size and rotation (left) with size and rotation (center) only size (right)

Impress Writer/Draw Writer/Graphic

Recently Used (Impress only)

List the recently used templates/master pages.

Sidebar-Panel-RecentlyUsed.png

Slide Transition (Impress only)

Add or modify transition animations between slides.

Sidebar-Panel-SlideTransition.png

Styles and Formatting

The styles and formatting dialog, aka Stylist, as sidebar panel.

There are small differences between the applications: (from left to right) Writer, Calc, Impress

Sidebar-Panel-StylesAndFormatting-Writer.png Sidebar-Panel-StylesAndFormatting-Calc.png Sidebar-Panel-StylesAndFormatting-Impress.png

Table Design (Impress only)

Properties of tables in Impress.

Sidebar-Panel-TableDesign.png

Text

Adjust text properties like font, size, bold, colors.

There are small differences in different applications and contexts. Not all controls/attributes are available everywhere.

Sidebar-Panel-Text-Calc.png Sidebar-Panel-Text-Impress-Table.png Sidebar-Panel-Text-Writer.png Sidebar-Panel-Text-Writer-Annotation.png

Used in This Presentation (Impress only)

List of the templates/master pages that are currently used by the document.

Sidebar-Panel-UsedInThisPresentation.png

Wrap (Writer only)

Select how to wrap text around a graphical object.

Sidebar-Panel-Wrap.png

Decks

A deck is a container for one or more panels. In some cases, where there is only one panel and the panel title and deck title are the same, the panel title bar is not painted.

The deck title bar is not an active element, ie mouse clicks are ignored, but it can receive the keyboard focus. That is an accessibility feature.

Custom Animation (Impress only)

Contains only the Custom Animation panel.

Icon is Sidebar-Icon-CustomAnimation.png.

Functions (Calc only)

Contains only the Functions panel.

Icon is Sidebar-Icon-Functions.png.

Gallery

Contains only the Gallery panel.

Icon is Sidebar-Icon-Gallery.png.

Master Pages (Impress only)

Contains the Used in This Presentation, Recently Used, Available for Use panels.

Icon is Sidebar-Icon-MasterPages.png.

Navigator

Contains only the Navigator panel.

Icon is Sidebar-Icon-Navigator.png.

Properties

Contains a selection of the panels Alignment, Area, Cell Appearance, Graphic, Insert Shapes, Line, Number Format, Page, Paragraph, Position and Size, Text and Wrap.

Icon is Sidebar-Icon-Properties.png.

This is the only deck that is context sensitive by default. A list of which panels are belong to which contexts can be found here.

Slide Transition (Impress only)

Contains only the Slide Transition panel.

Icon is Sidebar-Icon-SlideTransition.png.

Styles and Formatting

Contains only the Styles and Formatting panel.

Icon is Sidebar-Icon-StylesAndFormatting.png.

Tab Bar

The tab bar is a column of icons on the right side of the sidebar. Its buttons switch between decks. The top button opens a menu that offers another way to switch decks. A sub menu allows individual decks to be hidden.

Glossary

Schematic overview of sidebar components. Location of elements do not reflect UX design.
sidebar
Name of the feature and name of the control including all its components (icon bar, content panels).
Also known as task pane(l) or tool pane(l)
tab bar
Similar to a vertical tool bar. Clicking on buttons switches between sidebar decks.
deck
Contains one or more content panels. Only one deck is visible at any one time.
content panel
Displays information about the document and/or provides the means for document modification.
Each content panel focuses on one topic like font, table or shape properties.
There may be more than one content panel in a deck.
Examples are the task panels of the Impress task pane or the property views of the Symphony sidebar.
title bar
Displays the title for the current sidebar deck.
Can contain a closer button.
content panel title
Displays the title for one content panel. Optional when there is only one content panel.
configuration menu button
Opens a popup menu that allows switching between decks and also allows the activation and deactivation (tab is not shown) of decks.


References

The UX part of the work is described on another page. This page focuses on the API design and implementation.

Personal tools