View | Details | Raw Unified | Return to issue 122086
Collapse All | Expand All

(-)a/main/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs (+28 lines)
Lines 64-69 Link Here
64
        </info>
64
        </info>
65
        <value></value>
65
        <value></value>
66
      </prop>
66
      </prop>
67
      <prop oor:name="TitleBarIconURL" oor:type="xs:string">
68
        <info>
69
          <desc>This icon is displayed in the title bar of the deck.
70
          Any URL scheme supported by the com.sun.star.graphic.GraphicProvider service is suitable here.</desc>
71
        </info>
72
        <value></value>
73
      </prop>
74
      <prop oor:name="HighContrastTitleBarIconURL" oor:type="xs:string">
75
        <info>
76
          <desc>This icon is displayed in the title bar of the deck when high contrast mode is active.
77
          Any URL scheme supported by the com.sun.star.graphic.GraphicProvider service is suitable here.</desc>
78
        </info>
79
        <value></value>
80
      </prop>
67
      <prop oor:name="HelpURL" oor:type="xs:string">
81
      <prop oor:name="HelpURL" oor:type="xs:string">
68
        <info>
82
        <info>
69
          <desc>Help about the sidebar deck.</desc>
83
          <desc>Help about the sidebar deck.</desc>
Lines 149-154 Link Here
149
        </info>
163
        </info>
150
        <value></value>
164
        <value></value>
151
      </prop>
165
      </prop>
166
      <prop oor:name="TitleBarIconURL" oor:type="xs:string">
167
        <info>
168
          <desc>This icon is displayed in the title bar of the panel.
169
          Any URL scheme supported by the com.sun.star.graphic.GraphicProvider service is suitable here.</desc>
170
        </info>
171
        <value></value>
172
      </prop>
173
      <prop oor:name="HighContrastTitleBarIconURL" oor:type="xs:string">
174
        <info>
175
          <desc>This icon is displayed in the title bar of the panel when high contrast mode is active.
176
          Any URL scheme supported by the com.sun.star.graphic.GraphicProvider service is suitable here.</desc>
177
        </info>
178
        <value></value>
179
      </prop>
152
      <prop oor:name="HelpURL" oor:type="xs:string">
180
      <prop oor:name="HelpURL" oor:type="xs:string">
153
        <info>
181
        <info>
154
          <desc>Help about the sidebar content panel.</desc>
182
          <desc>Help about the sidebar content panel.</desc>
(-)a/main/sfx2/source/sidebar/Deck.hxx (+2 lines)
Lines 97-102 private: Link Here
97
    ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
97
    ::boost::scoped_ptr<ScrollBar> mpVerticalScrollBar;
98
    
98
    
99
    DECL_LINK(HandleVerticalScrollBarChange,void*);
99
    DECL_LINK(HandleVerticalScrollBarChange,void*);
100
101
    
100
};
102
};
101
103
102
104
(-)a/main/sfx2/source/sidebar/DeckDescriptor.hxx (+2 lines)
Lines 36-41 public: Link Here
36
    ::rtl::OUString msId;
36
    ::rtl::OUString msId;
37
    ::rtl::OUString msIconURL;
37
    ::rtl::OUString msIconURL;
38
    ::rtl::OUString msHighContrastIconURL;
38
    ::rtl::OUString msHighContrastIconURL;
39
    ::rtl::OUString msTitleBarIconURL;
40
    ::rtl::OUString msHighContrastTitleBarIconURL;
39
    ::rtl::OUString msHelpURL;
41
    ::rtl::OUString msHelpURL;
40
    ::rtl::OUString msHelpText;
42
    ::rtl::OUString msHelpText;
41
    ContextList maContextList;
43
    ContextList maContextList;
(-)a/main/sfx2/source/sidebar/PanelDescriptor.hxx (+2 lines)
Lines 36-41 public: Link Here
36
    sal_Bool mbIsTitleBarOptional;
36
    sal_Bool mbIsTitleBarOptional;
37
    ::rtl::OUString msId;
37
    ::rtl::OUString msId;
38
    ::rtl::OUString msDeckId;
38
    ::rtl::OUString msDeckId;
39
    ::rtl::OUString msTitleBarIconURL;
40
    ::rtl::OUString msHighContrastTitleBarIconURL;
39
    ::rtl::OUString msHelpURL;
41
    ::rtl::OUString msHelpURL;
40
    ContextList maContextList;
42
    ContextList maContextList;
41
    ::rtl::OUString msImplementationURL;
43
    ::rtl::OUString msImplementationURL;
(-)a/main/sfx2/source/sidebar/ResourceManager.cxx (+8 lines)
Lines 279-284 void ResourceManager::ReadDeckList (void) Link Here
279
            aDeckNode.getNodeValue("IconURL"));
279
            aDeckNode.getNodeValue("IconURL"));
280
        rDeckDescriptor.msHighContrastIconURL = ::comphelper::getString(
280
        rDeckDescriptor.msHighContrastIconURL = ::comphelper::getString(
281
            aDeckNode.getNodeValue("HighContrastIconURL"));
281
            aDeckNode.getNodeValue("HighContrastIconURL"));
282
        rDeckDescriptor.msTitleBarIconURL = ::comphelper::getString(
283
            aDeckNode.getNodeValue("TitleBarIconURL"));
284
        rDeckDescriptor.msHighContrastTitleBarIconURL = ::comphelper::getString(
285
            aDeckNode.getNodeValue("HighContrastTitleBarIconURL"));
282
        rDeckDescriptor.msHelpURL = ::comphelper::getString(
286
        rDeckDescriptor.msHelpURL = ::comphelper::getString(
283
            aDeckNode.getNodeValue("HelpURL"));
287
            aDeckNode.getNodeValue("HelpURL"));
284
        rDeckDescriptor.msHelpText = rDeckDescriptor.msTitle;
288
        rDeckDescriptor.msHelpText = rDeckDescriptor.msTitle;
Lines 331-336 void ResourceManager::ReadPanelList (void) Link Here
331
            aPanelNode.getNodeValue("Id"));
335
            aPanelNode.getNodeValue("Id"));
332
        rPanelDescriptor.msDeckId = ::comphelper::getString(
336
        rPanelDescriptor.msDeckId = ::comphelper::getString(
333
            aPanelNode.getNodeValue("DeckId"));
337
            aPanelNode.getNodeValue("DeckId"));
338
        rPanelDescriptor.msTitleBarIconURL = ::comphelper::getString(
339
            aPanelNode.getNodeValue("TitleBarIconURL"));
340
        rPanelDescriptor.msHighContrastTitleBarIconURL = ::comphelper::getString(
341
            aPanelNode.getNodeValue("HighContrastTitleBarIconURL"));
334
        rPanelDescriptor.msHelpURL = ::comphelper::getString(
342
        rPanelDescriptor.msHelpURL = ::comphelper::getString(
335
            aPanelNode.getNodeValue("HelpURL"));
343
            aPanelNode.getNodeValue("HelpURL"));
336
        rPanelDescriptor.msImplementationURL = ::comphelper::getString(
344
        rPanelDescriptor.msImplementationURL = ::comphelper::getString(
(-)a/main/sfx2/source/sidebar/SidebarController.cxx (+46 lines)
Lines 492-497 void SidebarController::SwitchToDeck ( Link Here
492
    // buttons.
492
    // buttons.
493
    maFocusManager.SetPanels(aNewPanels);
493
    maFocusManager.SetPanels(aNewPanels);
494
    mpTabBar->UpdateFocusManager(maFocusManager);
494
    mpTabBar->UpdateFocusManager(maFocusManager);
495
    UpdateTitleBarIcons();
495
}
496
}
496
497
497
498
Lines 653-658 IMPL_LINK(SidebarController, WindowEventHandler, VclWindowEvent*, pEvent) Link Here
653
                // Force an update of deck and tab bar to reflect
654
                // Force an update of deck and tab bar to reflect
654
                // changes in theme (high contrast mode).
655
                // changes in theme (high contrast mode).
655
                Theme::HandleDataChange();
656
                Theme::HandleDataChange();
657
                UpdateTitleBarIcons();
656
                mpParentWindow->Invalidate();
658
                mpParentWindow->Invalidate();
657
                break;
659
                break;
658
                
660
                
Lines 943-946 void SidebarController::RestrictWidth (void) Link Here
943
}
945
}
944
946
945
947
948
949
950
void SidebarController::UpdateTitleBarIcons (void)
951
{
952
    if ( ! mpCurrentDeck)
953
        return;
954
    
955
    const bool bIsHighContrastModeActive (Theme::IsHighContrastMode());
956
    const ResourceManager& rResourceManager (ResourceManager::Instance());
957
    
958
    // Update the deck icon.
959
    const DeckDescriptor* pDeckDescriptor = rResourceManager.GetDeckDescriptor(mpCurrentDeck->GetId());
960
    if (pDeckDescriptor != NULL && mpCurrentDeck->GetTitleBar())
961
    {
962
        const OUString sIconURL(
963
            bIsHighContrastModeActive
964
                ? pDeckDescriptor->msHighContrastTitleBarIconURL
965
                : pDeckDescriptor->msTitleBarIconURL);
966
        mpCurrentDeck->GetTitleBar()->SetIcon(Tools::GetImage(sIconURL, mxFrame));
967
    }
968
969
    // Update the panel icons.
970
    const SharedPanelContainer& rPanels (mpCurrentDeck->GetPanels());
971
    for (SharedPanelContainer::const_iterator
972
             iPanel(rPanels.begin()), iEnd(rPanels.end());
973
             iPanel!=iEnd;
974
             ++iPanel)
975
    {
976
        if ( ! *iPanel)
977
            continue;
978
        if ((*iPanel)->GetTitleBar() == NULL)
979
            continue;
980
        const PanelDescriptor* pPanelDescriptor = rResourceManager.GetPanelDescriptor((*iPanel)->GetId());
981
        if (pPanelDescriptor == NULL)
982
            continue;
983
        const OUString sIconURL (
984
            bIsHighContrastModeActive
985
               ? pPanelDescriptor->msHighContrastTitleBarIconURL
986
               : pPanelDescriptor->msTitleBarIconURL);
987
        (*iPanel)->GetTitleBar()->SetIcon(Tools::GetImage(sIconURL, mxFrame));
988
    }
989
}
990
991
946
} } // end of namespace sfx2::sidebar
992
} } // end of namespace sfx2::sidebar
(-)a/main/sfx2/source/sidebar/SidebarController.hxx (+6 lines)
Lines 160-165 private: Link Here
160
    sal_Int32 SetChildWindowWidth (const sal_Int32 nNewWidth);
160
    sal_Int32 SetChildWindowWidth (const sal_Int32 nNewWidth);
161
161
162
    void RestrictWidth (void);
162
    void RestrictWidth (void);
163
164
    /** Update the icons displayed in the title bars of the deck and
165
        the panels.  This is called once when a deck is created and
166
        every time when a data change event is processed.
167
    */
168
    void UpdateTitleBarIcons (void);
163
    
169
    
164
    virtual void SAL_CALL disposing (void);
170
    virtual void SAL_CALL disposing (void);
165
};
171
};
(-)a/main/sfx2/source/sidebar/TitleBar.cxx (-3 / +32 lines)
Lines 30-35 Link Here
30
30
31
ToolbarValue::~ToolbarValue (void) {}
31
ToolbarValue::~ToolbarValue (void) {}
32
32
33
namespace
34
{
35
    const static sal_Int32 gnLeftIconSpace (3);
36
    const static sal_Int32 gnRightIconSpace (3);
37
}
33
38
34
namespace sfx2 { namespace sidebar {
39
namespace sfx2 { namespace sidebar {
35
40
Lines 39-48 TitleBar::TitleBar ( Link Here
39
    const sidebar::Paint& rInitialBackgroundPaint)
44
    const sidebar::Paint& rInitialBackgroundPaint)
40
    : Window(pParentWindow),
45
    : Window(pParentWindow),
41
      maToolBox(this),
46
      maToolBox(this),
42
      msTitle(rsTitle)
47
      msTitle(rsTitle),
48
      maIcon()
43
{
49
{
44
    SetBackground(rInitialBackgroundPaint.GetWallpaper());
50
    SetBackground(rInitialBackgroundPaint.GetWallpaper());
45
51
    
46
    maToolBox.SetSelectHdl(LINK(this, TitleBar, SelectionHandler));
52
    maToolBox.SetSelectHdl(LINK(this, TitleBar, SelectionHandler));
47
}
53
}
48
54
Lines 65-70 void TitleBar::SetTitle (const ::rtl::OUString& rsTitle) Link Here
65
71
66
72
67
73
74
void TitleBar::SetIcon (const Image& rIcon)
75
{
76
    maIcon = rIcon;
77
    Invalidate();
78
}
79
80
81
82
68
void TitleBar::Paint (const Rectangle& rUpdateArea)
83
void TitleBar::Paint (const Rectangle& rUpdateArea)
69
{
84
{
70
    (void)rUpdateArea;
85
    (void)rUpdateArea;
Lines 137-149 void TitleBar::PaintTitle (const Rectangle& rTitleBox) Link Here
137
{
152
{
138
    Push(PUSH_FONT | PUSH_TEXTCOLOR);
153
    Push(PUSH_FONT | PUSH_TEXTCOLOR);
139
154
155
    Rectangle aTitleBox (rTitleBox);
156
    
157
    // When there is an icon then paint it at the left of the given
158
    // box.
159
    if ( !! maIcon)
160
    {
161
        DrawImage(
162
            Point(
163
                aTitleBox.Left() + gnLeftIconSpace,
164
                aTitleBox.Top() + (aTitleBox.GetHeight()-maIcon.GetSizePixel().Height())/2),
165
            maIcon);
166
        aTitleBox.Left() += gnLeftIconSpace + maIcon.GetSizePixel().Width() + gnRightIconSpace;
167
    }
168
140
    Font aFont(GetFont());
169
    Font aFont(GetFont());
141
    SetFont(aFont);
170
    SetFont(aFont);
142
171
143
    // Paint title bar text.
172
    // Paint title bar text.
144
    SetTextColor(GetTextColor());
173
    SetTextColor(GetTextColor());
145
    DrawText(
174
    DrawText(
146
        rTitleBox,
175
        aTitleBox,
147
        msTitle,
176
        msTitle,
148
        TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER);
177
        TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER);
149
178
(-)a/main/sfx2/source/sidebar/TitleBar.hxx (-1 / +3 lines)
Lines 41-46 public: Link Here
41
    virtual ~TitleBar (void);
41
    virtual ~TitleBar (void);
42
42
43
    void SetTitle (const ::rtl::OUString& rsTitle);
43
    void SetTitle (const ::rtl::OUString& rsTitle);
44
    void SetIcon (const Image& rIcon);
44
45
45
    virtual void Paint (const Rectangle& rUpdateArea);
46
    virtual void Paint (const Rectangle& rUpdateArea);
46
    virtual void DataChanged (const DataChangedEvent& rEvent);
47
    virtual void DataChanged (const DataChangedEvent& rEvent);
Lines 65-71 protected: Link Here
65
    
66
    
66
private:
67
private:
67
    ::rtl::OUString msTitle;
68
    ::rtl::OUString msTitle;
68
69
    Image maIcon;
70
    
69
    void PaintTitle (const Rectangle& rTitleBox);
71
    void PaintTitle (const Rectangle& rTitleBox);
70
    DECL_LINK(SelectionHandler, ToolBox*);
72
    DECL_LINK(SelectionHandler, ToolBox*);
71
};
73
};

Return to issue 122086