[Libreoffice-commits] core.git: 4 commits - sfx2/source

Thomas Arnhold thomas at arnhold.org
Sat Aug 23 20:28:00 PDT 2014


 sfx2/source/sidebar/SidebarController.cxx |   17 +++++++++++++++--
 sfx2/source/sidebar/TabBar.cxx            |   13 +++++++++++++
 sfx2/source/sidebar/TabBar.hxx            |    1 +
 3 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit c499b2ccdfaef475d6415d571353d51eddf1bef2
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sun Aug 24 05:24:02 2014 +0200

    Sidebar: Ensure Deck is open, if we choose an element from the Deck popup menu.
    
    Otherwise the Deck will be changed, but not shown...
    
    Change-Id: I4be7756542a8c21a616e7615ef40535e7310b90c

diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 2a01514..8760176 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -997,7 +997,10 @@ IMPL_LINK(SidebarController, OnMenuItemSelected, Menu*, pMenu)
             try
             {
                 if (nIndex >= MID_FIRST_PANEL && nIndex<MID_FIRST_HIDE)
+                {
+                    RequestOpenDeck();
                     SwitchToDeck(mpTabBar->GetDeckIdForIndex(nIndex - MID_FIRST_PANEL));
+                }
                 else if (nIndex >=MID_FIRST_HIDE)
                     if (pMenu->GetItemBits(nIndex) == MIB_CHECKABLE)
                         mpTabBar->ToggleHideFlag(nIndex-MID_FIRST_HIDE);
commit 04e96b6d6eb55b9ff2a6ec9c4ce52260e33df121
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sun Aug 24 02:51:43 2014 +0200

    fdo#67627 Clicking on icons of the sidebar should both open and close Decks
    
    Change-Id: I921a8a0b749df62c50f0ae8cb2de85f6cb459784

diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index b4ae71a..2a01514 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -525,6 +525,13 @@ void SidebarController::UpdateConfigurations (void)
 void SidebarController::OpenThenSwitchToDeck (
     const ::rtl::OUString& rsDeckId)
 {
+    // fdo#67627 Clicking a second time on a Deck icon will close the Deck
+    if (mbIsDeckOpen && mbIsDeckOpen.get() && msCurrentDeckId == rsDeckId)
+    {
+        RequestCloseDeck();
+        return;
+    }
+
     RequestOpenDeck();
     SwitchToDeck(rsDeckId);
     mpTabBar->Invalidate();
commit d3ebe3e3dcdb89b7713641241f7d431352ba8c5f
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sun Aug 24 02:35:16 2014 +0200

    Sidebar: Use proper default value for Deck
    
    gsDefaultDeckId is "PropertyDeck". Deck "default" does not exist
    and triggers a fallback, which is the first Deck in the list, which is
    "PropertyDeck", too.
    
    Change-Id: If2daa53d002c6547cc5f6fbed1408719c10b149d

diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index 7d7141b..b4ae71a 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -154,7 +154,7 @@ SidebarController::SidebarController (
     if (mxReadOnlyModeDispatch.is())
         mxReadOnlyModeDispatch->addStatusListener(this, aURL);
 
-    SwitchToDeck(OUString("default"));
+    SwitchToDeck(gsDefaultDeckId);
 
     WeakReference<SidebarController> xWeakController (this);
     maSidebarControllerContainer.insert(
@@ -476,7 +476,7 @@ void SidebarController::UpdateConfigurations (void)
 
         // Find the new deck.  By default that is the same as the old
         // one.  If that is not set or not enabled, then choose the
-        // first enabled deck.
+        // first enabled deck (which is PropertyDeck).
         OUString sNewDeckId;
         for (ResourceManager::DeckContextDescriptorContainer::const_iterator
                  iDeck(aDecks.begin()),
commit 3156948d813f94c00ac87f80c5850f9f67b42318
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Sat Aug 23 14:37:16 2014 +0200

    Sidebar: Remove hightlight from TabBar after Deck close
    
    After clicking on "Close Sidebar Deck" the highlighted icon
    will now lose its highlight.
    
    Change-Id: Iee947641343d46c84af7afb93cd52101e39149f7

diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index cb26640..7d7141b 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -1012,6 +1012,9 @@ void SidebarController::RequestCloseDeck (void)
 {
     mbIsDeckRequestedOpen = false;
     UpdateDeckOpenState();
+
+    // remove highlight from TabBar, because Deck will be closed
+    mpTabBar->RemoveDeckHighlight();
 }
 
 
diff --git a/sfx2/source/sidebar/TabBar.cxx b/sfx2/source/sidebar/TabBar.cxx
index 29b377f..8587bcb 100644
--- a/sfx2/source/sidebar/TabBar.cxx
+++ b/sfx2/source/sidebar/TabBar.cxx
@@ -251,6 +251,19 @@ void TabBar::HighlightDeck (const ::rtl::OUString& rsDeckId)
 
 
 
+void TabBar::RemoveDeckHighlight ()
+{
+    for (ItemContainer::iterator iItem(maItems.begin()),iEnd(maItems.end());
+         iItem!=iEnd;
+         ++iItem)
+    {
+        iItem->mpButton->Check(false);
+    }
+}
+
+
+
+
 void TabBar::DataChanged (const DataChangedEvent& rDataChangedEvent)
 {
     SetBackground(Theme::GetPaint(Theme::Paint_TabBarBackground).GetWallpaper());
diff --git a/sfx2/source/sidebar/TabBar.hxx b/sfx2/source/sidebar/TabBar.hxx
index b9d4e71..e037533 100644
--- a/sfx2/source/sidebar/TabBar.hxx
+++ b/sfx2/source/sidebar/TabBar.hxx
@@ -81,6 +81,7 @@ public:
     void SetDecks (
         const ResourceManager::DeckContextDescriptorContainer& rDecks);
     void HighlightDeck (const ::rtl::OUString& rsDeckId);
+    void RemoveDeckHighlight ();
     void AddPopupMenuEntries (
         PopupMenu& rMenu,
         const sal_Int32 nFirstIndex);


More information about the Libreoffice-commits mailing list