[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/PanelTitleBar.cxx |8 +++- sfx2/source/sidebar/Sidebar.hrc |5 +++-- sfx2/source/sidebar/Sidebar.src |5 + 3 files changed, 15 insertions(+), 3 deletions(-) New commits: commit 35c18dc890a8883b974ff73c585033fc3ee3b73e Author: Andre Fischer a...@apache.org Date: Thu May 16 08:49:36 2013 + Resolves: #i122271# Provide accessible for panels that... includes the panel title. (cherry picked from commit e785c5125994bbfdb4e69108b5a73a184b3ced49) Change-Id: I97cf9f5f78382dfbd69dcff33b7066380d47313d diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx index 9b67e3c..3446aca 100644 --- a/sfx2/source/sidebar/PanelTitleBar.cxx +++ b/sfx2/source/sidebar/PanelTitleBar.cxx @@ -43,7 +43,7 @@ static const sal_Int32 gaRightIconPadding (5); PanelTitleBar::PanelTitleBar ( const ::rtl::OUString rsTitle, Window* pParentWindow, -Panel* pPanel ) +Panel* pPanel) : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()), mbIsLeftButtonDown(false), mpPanel(pPanel), @@ -52,6 +52,12 @@ PanelTitleBar::PanelTitleBar ( { OSL_ASSERT(mpPanel != NULL); +const ::rtl::OUString sAccessibleName( +String(SfxResId(SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX)) ++ rsTitle); +SetAccessibleName(sAccessibleName); +SetAccessibleDescription(sAccessibleName); + #ifdef DEBUG SetText(A2S(PanelTitleBar)); #endif diff --git a/sfx2/source/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc index c9c4d79..ac3500b 100644 --- a/sfx2/source/sidebar/Sidebar.hrc +++ b/sfx2/source/sidebar/Sidebar.hrc @@ -52,5 +52,6 @@ #define STRING_CUSTOMIZATION200 #define STRING_RESTORE 201 -#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1) -#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2) +#define SFX_STR_SIDEBAR_MORE_OPTIONS(RID_SFX_SIDEBAR_START + 1) +#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2) +#define SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX (RID_SFX_SIDEBAR_START + 3) diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src index 6ec57c1..a5d8a03 100644 --- a/sfx2/source/sidebar/Sidebar.src +++ b/sfx2/source/sidebar/Sidebar.src @@ -165,3 +165,8 @@ String SFX_STR_SIDEBAR_CLOSE_DECK Text [en-US] = Close Sidebar Deck; }; +String SFX_STR_SIDEBAR_ACCESSIBILITY_PANEL_PREFIX +{ +Text [en-US] = Panel: ; +}; + ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/SidebarController.cxx| 28 - sfx2/source/sidebar/SidebarDockingWindow.cxx | 30 +++ sfx2/source/sidebar/SidebarDockingWindow.hxx |4 +++ 3 files changed, 52 insertions(+), 10 deletions(-) New commits: commit 3c451f893663c118201ccdd4688fe97f1524d21e Author: Andre Fischer a...@apache.org Date: Thu May 16 09:51:11 2013 + Resolves: #i122320# Show closer after docking sidebar. Prevent sidebar from being docked above or below edit view. (cherry picked from commit ca7264d7ab7e8b70693362d60227c7dd7626df8b) Change-Id: I634e0b68c27039613054160b7add5d2d07b666cd diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index c4ea537..c3d4262 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -1014,11 +1014,13 @@ bool SidebarController::CanModifyChildWindowWidth (void) sal_uInt16 nRow (0x); sal_uInt16 nColumn (0x); -pSplitWindow-GetWindowPos(mpParentWindow, nColumn, nRow); - -sal_uInt16 nRowCount (pSplitWindow-GetWindowCount(nColumn)); - -return nRowCount==1; +if (pSplitWindow-GetWindowPos(mpParentWindow, nColumn, nRow)) +{ +sal_uInt16 nRowCount (pSplitWindow-GetWindowCount(nColumn)); +return nRowCount==1; +} +else +return false; } @@ -1070,17 +1072,23 @@ void SidebarController::RestrictWidth (void) SfxSplitWindow* SidebarController::GetSplitWindow (void) { -if (mpSplitWindow == NULL) +if (mpParentWindow != NULL) { -if (mpParentWindow != NULL) +SfxSplitWindow* pSplitWindow = dynamic_castSfxSplitWindow*(mpParentWindow-GetParent()); +if (pSplitWindow != mpSplitWindow) { -mpSplitWindow = dynamic_castSfxSplitWindow*(mpParentWindow-GetParent()); +if (mpSplitWindow != NULL) +mpSplitWindow-RemoveEventListener(LINK(this, SidebarController, WindowEventHandler)); + +mpSplitWindow = pSplitWindow; + if (mpSplitWindow != NULL) mpSplitWindow-AddEventListener(LINK(this, SidebarController, WindowEventHandler)); } +return mpSplitWindow; } - -return mpSplitWindow; +else +return NULL; } diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx b/sfx2/source/sidebar/SidebarDockingWindow.cxx index f991c7a5..3b6a61d 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.cxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx @@ -102,4 +102,34 @@ sal_Bool SidebarDockingWindow::Close (void) } + + +SfxChildAlignment SidebarDockingWindow::CheckAlignment ( +SfxChildAlignment eCurrentAlignment, +SfxChildAlignment eRequestedAlignment) +{ +switch (eRequestedAlignment) +{ +case SFX_ALIGN_TOP: +case SFX_ALIGN_HIGHESTTOP: +case SFX_ALIGN_LOWESTTOP: +case SFX_ALIGN_BOTTOM: +case SFX_ALIGN_LOWESTBOTTOM: +case SFX_ALIGN_HIGHESTBOTTOM: +return eCurrentAlignment; + +case SFX_ALIGN_LEFT: +case SFX_ALIGN_RIGHT: +case SFX_ALIGN_FIRSTLEFT: +case SFX_ALIGN_LASTLEFT: +case SFX_ALIGN_FIRSTRIGHT: +case SFX_ALIGN_LASTRIGHT: +return eRequestedAlignment; + +default: +return eRequestedAlignment; +} +} + + } } // end of namespace sfx2::sidebar diff --git a/sfx2/source/sidebar/SidebarDockingWindow.hxx b/sfx2/source/sidebar/SidebarDockingWindow.hxx index 2125212..5a54f11 100644 --- a/sfx2/source/sidebar/SidebarDockingWindow.hxx +++ b/sfx2/source/sidebar/SidebarDockingWindow.hxx @@ -49,6 +49,10 @@ protected: // Window overridables virtual void GetFocus (void); +virtual SfxChildAlignment CheckAlignment ( +SfxChildAlignment eCurrentAlignment, +SfxChildAlignment eRequestedAlignment); + private: ::rtl::Referencesfx2::sidebar::SidebarController mpSidebarController; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/Deck.cxx | 86 +++ sfx2/source/sidebar/Deck.hxx |5 +- sfx2/source/sidebar/FocusManager.cxx |8 ++- 3 files changed, 56 insertions(+), 43 deletions(-) New commits: commit 58da1dc5061fcd9abc7dd296d0d7d04d651dc10f Author: Andre Fischer a...@apache.org Date: Thu May 16 11:08:30 2013 + Resolves: #i122321# Fix processing of scroll wheel... to not block other events (cherry picked from commit 0a5d252c19fdd4e1e705668a604fb319dc6ceccb) Change-Id: Ib1a3fa50e071688df41983ce8e2cb6b1c93e18c9 diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index 0a319e1..6534ec7 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -217,49 +217,57 @@ void Deck::DataChanged (const DataChangedEvent rEvent) long Deck::Notify (NotifyEvent rEvent) { -if (rEvent.GetType() != EVENT_COMMAND) -return sal_False; +if (rEvent.GetType() == EVENT_COMMAND) +{ +CommandEvent* pCommandEvent = reinterpret_castCommandEvent*(rEvent.GetData()); +if (pCommandEvent != NULL) +switch (pCommandEvent-GetCommand()) +{ +case COMMAND_WHEEL: +return ProcessWheelEvent(pCommandEvent, rEvent) +? sal_True +: sal_False; + +default: +break; +} +} -CommandEvent* pCommandEvent = reinterpret_castCommandEvent*(rEvent.GetData()); -if (pCommandEvent == NULL) -return sal_False; +return Window::Notify(rEvent); +} -switch (pCommandEvent-GetCommand()) -{ -case COMMAND_WHEEL: -{ -if ( ! mpVerticalScrollBar -|| ! mpVerticalScrollBar-IsVisible()) -return sal_False; - -// Ignore all wheel commands from outside the vertical -// scroll bar. Otherwise after a scroll we might land on -// a spin field and subsequent wheel events would change -// the value of that control. -if (rEvent.GetWindow() != mpVerticalScrollBar.get()) -return sal_True; - -// Get the wheel data and check that it describes a valid -// vertical scroll. -const CommandWheelData* pData = pCommandEvent-GetWheelData(); -if (pData==NULL -|| pData-GetModifier() -|| pData-GetMode() != COMMAND_WHEEL_SCROLL -|| pData-IsHorz()) -return sal_False; - -// Execute the actual scroll action. -long nDelta = pData-GetDelta(); -mpVerticalScrollBar-DoScroll( -mpVerticalScrollBar-GetThumbPos() - nDelta); -return sal_True; -} -default: -break; -} -return sal_False; + +bool Deck::ProcessWheelEvent ( +CommandEvent* pCommandEvent, +NotifyEvent rEvent) +{ +if ( ! mpVerticalScrollBar) +return false; +if ( ! mpVerticalScrollBar-IsVisible()) +return false; + +// Ignore all wheel commands from outside the vertical scroll bar. +// Otherwise after a scroll we might land on a spin field and +// subsequent wheel events would change the value of that control. +if (rEvent.GetWindow() != mpVerticalScrollBar.get()) +return true; + +// Get the wheel data and check that it describes a valid vertical +// scroll. +const CommandWheelData* pData = pCommandEvent-GetWheelData(); +if (pData==NULL +|| pData-GetModifier() +|| pData-GetMode() != COMMAND_WHEEL_SCROLL +|| pData-IsHorz()) +return false; + +// Execute the actual scroll action. +long nDelta = pData-GetDelta(); +mpVerticalScrollBar-DoScroll( +mpVerticalScrollBar-GetThumbPos() - nDelta); +return true; } diff --git a/sfx2/source/sidebar/Deck.hxx b/sfx2/source/sidebar/Deck.hxx index 171fff7..f49d38f 100644 --- a/sfx2/source/sidebar/Deck.hxx +++ b/sfx2/source/sidebar/Deck.hxx @@ -100,8 +100,9 @@ private: ::boost::scoped_ptrScrollBar mpVerticalScrollBar; DECL_LINK(HandleVerticalScrollBarChange,void*); - - +bool ProcessWheelEvent ( +CommandEvent* pCommandEvent, +NotifyEvent rEvent); }; diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index 081fa25..6ed64a5 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -554,6 +554,10 @@ IMPL_LINK(FocusManager, WindowEventListener, VclSimpleEvent*, pEvent) case VCLEVENT_WINDOW_GETFOCUS: case VCLEVENT_WINDOW_LOSEFOCUS: pSource-Invalidate(); +return 1; + +default: +break; } return 0; @@ -608,14 +612,14 @@ IMPL_LINK(FocusManager, ChildEventListener, VclSimpleEvent*, pEvent) break;
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source vcl/source
sfx2/source/dialog/templdlg.cxx |2 ++ vcl/source/window/dockwin.cxx | 15 --- 2 files changed, 14 insertions(+), 3 deletions(-) New commits: commit 048eca411083bc8a2ef95e5701bf7eba5d232a2d Author: Andre Fischer a...@apache.org Date: Fri May 17 08:56:55 2013 + Resolves: #i122329# Disable undocking of stylist in the sidebar (cherry picked from commit 8dc875f17c0cdd41e7ba6ad2f4c1ea3bda1a8be2) Change-Id: I1a19135d3496463c8759e341449fa51d389fa264 diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index dda190a..2f04b53 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -398,6 +398,8 @@ SfxTemplatePanelControl::SfxTemplatePanelControl ( OSL_ASSERT(mpBindings!=NULL); pImpl-updateNonFamilyImages(); + +SetStyle(GetStyle() ~WB_DOCKABLE); } diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 2ee2f48..42954e6 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -755,10 +755,19 @@ void DockingWindow::Resizing( Size ) void DockingWindow::StateChanged( StateChangedType nType ) { -if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) +switch(nType) { -ImplInitSettings(); -Invalidate(); +case STATE_CHANGE_CONTROLBACKGROUND: +ImplInitSettings(); +Invalidate(); +break; + +case STATE_CHANGE_STYLE: +mbDockable = (GetStyle() WB_DOCKABLE) != 0; +break; + +default: +break; } Window::StateChanged( nType ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/SidebarController.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit dca16f8c819a1c657c5d0eb7e3c6ff884843f9a7 Author: Andre Fischer a...@apache.org Date: Mon May 13 11:00:09 2013 + Resolves: #i122272# Select correct sidebar button... after changing decks via menu. (cherry picked from commit 0763a83fb20825c66d8a3ecc50327753f7508bf9) Change-Id: Ief24fa9191848ad6004ea7c28cd28b73b7e54f9f diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 6656714..b508cf4 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -480,6 +480,7 @@ void SidebarController::SwitchToDeck ( msCurrentDeckId = rDeckDescriptor.msId; } +mpTabBar-HighlightDeck(msCurrentDeckId); // Determine the panels to display in the deck. ResourceManager::PanelContextDescriptorContainer aPanelContextDescriptors; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/DeckTitleBar.cxx | 15 +-- sfx2/source/sidebar/PanelTitleBar.cxx |5 + sfx2/source/sidebar/Sidebar.hrc |3 +++ sfx2/source/sidebar/Sidebar.src |9 + 4 files changed, 26 insertions(+), 6 deletions(-) New commits: commit 17383db8f19de33c2adac783ac91c2cbf3cab438 Author: Andre Fischer a...@apache.org Date: Mon May 13 14:41:07 2013 + Resolves: #i122298# Added quick help texts to title bar buttons of sidebar... panels and deck (cherry picked from commit 2f18055a153f4e66ec72b0c20673032d6edeebab) Change-Id: Ic573030d5b8a437e09a763fb0350c22ef33e151a diff --git a/sfx2/source/sidebar/DeckTitleBar.cxx b/sfx2/source/sidebar/DeckTitleBar.cxx index 0370ef8..ed7fd17 100644 --- a/sfx2/source/sidebar/DeckTitleBar.cxx +++ b/sfx2/source/sidebar/DeckTitleBar.cxx @@ -18,6 +18,8 @@ #include DeckTitleBar.hxx #include sfx2/sidebar/Theme.hxx +#include sfx2/sfxresid.hxx +#include Sidebar.hrc #include vcl/image.hxx @@ -39,16 +41,12 @@ DeckTitleBar::DeckTitleBar ( : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()), mnCloserItemIndex(1), maCloserAction(rCloserAction), - mbIsCloserVisible(rCloserAction) + mbIsCloserVisible(false) { OSL_ASSERT(pParentWindow != NULL); if (maCloserAction) -{ -maToolBox.InsertItem( -mnCloserItemIndex, -Theme::GetImage(Theme::Image_Closer)); -} +SetCloserVisible(true); #ifdef DEBUG SetText(A2S(DeckTitleBar)); @@ -72,9 +70,14 @@ void DeckTitleBar::SetCloserVisible (const bool bIsCloserVisible) mbIsCloserVisible = bIsCloserVisible; if (mbIsCloserVisible) +{ maToolBox.InsertItem( mnCloserItemIndex, Theme::GetImage(Theme::Image_Closer)); +maToolBox.SetQuickHelpText( +mnCloserItemIndex, +String(SfxResId(SFX_STR_SIDEBAR_CLOSE_DECK))); +} else maToolBox.RemoveItem( maToolBox.GetItemPos(mnCloserItemIndex)); diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx index 0175741..9b67e3c 100644 --- a/sfx2/source/sidebar/PanelTitleBar.cxx +++ b/sfx2/source/sidebar/PanelTitleBar.cxx @@ -17,6 +17,8 @@ */ #include PanelTitleBar.hxx +#include sfx2/sfxresid.hxx +#include Sidebar.hrc #include Paint.hxx #include Panel.hxx @@ -73,6 +75,9 @@ void PanelTitleBar::SetMenuAction ( const ::boost::functionvoid(void) rMenuAc mnMenuItemIndex, Theme::GetImage(Theme::Image_PanelMenu)); maToolBox.SetOutStyle(TOOLBOX_STYLE_FLAT); +maToolBox.SetQuickHelpText( +mnMenuItemIndex, +String(SfxResId(SFX_STR_SIDEBAR_MORE_OPTIONS))); } else if ( maMenuAction !rMenuAction ) { diff --git a/sfx2/source/sidebar/Sidebar.hrc b/sfx2/source/sidebar/Sidebar.hrc index 852648c..c9c4d79 100644 --- a/sfx2/source/sidebar/Sidebar.hrc +++ b/sfx2/source/sidebar/Sidebar.hrc @@ -51,3 +51,6 @@ #define IMAGE_SIDEBAR_DECK_FUNCTIONS_SMALL 132 #define STRING_CUSTOMIZATION200 #define STRING_RESTORE 201 + +#define SFX_STR_SIDEBAR_MORE_OPTIONS (RID_SFX_SIDEBAR_START + 1) +#define SFX_STR_SIDEBAR_CLOSE_DECK (RID_SFX_SIDEBAR_START + 2) diff --git a/sfx2/source/sidebar/Sidebar.src b/sfx2/source/sidebar/Sidebar.src index 64eef88..6ec57c1 100644 --- a/sfx2/source/sidebar/Sidebar.src +++ b/sfx2/source/sidebar/Sidebar.src @@ -155,4 +155,13 @@ Resource RID_SIDEBAR_RESOURCE }; }; +String SFX_STR_SIDEBAR_MORE_OPTIONS +{ +Text [en-US] = More Options; +}; + +String SFX_STR_SIDEBAR_CLOSE_DECK +{ +Text [en-US] = Close Sidebar Deck; +}; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source svx/source
sfx2/source/sidebar/Deck.cxx | 33 + sfx2/source/sidebar/Deck.hxx |6 sfx2/source/sidebar/FocusManager.cxx | 450 +++-- sfx2/source/sidebar/FocusManager.hxx | 63 ++ sfx2/source/sidebar/Panel.cxx |4 sfx2/source/sidebar/SidebarController.cxx | 13 sfx2/source/sidebar/SidebarController.hxx |6 sfx2/source/sidebar/SidebarDockingWindow.cxx | 25 - sfx2/source/sidebar/SidebarDockingWindow.hxx |1 sfx2/source/sidebar/SidebarToolBox.cxx | 17 sfx2/source/sidebar/SidebarToolBox.hxx |1 sfx2/source/sidebar/TitleBar.cxx | 12 sfx2/source/sidebar/TitleBar.hxx |1 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 16 svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 12 svx/source/sidebar/text/TextPropertyPanel.cxx | 16 svx/source/sidebar/text/TextPropertyPanel.hxx |8 17 files changed, 420 insertions(+), 264 deletions(-) New commits: commit e604df6d147e636a4c51d0ca1e8f416d4ffa2260 Author: Andre Fischer a...@apache.org Date: Mon May 6 13:12:20 2013 + Resolves: #i122230# Fixed focus traveling in the sidebar (cherry picked from commit bab3ddce4b3d5330835494f54b68406335821b76) Conflicts: sfx2/source/sidebar/FocusManager.cxx Change-Id: I8853a92da3c4fe41a0110c630cc6af556ffc2ce4 diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index 91929f8..ad3751c 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -260,6 +260,39 @@ void Deck::RequestLayout (void) +void Deck::ShowPanel (const Panel rPanel) +{ +if (mpVerticalScrollBar mpVerticalScrollBar-IsVisible()) +{ +// Get vertical extent of the panel. +sal_Int32 nPanelTop (rPanel.GetPosPixel().Y()); +const sal_Int32 nPanelBottom (nPanelTop + rPanel.GetSizePixel().Height() - 1); +// Add the title bar into the extent. +if (rPanel.GetTitleBar() != NULL rPanel.GetTitleBar()-IsVisible()) +nPanelTop = rPanel.GetTitleBar()-GetPosPixel().Y(); + + +// Determine what the new thumb position should be like. +// When the whole panel does not fit then make its top visible +// and it off at the bottom. +sal_Int32 nNewThumbPos (mpVerticalScrollBar-GetThumbPos()); +if (nPanelBottom = nNewThumbPos+mpVerticalScrollBar-GetVisibleSize()) +nNewThumbPos = nPanelBottom - mpVerticalScrollBar-GetVisibleSize(); +if (nPanelTop nNewThumbPos) +nNewThumbPos = nPanelTop; + +mpVerticalScrollBar-SetThumbPos(nNewThumbPos); +mpScrollContainer-SetPosPixel( +Point( +mpScrollContainer-GetPosPixel().X(), +-nNewThumbPos)); + +} +} + + + + const char* GetWindowClassification (const Window* pWindow) { const String rsName (pWindow-GetText()); diff --git a/sfx2/source/sidebar/Deck.hxx b/sfx2/source/sidebar/Deck.hxx index 07cdaec..e3c3b6f 100644 --- a/sfx2/source/sidebar/Deck.hxx +++ b/sfx2/source/sidebar/Deck.hxx @@ -61,6 +61,12 @@ public: void RequestLayout (void); ::Window* GetPanelParentWindow (void); +/** Try to make the panel completely visible. +When the whole panel does not fit then make its top visible +and it off at the bottom. +*/ +void ShowPanel (const Panel rPanel); + virtual void Paint (const Rectangle rUpdateArea); virtual void DataChanged (const DataChangedEvent rEvent); diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index f213a8c..b3c83d3 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -18,6 +18,7 @@ #include FocusManager.hxx #include Panel.hxx +#include DeckTitleBar.hxx #include sfx2/sidebar/Tools.hxx #include TitleBar.hxx #include vcl/button.hxx @@ -27,36 +28,20 @@ namespace sfx2 { namespace sidebar { -namespace +FocusManager::FocusLocation::FocusLocation (const PanelComponent eComponent, const sal_Int32 nIndex) +: meComponent(eComponent), + mnIndex(nIndex) { -enum PanelComponent -{ -PC_TitleBar, -PC_ToolBox, -PC_Content, -PC_None -}; - -PanelComponent GetFocusedComponent (const Panel rPanel) -{ -if (rPanel.HasFocus()) -return PC_Content; -else if (rPanel.GetTitleBar() != NULL) -{ -if (rPanel.GetTitleBar()-HasFocus()) -return PC_TitleBar; -else if (rPanel.GetTitleBar()-GetToolBox().HasFocus()) -return PC_ToolBox; -} -return PC_None; -} } -FocusManager::FocusManager (void) -: maPanels(), + + +FocusManager::FocusManager (const ::boost::functionvoid(const Panel) rShowPanelFunctor) +:
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/FocusManager.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit c367a1e8628f125373a8be0108b05f27ca2117dd Author: Andre Fischer a...@apache.org Date: Tue May 7 11:33:50 2013 + Resolves: #i122230# Fixes for sidebar focus traveling (cherry picked from commit 2b1bd27c95821000241b6f038b62b009ab94bda7) Change-Id: Id54bb7367d736629a43869c58d6d840fc8fd7da8 diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx index b3c83d3..081fa25 100644 --- a/sfx2/source/sidebar/FocusManager.cxx +++ b/sfx2/source/sidebar/FocusManager.cxx @@ -98,8 +98,9 @@ void FocusManager::ClearPanels (void) void FocusManager::ClearButtons (void) { -::std::vectorWindow* aButtons; -for (::std::vectorWindow*::iterator iButton(aButtons.begin()),iEnd(aButtons.end()); +::std::vectorButton* aButtons; +aButtons.swap(maButtons); +for (::std::vectorButton*::iterator iButton(aButtons.begin()),iEnd(aButtons.end()); iButton!=iEnd; ++iButton) { @@ -278,6 +279,8 @@ bool FocusManager::IsDeckTitleVisible (void) const void FocusManager::FocusPanel (const sal_Int32 nPanelIndex) { +if (nPanelIndex0 || nPanelIndex=static_castsal_Int32(maPanels.size())) +return; Panel rPanel (*maPanels[nPanelIndex]); TitleBar* pTitleBar = rPanel.GetTitleBar(); if (pTitleBar!=NULL pTitleBar-IsVisible()) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/Deck.cxx | 52 ++- sfx2/source/sidebar/Deck.hxx |1 2 files changed, 52 insertions(+), 1 deletion(-) New commits: commit 77c85da8b7cbad2e2904af81554d65afcd868a23 Author: Andre Fischer a...@apache.org Date: Wed May 8 07:21:37 2013 + Resolves: #i122254# Process mouse wheel events over sidebar scroll bar (cherry picked from commit db9602cbf627e1a7af56f3a419ec7c7445dcfb85) Change-Id: I272763eb24e58443d8c8a980eca9b0f654a9e899 diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index ad3751c..0a319e1 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -215,6 +215,56 @@ void Deck::DataChanged (const DataChangedEvent rEvent) +long Deck::Notify (NotifyEvent rEvent) +{ +if (rEvent.GetType() != EVENT_COMMAND) +return sal_False; + +CommandEvent* pCommandEvent = reinterpret_castCommandEvent*(rEvent.GetData()); +if (pCommandEvent == NULL) +return sal_False; + +switch (pCommandEvent-GetCommand()) +{ +case COMMAND_WHEEL: +{ +if ( ! mpVerticalScrollBar +|| ! mpVerticalScrollBar-IsVisible()) +return sal_False; + +// Ignore all wheel commands from outside the vertical +// scroll bar. Otherwise after a scroll we might land on +// a spin field and subsequent wheel events would change +// the value of that control. +if (rEvent.GetWindow() != mpVerticalScrollBar.get()) +return sal_True; + +// Get the wheel data and check that it describes a valid +// vertical scroll. +const CommandWheelData* pData = pCommandEvent-GetWheelData(); +if (pData==NULL +|| pData-GetModifier() +|| pData-GetMode() != COMMAND_WHEEL_SCROLL +|| pData-IsHorz()) +return sal_False; + +// Execute the actual scroll action. +long nDelta = pData-GetDelta(); +mpVerticalScrollBar-DoScroll( +mpVerticalScrollBar-GetThumbPos() - nDelta); +return sal_True; +} + +default: +break; +} + +return sal_False; +} + + + + void Deck::SetPanels (const SharedPanelContainer rPanels) { maPanels = rPanels; @@ -271,7 +321,6 @@ void Deck::ShowPanel (const Panel rPanel) if (rPanel.GetTitleBar() != NULL rPanel.GetTitleBar()-IsVisible()) nPanelTop = rPanel.GetTitleBar()-GetPosPixel().Y(); - // Determine what the new thumb position should be like. // When the whole panel does not fit then make its top visible // and it off at the bottom. @@ -414,4 +463,5 @@ void Deck::ScrollContainerWindow::SetSeparators (const ::std::vectorsal_Int32 maSeparators = rSeparators; } + } } // end of namespace sfx2::sidebar diff --git a/sfx2/source/sidebar/Deck.hxx b/sfx2/source/sidebar/Deck.hxx index e3c3b6f..171fff7 100644 --- a/sfx2/source/sidebar/Deck.hxx +++ b/sfx2/source/sidebar/Deck.hxx @@ -69,6 +69,7 @@ public: virtual void Paint (const Rectangle rUpdateArea); virtual void DataChanged (const DataChangedEvent rEvent); +virtual long Notify (NotifyEvent rEvent); void PrintWindowTree (void); void PrintWindowTree (const ::std::vectorPanel* rPanels); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/ContextList.cxx | 12 sfx2/source/sidebar/ContextList.hxx |5 - sfx2/source/sidebar/Panel.cxx | 16 +--- sfx2/source/sidebar/Panel.hxx |7 +-- sfx2/source/sidebar/ResourceManager.cxx | 24 sfx2/source/sidebar/ResourceManager.hxx |8 sfx2/source/sidebar/SidebarController.cxx | 21 - sfx2/source/sidebar/SidebarController.hxx |5 - 8 files changed, 86 insertions(+), 12 deletions(-) New commits: commit 219f0935fb3480cd2fde86619028c15cb69943ef Author: Andre Fischer a...@apache.org Date: Wed May 8 09:48:36 2013 + Resolves: #i122255# Store sidebar panel extension state (non persistent) (cherry picked from commit f6f8c047b73f8fc8b4c78b321761a26ef7ed96ba) Change-Id: I917050dd57b3fa952200dd536b371f902661e88f diff --git a/sfx2/source/sidebar/ContextList.cxx b/sfx2/source/sidebar/ContextList.cxx index aebfdbd..f7028c3 100644 --- a/sfx2/source/sidebar/ContextList.cxx +++ b/sfx2/source/sidebar/ContextList.cxx @@ -50,6 +50,18 @@ const ContextList::Entry* ContextList::GetMatch (const Context rContext) const +ContextList::Entry* ContextList::GetMatch (const Context rContext) +{ +const ::std::vectorEntry::const_iterator iEntry = FindBestMatch(rContext); +if (iEntry != maEntries.end()) +return const_castEntry*(*iEntry); +else +return NULL; +} + + + + ::std::vectorContextList::Entry::const_iterator ContextList::FindBestMatch (const Context rContext) const { sal_Int32 nBestMatch (Context::NoMatch); diff --git a/sfx2/source/sidebar/ContextList.hxx b/sfx2/source/sidebar/ContextList.hxx index f026ff9..8d9886f 100644 --- a/sfx2/source/sidebar/ContextList.hxx +++ b/sfx2/source/sidebar/ContextList.hxx @@ -27,7 +27,8 @@ namespace sfx2 { namespace sidebar { - +/** Per context data for deck and panel descriptors. +*/ class ContextList { public: @@ -46,6 +47,8 @@ public: */ const Entry* GetMatch ( const Context rContext) const; +Entry* GetMatch ( +const Context rContext); void AddContextDescription ( const Context rContext, diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx index 59eeb05..0840c4c 100644 --- a/sfx2/source/sidebar/Panel.cxx +++ b/sfx2/source/sidebar/Panel.cxx @@ -21,6 +21,7 @@ #include PanelDescriptor.hxx #include sfx2/sidebar/Theme.hxx #include Paint.hxx +#include ResourceManager.hxx #ifdef DEBUG #include sfx2/sidebar/Tools.hxx @@ -47,7 +48,9 @@ namespace sfx2 { namespace sidebar { Panel::Panel ( const PanelDescriptor rPanelDescriptor, Window* pParentWindow, -const ::boost::functionvoid(void) rDeckLayoutTrigger) +const bool bIsInitiallyExpanded, +const ::boost::functionvoid(void) rDeckLayoutTrigger, +const ::boost::functionContext(void) rContextAccess) : Window(pParentWindow), msPanelId(rPanelDescriptor.msId), mpTitleBar(new PanelTitleBar( @@ -57,8 +60,9 @@ Panel::Panel ( mbIsTitleBarOptional(rPanelDescriptor.mbIsTitleBarOptional), mxElement(), mxPanelComponent(), - mbIsExpanded(true), - maDeckLayoutTrigger(rDeckLayoutTrigger) + mbIsExpanded(bIsInitiallyExpanded), + maDeckLayoutTrigger(rDeckLayoutTrigger), + maContextAccess(rContextAccess) { SetBackground(Theme::GetPaint(Theme::Paint_PanelBackground).GetWallpaper()); @@ -153,6 +157,12 @@ void Panel::SetExpanded (const bool bIsExpanded) { mbIsExpanded = bIsExpanded; maDeckLayoutTrigger(); + +if (maContextAccess) +ResourceManager::Instance().StorePanelExpansionState( +msPanelId, +bIsExpanded, +maContextAccess()); } } diff --git a/sfx2/source/sidebar/Panel.hxx b/sfx2/source/sidebar/Panel.hxx index 5a7ca1c..27c771a 100644 --- a/sfx2/source/sidebar/Panel.hxx +++ b/sfx2/source/sidebar/Panel.hxx @@ -18,6 +18,7 @@ #ifndef SFX_SIDEBAR_PANEL_HXX #define SFX_SIDEBAR_PANEL_HXX +#include Context.hxx #include vcl/window.hxx #include com/sun/star/ui/XUIElement.hpp @@ -45,7 +46,9 @@ public: Panel ( const PanelDescriptor rPanelDescriptor, Window* pParentWindow, -const ::boost::functionvoid(void) rDeckLayoutTrigger ); +const bool bIsInitiallyExpanded, +const ::boost::functionvoid(void) rDeckLayoutTrigger, +const ::boost::functionContext(void) rContextAccess); virtual ~Panel (void); void Dispose (void); @@ -76,7 +79,7 @@ private: cssu::Referencecss::ui::XSidebarPanel mxPanelComponent; bool mbIsExpanded; const ::boost::functionvoid(void) maDeckLayoutTrigger; -Rectangle maBoundingBox; +const ::boost::functionContext(void) maContextAccess; }; typedef ::boost::shared_ptrPanel SharedPanel; typedef ::std::vectorSharedPanel SharedPanelContainer; diff --git
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/SidebarController.cxx | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) New commits: commit a080ba5ed71607b8b2540f6c1ab855c825ade662 Author: Andre Fischer a...@apache.org Date: Wed May 8 12:35:53 2013 + Resolves: #i122082# Show correct deck title and tab bar highlight... after switching sidebar decks (cherry picked from commit f44ca372a2a88f996366e5cb44842ef79dd9df6e) Change-Id: I2162b2eafb8bd1fc8c803a398b475cdf71b6c34d diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 3a28941..6656714 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -382,7 +382,6 @@ void SidebarController::UpdateConfigurations (void) maCurrentContext, mbIsDocumentReadOnly, mxFrame); -mpTabBar-SetDecks(aDecks); // Notify the tab bar about the updated set of decks. mpTabBar-SetDecks(aDecks); @@ -414,13 +413,12 @@ void SidebarController::UpdateConfigurations (void) // We did not find a valid deck. RequestCloseDeck(); return; - -// Tell the tab bar to highlight the button associated -// with the deck. -mpTabBar-HighlightDeck(sNewDeckId); } -msCurrentDeckId = sNewDeckId; +// Tell the tab bar to highlight the button associated +// with the deck. +mpTabBar-HighlightDeck(sNewDeckId); + SwitchToDeck( *ResourceManager::Instance().GetDeckDescriptor(sNewDeckId), maCurrentContext); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/TitleBar.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit dbb9b218462cda204f718c80f58f5bc1aec8e25a Author: Andre Fischer a...@apache.org Date: Tue Apr 23 12:49:57 2013 + Related: #i122144# Paint titles of sidebar decks and titles bold (cherry picked from commit 4b7c52c48793d005d3bd618b025b890ff94e7774) Change-Id: I5e8ad1db7a962f002beb1b976d85a29bfcb5403f diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx index 1a48d03..f5eac2a 100644 --- a/sfx2/source/sidebar/TitleBar.cxx +++ b/sfx2/source/sidebar/TitleBar.cxx @@ -133,6 +133,7 @@ void TitleBar::PaintTitle (const Rectangle rTitleBox) Push(PUSH_FONT | PUSH_TEXTCOLOR); Font aFont(GetFont()); +aFont.SetWeight(WEIGHT_BOLD); SetFont(aFont); // Paint title bar text. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/Panel.cxx | 17 --- sfx2/source/sidebar/Panel.hxx |7 +++--- sfx2/source/sidebar/PanelTitleBar.cxx | 32 +++--- sfx2/source/sidebar/PanelTitleBar.hxx |7 +++--- sfx2/source/sidebar/SidebarController.cxx | 16 +++ sfx2/source/sidebar/SidebarController.hxx |3 -- 6 files changed, 51 insertions(+), 31 deletions(-) New commits: commit 28a73fa4048a921b045655b036a445333774acc4 Author: Oliver-Rainer Wittmann o...@apache.org Date: Thu Apr 25 10:51:17 2013 + Related: #i121420# apply context dependent Show Menu Commands... according given panel configurations (cherry picked from commit c4a3b967b0ba367b219ac181fe2ed24a64e3c224) Change-Id: Ib2b3161c70112032659e712556641a46f43edcd0 diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx index 5389b4f..19b0588 100644 --- a/sfx2/source/sidebar/Panel.cxx +++ b/sfx2/source/sidebar/Panel.cxx @@ -47,15 +47,13 @@ namespace sfx2 { namespace sidebar { Panel::Panel ( const PanelDescriptor rPanelDescriptor, Window* pParentWindow, -const ::boost::functionvoid(void) rDeckLayoutTrigger, -const ::boost::functionvoid(void) rShowMenuFunctor) +const ::boost::functionvoid(void) rDeckLayoutTrigger ) : Window(pParentWindow), msPanelId(rPanelDescriptor.msId), mpTitleBar(new PanelTitleBar( rPanelDescriptor.msTitle, pParentWindow, - this, - rShowMenuFunctor)), + this)), mbIsTitleBarOptional(rPanelDescriptor.mbIsTitleBarOptional), mxElement(), mxPanelComponent(), @@ -82,6 +80,17 @@ Panel::~Panel (void) +void Panel::SetShowMenuFunctor( const ::boost::functionvoid(void) rShowMenuFunctor ) +{ +if ( mpTitleBar.get() ) +{ +mpTitleBar-SetMenuAction( rShowMenuFunctor ); +} +} + + + + void Panel::Dispose (void) { mxPanelComponent = NULL; diff --git a/sfx2/source/sidebar/Panel.hxx b/sfx2/source/sidebar/Panel.hxx index ce6cb3c..5a7ca1c 100644 --- a/sfx2/source/sidebar/Panel.hxx +++ b/sfx2/source/sidebar/Panel.hxx @@ -35,6 +35,7 @@ namespace sfx2 { namespace sidebar { class PanelDescriptor; class TitleBar; +class PanelTitleBar; class Panel @@ -44,12 +45,12 @@ public: Panel ( const PanelDescriptor rPanelDescriptor, Window* pParentWindow, -const ::boost::functionvoid(void) rDeckLayoutTrigger, -const ::boost::functionvoid(void) rShowMenuFunctor); +const ::boost::functionvoid(void) rDeckLayoutTrigger ); virtual ~Panel (void); void Dispose (void); +void SetShowMenuFunctor( const ::boost::functionvoid(void) rShowMenuFunctor ); TitleBar* GetTitleBar (void) const; bool IsTitleBarOptional (void) const; void SetUIElement (const cssu::Referencecss::ui::XUIElement rxElement); @@ -69,7 +70,7 @@ public: private: const ::rtl::OUString msPanelId; -::boost::scoped_ptrTitleBar mpTitleBar; +::boost::scoped_ptrPanelTitleBar mpTitleBar; const bool mbIsTitleBarOptional; cssu::Referencecss::ui::XUIElement mxElement; cssu::Referencecss::ui::XSidebarPanel mxPanelComponent; diff --git a/sfx2/source/sidebar/PanelTitleBar.cxx b/sfx2/source/sidebar/PanelTitleBar.cxx index ded65fb..28f819b 100644 --- a/sfx2/source/sidebar/PanelTitleBar.cxx +++ b/sfx2/source/sidebar/PanelTitleBar.cxx @@ -41,24 +41,15 @@ static const sal_Int32 gaRightIconPadding (5); PanelTitleBar::PanelTitleBar ( const ::rtl::OUString rsTitle, Window* pParentWindow, -Panel* pPanel, -const ::boost::functionvoid(void) rMenuAction) +Panel* pPanel ) : TitleBar(rsTitle, pParentWindow, GetBackgroundPaint()), mbIsLeftButtonDown(false), mpPanel(pPanel), mnMenuItemIndex(1), - maMenuAction(rMenuAction) + maMenuAction() { OSL_ASSERT(mpPanel != NULL); -if (maMenuAction) -{ -maToolBox.InsertItem( -mnMenuItemIndex, -Theme::GetImage(Theme::Image_PanelMenu)); -maToolBox.SetOutStyle(TOOLBOX_STYLE_FLAT); -} - #ifdef DEBUG SetText(A2S(PanelTitleBar)); #endif @@ -74,6 +65,25 @@ PanelTitleBar::~PanelTitleBar (void) +void PanelTitleBar::SetMenuAction ( const ::boost::functionvoid(void) rMenuAction ) +{ +if ( !maMenuAction rMenuAction ) +{ +maToolBox.InsertItem( +mnMenuItemIndex, +Theme::GetImage(Theme::Image_PanelMenu)); +maToolBox.SetOutStyle(TOOLBOX_STYLE_FLAT); +} +else if ( maMenuAction !rMenuAction ) +{ +maToolBox.RemoveItem( maToolBox.GetItemPos( mnMenuItemIndex ) ); +} +maMenuAction = rMenuAction; +} + + + + Rectangle PanelTitleBar::GetTitleArea (const Rectangle rTitleBarBox) { if (mpPanel != NULL) diff --git a/sfx2/source/sidebar/PanelTitleBar.hxx b/sfx2/source/sidebar/PanelTitleBar.hxx index f76edcb..dff82a9
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/Theme.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 0a9249f1e00a2792707e31976a7d45ae05240cef Author: Andre Fischer a...@apache.org Date: Fri Apr 26 06:45:40 2013 + Related: #i122144# Use same color for all sidebar backgrounds (cherry picked from commit ae86d3036171e63bfe193e678c9c05a1ec1a12bb) Change-Id: I4879d515f45f74b25e0319d3244c5722a449c7ed diff --git a/sfx2/source/sidebar/Theme.cxx b/sfx2/source/sidebar/Theme.cxx index d571885..b7ef8b5 100644 --- a/sfx2/source/sidebar/Theme.cxx +++ b/sfx2/source/sidebar/Theme.cxx @@ -212,7 +212,9 @@ void Theme::UpdateTheme (void) #define Alternatives(n,hc,sys) (mbIsHighContrastMode ? hc : (bUseSystemColors ? sys : n)) -const Color aBaseBackgroundColor (rStyle.GetDialogColor()); +Color aBaseBackgroundColor (rStyle.GetDialogColor()); +// UX says this should be a little brighter, but that looks off when compared to the other windows. +//aBaseBackgroundColor.IncreaseLuminance(7); Color aBorderColor (aBaseBackgroundColor); aBorderColor.DecreaseLuminance(15); Color aSecondColor (aBaseBackgroundColor); @@ -220,7 +222,7 @@ void Theme::UpdateTheme (void) setPropertyValue( maPropertyIdToNameMap[Paint_DeckBackground], -Any(sal_Int32(rStyle.GetMenuColor().GetRGBColor(; +Any(sal_Int32(aBaseBackgroundColor.GetRGBColor(; setPropertyValue( maPropertyIdToNameMap[Paint_DeckTitleBarBackground], @@ -257,9 +259,7 @@ void Theme::UpdateTheme (void) rStyle.GetFloatTitleHeight(); setPropertyValue( maPropertyIdToNameMap[Paint_PanelBackground], -Any(sal_Int32(rStyle.GetDialogColor().GetRGBColor(; -//Any(sal_Int32(mbIsHighContrastMode ? 0x00 : -//0xff))); +Any(sal_Int32(aBaseBackgroundColor.GetRGBColor(; setPropertyValue( maPropertyIdToNameMap[Paint_PanelTitleBarBackground], ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/SidebarController.cxx | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) New commits: commit e3860a6db8d11da357932b393fe7cc8a7f0684b3 Author: Andre Fischer a...@apache.org Date: Fri Apr 19 14:27:16 2013 + Resolves: #i122104# Fixed selection of sidebar button. (cherry picked from commit 8d956f9ec332f818fbe49286ba8eec28179486f2) Change-Id: If87b0dd13d1d333212d41f0a1e1122e4ef6c5ab2 diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 55a384e..887e245 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -59,6 +59,7 @@ using namespace cssu; using ::rtl::OUString; +#undef VERBOSE namespace sfx2 { namespace sidebar { @@ -149,7 +150,6 @@ void SAL_CALL SidebarController::disposing (void) if (mpCurrentDeck) { mpCurrentDeck-Dispose(); -OSL_TRACE(deleting deck window subtree); mpCurrentDeck-PrintWindowTree(); mpCurrentDeck.reset(); } @@ -256,7 +256,7 @@ void SidebarController::NotifyResize (void) mnSavedSidebarWidth = nWidth; RestrictWidth(); -#ifdef DEBUG +#ifdef VERBOSE if (mpCurrentDeck) { mpCurrentDeck-PrintWindowTree(); @@ -315,6 +315,10 @@ void SidebarController::UpdateConfigurations (const Context rContext) { msCurrentDeckId = pDeckDescriptor-msId; SwitchToDeck(*pDeckDescriptor, rContext); + +// Tell the tab bar to highlight the button associated +// with the deck. +mpTabBar-HighlightDeck(msCurrentDeckId); } #ifdef DEBUG @@ -439,7 +443,6 @@ void SidebarController::SwitchToDeck ( { // Panel already exists in current deck. Reuse it. aNewPanels[nWriteIndex] = *iPanel; -OSL_TRACE(reusing panel %s, S2A(rPanelContexDescriptor.msId)); } else { @@ -448,7 +451,6 @@ void SidebarController::SwitchToDeck ( rPanelContexDescriptor.msId, mpCurrentDeck-GetPanelParentWindow(), rPanelContexDescriptor.msMenuCommand); -OSL_TRACE(creating panel %s, S2A(rPanelContexDescriptor.msId)); bHasPanelSetChanged = true; } if (aNewPanels[nWriteIndex] != NULL) @@ -471,10 +473,6 @@ void SidebarController::SwitchToDeck ( mpCurrentDeck-SetPanels(aNewPanels); mpCurrentDeck-Show(); -// Tell the tab bar to highlight the button associated with the -// deck. -mpTabBar-HighlightDeck(rDeckDescriptor.msId); - mpParentWindow-SetText(rDeckDescriptor.msTitle); if (bHasPanelSetChanged) @@ -493,7 +491,7 @@ bool SidebarController::ArePanelSetsEqual ( const SharedPanelContainer rCurrentPanels, const ResourceManager::PanelContextDescriptorContainer rRequestedPanels) { -#ifdef DEBUG +#ifdef VERBOSE OSL_TRACE(current panel list:); for (SharedPanelContainer::const_iterator iPanel(rCurrentPanels.begin()), @@ -539,12 +537,6 @@ SharedPanel SidebarController::CreatePanel ( if (pPanelDescriptor == NULL) return SharedPanel(); -#ifdef DEBUG -// Prevent the panel not being created in the same memory of an old panel. -::boost::scoped_arraychar pUnused (new char[sizeof(Panel)]); -OSL_TRACE(allocated memory at %x, pUnused.get()); -#endif - // Create the panel which is the parent window of the UIElement. SharedPanel pPanel (new Panel( *pPanelDescriptor, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/SidebarController.cxx | 28 sfx2/source/sidebar/SidebarController.hxx |6 +- 2 files changed, 21 insertions(+), 13 deletions(-) New commits: commit c07c242be32d61d991522cd59e87e0922854614a Author: Andre Fischer a...@apache.org Date: Mon Apr 22 15:01:51 2013 + Resolves: #i122095# React asynchronously to context changes In order to avoid problems in SFX2 (cherry picked from commit 61ed9eac0583e34a9b69f0a1adcc208509e336a1) Change-Id: I375603a28e788ce9257be308dc09a589240d0e58 diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 887e245..969cc04 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -91,6 +91,7 @@ SidebarController::SidebarController ( maCurrentContext(OUString(), OUString()), msCurrentDeckId(A2S(PropertyDeck)), maPropertyChangeForwarder(::boost::bind(SidebarController::BroadcastPropertyChange, this)), + maContextChangeUpdate(::boost::bind(SidebarController::UpdateConfigurations, this)), mbIsDeckClosed(false), mnSavedSidebarWidth(pParentWindow-GetSizePixel().Width()) { @@ -167,10 +168,14 @@ void SAL_CALL SidebarController::disposing (void) void SAL_CALL SidebarController::notifyContextChangeEvent (const css::ui::ContextChangeEventObject rEvent) throw(cssu::RuntimeException) { -UpdateConfigurations( -Context( -rEvent.ApplicationName, -rEvent.ContextName)); +// Update to the requested new context asynchronously to avoid +// subtle errors caused by SFX2 which in rare cases can not +// properly handle a synchronous update. +maRequestedContext = Context( +rEvent.ApplicationName, +rEvent.ContextName); +if (maRequestedContext != maCurrentContext) +maContextChangeUpdate.RequestCall(); } @@ -277,17 +282,17 @@ void SidebarController::NotifyResize (void) -void SidebarController::UpdateConfigurations (const Context rContext) +void SidebarController::UpdateConfigurations (void) { -if (maCurrentContext != rContext) +if (maCurrentContext != maRequestedContext) { -maCurrentContext = rContext; +maCurrentContext = maRequestedContext; // Notify the tab bar about the updated set of decks. ResourceManager::IdContainer aDeckIds; ResourceManager::Instance().GetMatchingDecks ( aDeckIds, -rContext, +maCurrentContext, mxFrame); mpTabBar-SetDecks(aDeckIds); @@ -308,13 +313,13 @@ void SidebarController::UpdateConfigurations (const Context rContext) DeckDescriptor const* pDeckDescriptor = NULL; if ( ! bCurrentDeckMatches) -pDeckDescriptor = ResourceManager::Instance().GetBestMatchingDeck(rContext, mxFrame); +pDeckDescriptor = ResourceManager::Instance().GetBestMatchingDeck(maCurrentContext, mxFrame); else pDeckDescriptor = ResourceManager::Instance().GetDeckDescriptor(msCurrentDeckId); if (pDeckDescriptor != NULL) { msCurrentDeckId = pDeckDescriptor-msId; -SwitchToDeck(*pDeckDescriptor, rContext); +SwitchToDeck(*pDeckDescriptor, maCurrentContext); // Tell the tab bar to highlight the button associated // with the deck. @@ -327,7 +332,7 @@ void SidebarController::UpdateConfigurations (const Context rContext) { DeckTitleBar* pTitleBar = mpCurrentDeck-GetTitleBar(); if (pTitleBar != NULL) -pTitleBar-SetTitle(msCurrentDeckTitle+A2S( ()+rContext.msContext+A2S())); +pTitleBar-SetTitle(msCurrentDeckTitle+A2S( ()+maCurrentContext.msContext+A2S())); } #endif } @@ -861,7 +866,6 @@ bool SidebarController::CanModifyChildWindowWidth (void) const SfxSplitWindow* pSplitWindow = dynamic_castSfxSplitWindow*(mpParentWindow-GetParent()); if (pSplitWindow == NULL) { -OSL_ASSERT(pSplitWindow!=NULL); return 0; } diff --git a/sfx2/source/sidebar/SidebarController.hxx b/sfx2/source/sidebar/SidebarController.hxx index 38ce50b..4ae0f7d 100644 --- a/sfx2/source/sidebar/SidebarController.hxx +++ b/sfx2/source/sidebar/SidebarController.hxx @@ -107,9 +107,11 @@ private: ::boost::scoped_ptrTabBar mpTabBar; cssu::Referencecss::frame::XFrame mxFrame; Context maCurrentContext; +Context maRequestedContext; ::rtl::OUString msCurrentDeckId; ::rtl::OUString msCurrentDeckTitle; AsynchronousCall maPropertyChangeForwarder; +AsynchronousCall maContextChangeUpdate; bool mbIsDeckClosed; /** Before the deck is closed the sidebar width is saved into this variable, so that it can be restored when the deck is reopended. @@ -118,7 +120,9 @@ private: FocusManager
[Libreoffice-commits] core.git: Branch 'feature/sidebar' - sfx2/source
sfx2/source/sidebar/SidebarController.cxx | 15 +-- sfx2/source/sidebar/SidebarController.hxx |3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) New commits: commit 02e826258f757e954f40f6a928a0351724a7280a Author: Andre Fischer a...@apache.org Date: Thu Apr 11 12:04:57 2013 + Related: #i121420# Provide sidebar panels with XCanvas objects. (cherry picked from commit d179a612f5f9c01776ea52bfdcf27f1cb864f249) Conflicts: sfx2/source/sidebar/SidebarController.cxx Change-Id: I755d55ac0f5a97fdd11476ce11631afb362e83d8 diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx index 08e1e6d..55a384e 100644 --- a/sfx2/source/sidebar/SidebarController.cxx +++ b/sfx2/source/sidebar/SidebarController.cxx @@ -35,6 +35,7 @@ #include splitwin.hxx #include svl/smplhint.hxx #include tools/link.hxx +#include toolkit/helper/vclunohelper.hxx #include comphelper/processfactory.hxx #include comphelper/componentcontext.hxx #include comphelper/namedvaluecollection.hxx @@ -46,6 +47,7 @@ #include com/sun/star/ui/XUIElementFactory.hpp #include com/sun/star/util/XURLTransformer.hpp #include com/sun/star/util/URL.hpp +#include com/sun/star/rendering/XSpriteCanvas.hpp #include boost/bind.hpp #include boost/function.hpp @@ -491,6 +493,7 @@ bool SidebarController::ArePanelSetsEqual ( const SharedPanelContainer rCurrentPanels, const ResourceManager::PanelContextDescriptorContainer rRequestedPanels) { +#ifdef DEBUG OSL_TRACE(current panel list:); for (SharedPanelContainer::const_iterator iPanel(rCurrentPanels.begin()), @@ -510,6 +513,7 @@ bool SidebarController::ArePanelSetsEqual ( { OSL_TRACE(panel %s, S2A(iId-msId)); } +#endif if (rCurrentPanels.size() != rRequestedPanels.size()) return false; @@ -553,7 +557,8 @@ SharedPanel SidebarController::CreatePanel ( // Create the XUIElement. Referenceui::XUIElement xUIElement (CreateUIElement( pPanel-GetComponentInterface(), -pPanelDescriptor-msImplementationURL)); +pPanelDescriptor-msImplementationURL, +pPanelDescriptor-mbWantsCanvas)); if (xUIElement.is()) { // Initialize the panel and add it to the active deck. @@ -572,7 +577,8 @@ SharedPanel SidebarController::CreatePanel ( Referenceui::XUIElement SidebarController::CreateUIElement ( const Referenceawt::XWindowPeer rxWindow, -const ::rtl::OUString rsImplementationURL) +const ::rtl::OUString rsImplementationURL, +const bool bWantsCanvas) { try { @@ -590,6 +596,11 @@ Referenceui::XUIElement SidebarController::CreateUIElement ( aCreationArguments.put(SfxBindings, makeAny(sal_uInt64(pSfxDockingWindow-GetBindings(; aCreationArguments.put(Theme, Theme::GetPropertySet()); aCreationArguments.put(Sidebar, makeAny(Referenceui::XSidebar(static_castui::XSidebar*(this; +if (bWantsCanvas) +{ +Referencerendering::XSpriteCanvas xCanvas (VCLUnoHelper::GetWindow(rxWindow)-GetSpriteCanvas()); +aCreationArguments.put(Canvas, makeAny(xCanvas)); +} Referenceui::XUIElement xUIElement( xUIElementFactory-createUIElement( diff --git a/sfx2/source/sidebar/SidebarController.hxx b/sfx2/source/sidebar/SidebarController.hxx index 8902a73..38ce50b 100644 --- a/sfx2/source/sidebar/SidebarController.hxx +++ b/sfx2/source/sidebar/SidebarController.hxx @@ -124,7 +124,8 @@ private: const ResourceManager::PanelContextDescriptorContainer rRequestedPanels); cssu::Referencecss::ui::XUIElement CreateUIElement ( const cssu::Referencecss::awt::XWindowPeer rxWindow, -const ::rtl::OUString rsImplementationURL); +const ::rtl::OUString rsImplementationURL, +const bool bWantsCanvas); SharedPanel CreatePanel ( const ::rtl::OUString rsPanelId, ::Window* pParentWindow, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits