Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c4a3b967
Kaydet (Commit)
c4a3b967
authored
Nis 25, 2013
tarafından
Oliver-Rainer Wittmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
121420: apply context dependent Show Menu Commands according given panel configurations
üst
26e4fcdb
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
51 additions
and
31 deletions
+51
-31
Panel.cxx
sfx2/source/sidebar/Panel.cxx
+13
-4
Panel.hxx
sfx2/source/sidebar/Panel.hxx
+4
-3
PanelTitleBar.cxx
sfx2/source/sidebar/PanelTitleBar.cxx
+21
-11
PanelTitleBar.hxx
sfx2/source/sidebar/PanelTitleBar.hxx
+4
-3
SidebarController.cxx
sfx2/source/sidebar/SidebarController.cxx
+8
-8
SidebarController.hxx
sfx2/source/sidebar/SidebarController.hxx
+1
-2
No files found.
sfx2/source/sidebar/Panel.cxx
Dosyayı görüntüle @
c4a3b967
...
@@ -52,15 +52,13 @@ namespace sfx2 { namespace sidebar {
...
@@ -52,15 +52,13 @@ namespace sfx2 { namespace sidebar {
Panel
::
Panel
(
Panel
::
Panel
(
const
PanelDescriptor
&
rPanelDescriptor
,
const
PanelDescriptor
&
rPanelDescriptor
,
Window
*
pParentWindow
,
Window
*
pParentWindow
,
const
::
boost
::
function
<
void
(
void
)
>&
rDeckLayoutTrigger
,
const
::
boost
::
function
<
void
(
void
)
>&
rDeckLayoutTrigger
)
const
::
boost
::
function
<
void
(
void
)
>&
rShowMenuFunctor
)
:
Window
(
pParentWindow
),
:
Window
(
pParentWindow
),
msPanelId
(
rPanelDescriptor
.
msId
),
msPanelId
(
rPanelDescriptor
.
msId
),
mpTitleBar
(
new
PanelTitleBar
(
mpTitleBar
(
new
PanelTitleBar
(
rPanelDescriptor
.
msTitle
,
rPanelDescriptor
.
msTitle
,
pParentWindow
,
pParentWindow
,
this
,
this
)),
rShowMenuFunctor
)),
mbIsTitleBarOptional
(
rPanelDescriptor
.
mbIsTitleBarOptional
),
mbIsTitleBarOptional
(
rPanelDescriptor
.
mbIsTitleBarOptional
),
mxElement
(),
mxElement
(),
mxPanelComponent
(),
mxPanelComponent
(),
...
@@ -87,6 +85,17 @@ Panel::~Panel (void)
...
@@ -87,6 +85,17 @@ Panel::~Panel (void)
void
Panel
::
SetShowMenuFunctor
(
const
::
boost
::
function
<
void
(
void
)
>&
rShowMenuFunctor
)
{
if
(
mpTitleBar
.
get
()
)
{
mpTitleBar
->
SetMenuAction
(
rShowMenuFunctor
);
}
}
void
Panel
::
Dispose
(
void
)
void
Panel
::
Dispose
(
void
)
{
{
mxPanelComponent
=
NULL
;
mxPanelComponent
=
NULL
;
...
...
sfx2/source/sidebar/Panel.hxx
Dosyayı görüntüle @
c4a3b967
...
@@ -39,6 +39,7 @@ namespace sfx2 { namespace sidebar {
...
@@ -39,6 +39,7 @@ namespace sfx2 { namespace sidebar {
class
PanelDescriptor
;
class
PanelDescriptor
;
class
TitleBar
;
class
TitleBar
;
class
PanelTitleBar
;
class
Panel
class
Panel
...
@@ -48,12 +49,12 @@ public:
...
@@ -48,12 +49,12 @@ public:
Panel
(
Panel
(
const
PanelDescriptor
&
rPanelDescriptor
,
const
PanelDescriptor
&
rPanelDescriptor
,
Window
*
pParentWindow
,
Window
*
pParentWindow
,
const
::
boost
::
function
<
void
(
void
)
>&
rDeckLayoutTrigger
,
const
::
boost
::
function
<
void
(
void
)
>&
rDeckLayoutTrigger
);
const
::
boost
::
function
<
void
(
void
)
>&
rShowMenuFunctor
);
virtual
~
Panel
(
void
);
virtual
~
Panel
(
void
);
void
Dispose
(
void
);
void
Dispose
(
void
);
void
SetShowMenuFunctor
(
const
::
boost
::
function
<
void
(
void
)
>&
rShowMenuFunctor
);
TitleBar
*
GetTitleBar
(
void
)
const
;
TitleBar
*
GetTitleBar
(
void
)
const
;
bool
IsTitleBarOptional
(
void
)
const
;
bool
IsTitleBarOptional
(
void
)
const
;
void
SetUIElement
(
const
cssu
::
Reference
<
css
::
ui
::
XUIElement
>&
rxElement
);
void
SetUIElement
(
const
cssu
::
Reference
<
css
::
ui
::
XUIElement
>&
rxElement
);
...
@@ -73,7 +74,7 @@ public:
...
@@ -73,7 +74,7 @@ public:
private
:
private
:
const
::
rtl
::
OUString
msPanelId
;
const
::
rtl
::
OUString
msPanelId
;
::
boost
::
scoped_ptr
<
TitleBar
>
mpTitleBar
;
::
boost
::
scoped_ptr
<
Panel
TitleBar
>
mpTitleBar
;
const
bool
mbIsTitleBarOptional
;
const
bool
mbIsTitleBarOptional
;
cssu
::
Reference
<
css
::
ui
::
XUIElement
>
mxElement
;
cssu
::
Reference
<
css
::
ui
::
XUIElement
>
mxElement
;
cssu
::
Reference
<
css
::
ui
::
XSidebarPanel
>
mxPanelComponent
;
cssu
::
Reference
<
css
::
ui
::
XSidebarPanel
>
mxPanelComponent
;
...
...
sfx2/source/sidebar/PanelTitleBar.cxx
Dosyayı görüntüle @
c4a3b967
...
@@ -46,24 +46,15 @@ static const sal_Int32 gaRightIconPadding (5);
...
@@ -46,24 +46,15 @@ static const sal_Int32 gaRightIconPadding (5);
PanelTitleBar
::
PanelTitleBar
(
PanelTitleBar
::
PanelTitleBar
(
const
::
rtl
::
OUString
&
rsTitle
,
const
::
rtl
::
OUString
&
rsTitle
,
Window
*
pParentWindow
,
Window
*
pParentWindow
,
Panel
*
pPanel
,
Panel
*
pPanel
)
const
::
boost
::
function
<
void
(
void
)
>&
rMenuAction
)
:
TitleBar
(
rsTitle
,
pParentWindow
,
GetBackgroundPaint
()),
:
TitleBar
(
rsTitle
,
pParentWindow
,
GetBackgroundPaint
()),
mbIsLeftButtonDown
(
false
),
mbIsLeftButtonDown
(
false
),
mpPanel
(
pPanel
),
mpPanel
(
pPanel
),
mnMenuItemIndex
(
1
),
mnMenuItemIndex
(
1
),
maMenuAction
(
rMenuAction
)
maMenuAction
()
{
{
OSL_ASSERT
(
mpPanel
!=
NULL
);
OSL_ASSERT
(
mpPanel
!=
NULL
);
if
(
maMenuAction
)
{
maToolBox
.
InsertItem
(
mnMenuItemIndex
,
Theme
::
GetImage
(
Theme
::
Image_PanelMenu
));
maToolBox
.
SetOutStyle
(
TOOLBOX_STYLE_FLAT
);
}
#ifdef DEBUG
#ifdef DEBUG
SetText
(
A2S
(
"PanelTitleBar"
));
SetText
(
A2S
(
"PanelTitleBar"
));
#endif
#endif
...
@@ -79,6 +70,25 @@ PanelTitleBar::~PanelTitleBar (void)
...
@@ -79,6 +70,25 @@ PanelTitleBar::~PanelTitleBar (void)
void
PanelTitleBar
::
SetMenuAction
(
const
::
boost
::
function
<
void
(
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
)
Rectangle
PanelTitleBar
::
GetTitleArea
(
const
Rectangle
&
rTitleBarBox
)
{
{
if
(
mpPanel
!=
NULL
)
if
(
mpPanel
!=
NULL
)
...
...
sfx2/source/sidebar/PanelTitleBar.hxx
Dosyayı görüntüle @
c4a3b967
...
@@ -38,10 +38,11 @@ public:
...
@@ -38,10 +38,11 @@ public:
PanelTitleBar
(
PanelTitleBar
(
const
::
rtl
::
OUString
&
rsTitle
,
const
::
rtl
::
OUString
&
rsTitle
,
Window
*
pParentWindow
,
Window
*
pParentWindow
,
Panel
*
pPanel
,
Panel
*
pPanel
);
const
::
boost
::
function
<
void
(
void
)
>&
rMenuAction
);
virtual
~
PanelTitleBar
(
void
);
virtual
~
PanelTitleBar
(
void
);
void
SetMenuAction
(
const
::
boost
::
function
<
void
(
void
)
>&
rMenuAction
);
virtual
void
DataChanged
(
const
DataChangedEvent
&
rEvent
);
virtual
void
DataChanged
(
const
DataChangedEvent
&
rEvent
);
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMouseEvent
);
virtual
void
MouseButtonDown
(
const
MouseEvent
&
rMouseEvent
);
virtual
void
MouseButtonUp
(
const
MouseEvent
&
rMouseEvent
);
virtual
void
MouseButtonUp
(
const
MouseEvent
&
rMouseEvent
);
...
@@ -57,7 +58,7 @@ private:
...
@@ -57,7 +58,7 @@ private:
bool
mbIsLeftButtonDown
;
bool
mbIsLeftButtonDown
;
Panel
*
mpPanel
;
Panel
*
mpPanel
;
const
sal_uInt16
mnMenuItemIndex
;
const
sal_uInt16
mnMenuItemIndex
;
const
::
boost
::
function
<
void
(
void
)
>
maMenuAction
;
::
boost
::
function
<
void
(
void
)
>
maMenuAction
;
};
};
...
...
sfx2/source/sidebar/SidebarController.cxx
Dosyayı görüntüle @
c4a3b967
...
@@ -462,14 +462,18 @@ void SidebarController::SwitchToDeck (
...
@@ -462,14 +462,18 @@ void SidebarController::SwitchToDeck (
// Panel does not yet exist. Create it.
// Panel does not yet exist. Create it.
aNewPanels
[
nWriteIndex
]
=
CreatePanel
(
aNewPanels
[
nWriteIndex
]
=
CreatePanel
(
rPanelContexDescriptor
.
msId
,
rPanelContexDescriptor
.
msId
,
mpCurrentDeck
->
GetPanelParentWindow
(),
mpCurrentDeck
->
GetPanelParentWindow
());
rPanelContexDescriptor
.
msMenuCommand
);
bHasPanelSetChanged
=
true
;
bHasPanelSetChanged
=
true
;
}
}
if
(
aNewPanels
[
nWriteIndex
]
!=
NULL
)
if
(
aNewPanels
[
nWriteIndex
]
!=
NULL
)
{
{
// Depending on the context we have to collapse the panel.
// Depending on the context we have to collapse the panel.
aNewPanels
[
nWriteIndex
]
->
SetExpanded
(
rPanelContexDescriptor
.
mbIsInitiallyVisible
);
aNewPanels
[
nWriteIndex
]
->
SetExpanded
(
rPanelContexDescriptor
.
mbIsInitiallyVisible
);
// Depending on the context we have to apply the show menu functor.
aNewPanels
[
nWriteIndex
]
->
SetShowMenuFunctor
(
rPanelContexDescriptor
.
msMenuCommand
.
getLength
()
>
0
?
::
boost
::
bind
(
&
SidebarController
::
ShowDetailMenu
,
this
,
rPanelContexDescriptor
.
msMenuCommand
)
:
::
boost
::
function
<
void
(
void
)
>
()
);
++
nWriteIndex
;
++
nWriteIndex
;
}
}
...
@@ -544,8 +548,7 @@ bool SidebarController::ArePanelSetsEqual (
...
@@ -544,8 +548,7 @@ bool SidebarController::ArePanelSetsEqual (
SharedPanel
SidebarController
::
CreatePanel
(
SharedPanel
SidebarController
::
CreatePanel
(
const
OUString
&
rsPanelId
,
const
OUString
&
rsPanelId
,
::
Window
*
pParentWindow
,
::
Window
*
pParentWindow
)
const
OUString
&
rsMenuCommand
)
{
{
const
PanelDescriptor
*
pPanelDescriptor
=
ResourceManager
::
Instance
().
GetPanelDescriptor
(
rsPanelId
);
const
PanelDescriptor
*
pPanelDescriptor
=
ResourceManager
::
Instance
().
GetPanelDescriptor
(
rsPanelId
);
if
(
pPanelDescriptor
==
NULL
)
if
(
pPanelDescriptor
==
NULL
)
...
@@ -555,10 +558,7 @@ SharedPanel SidebarController::CreatePanel (
...
@@ -555,10 +558,7 @@ SharedPanel SidebarController::CreatePanel (
SharedPanel
pPanel
(
new
Panel
(
SharedPanel
pPanel
(
new
Panel
(
*
pPanelDescriptor
,
*
pPanelDescriptor
,
pParentWindow
,
pParentWindow
,
::
boost
::
bind
(
&
Deck
::
RequestLayout
,
mpCurrentDeck
.
get
()),
::
boost
::
bind
(
&
Deck
::
RequestLayout
,
mpCurrentDeck
.
get
())
)
);
rsMenuCommand
.
getLength
()
>
0
?
::
boost
::
bind
(
&
SidebarController
::
ShowDetailMenu
,
this
,
rsMenuCommand
)
:
::
boost
::
function
<
void
(
void
)
>
()));
// Create the XUIElement.
// Create the XUIElement.
Reference
<
ui
::
XUIElement
>
xUIElement
(
CreateUIElement
(
Reference
<
ui
::
XUIElement
>
xUIElement
(
CreateUIElement
(
...
...
sfx2/source/sidebar/SidebarController.hxx
Dosyayı görüntüle @
c4a3b967
...
@@ -136,8 +136,7 @@ private:
...
@@ -136,8 +136,7 @@ private:
const
bool
bWantsCanvas
);
const
bool
bWantsCanvas
);
SharedPanel
CreatePanel
(
SharedPanel
CreatePanel
(
const
::
rtl
::
OUString
&
rsPanelId
,
const
::
rtl
::
OUString
&
rsPanelId
,
::
Window
*
pParentWindow
,
::
Window
*
pParentWindow
);
const
::
rtl
::
OUString
&
rsMenuCommand
);
void
SwitchToDeck
(
void
SwitchToDeck
(
const
DeckDescriptor
&
rDeckDescriptor
,
const
DeckDescriptor
&
rDeckDescriptor
,
const
Context
&
rContext
);
const
Context
&
rContext
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment