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
37e7ed49
Kaydet (Commit)
37e7ed49
authored
Ara 12, 2018
tarafından
Ashod Nakashian
Kaydeden (comit)
Jan Holesovsky
Nis 30, 2019
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sfx: LOK: notify clients of the sidebar state
Change-Id: I35b174c3a5e302ce52ee4063fa71d47feffab624
üst
f14bd829
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
112 additions
and
45 deletions
+112
-45
SidebarController.hxx
include/sfx2/sidebar/SidebarController.hxx
+6
-7
drviewse.cxx
sd/source/ui/view/drviewse.cxx
+5
-0
SidebarController.cxx
sfx2/source/sidebar/SidebarController.cxx
+100
-36
SidebarDockingWindow.cxx
sfx2/source/sidebar/SidebarDockingWindow.cxx
+1
-2
No files found.
include/sfx2/sidebar/SidebarController.hxx
Dosyayı görüntüle @
37e7ed49
...
...
@@ -28,6 +28,7 @@
#include <sfx2/sidebar/Panel.hxx>
#include <sfx2/sidebar/ResourceManager.hxx>
#include <sfx2/sidebar/TabBar.hxx>
#include <sfx2/viewfrm.hxx>
#include <vcl/menu.hxx>
...
...
@@ -67,9 +68,8 @@ class SFX2_DLLPUBLIC SidebarController
public
SidebarControllerInterfaceBase
{
public
:
static
rtl
::
Reference
<
SidebarController
>
create
(
SidebarDockingWindow
*
pParentWindow
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
static
rtl
::
Reference
<
SidebarController
>
create
(
SidebarDockingWindow
*
pParentWindow
,
const
SfxViewFrame
*
pViewFrame
);
virtual
~
SidebarController
()
override
;
SidebarController
(
const
SidebarController
&
)
=
delete
;
SidebarController
&
operator
=
(
const
SidebarController
&
)
=
delete
;
...
...
@@ -163,14 +163,13 @@ public:
void
FadeOut
();
private
:
SidebarController
(
SidebarDockingWindow
*
pParentWindow
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
);
SidebarController
(
SidebarDockingWindow
*
pParentWindow
,
const
SfxViewFrame
*
pViewFrame
);
VclPtr
<
Deck
>
mpCurrentDeck
;
VclPtr
<
SidebarDockingWindow
>
mpParentWindow
;
VclPtr
<
TabBar
>
mpTabBar
;
const
SfxViewFrame
*
mpViewFrame
;
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>
mxFrame
;
VclPtr
<
TabBar
>
mpTabBar
;
Context
maCurrentContext
;
Context
maRequestedContext
;
css
::
uno
::
Reference
<
css
::
frame
::
XController
>
mxCurrentController
;
...
...
sd/source/ui/view/drviewse.cxx
Dosyayı görüntüle @
37e7ed49
...
...
@@ -28,6 +28,7 @@
#include <com/sun/star/uno/Any.hxx>
#include <comphelper/processfactory.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <comphelper/lok.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
...
...
@@ -997,6 +998,10 @@ void DrawViewShell::FuSupport(SfxRequest& rReq)
case
SID_MASTERPAGE
:
// BASIC
{
if
(
comphelper
::
LibreOfficeKit
::
isActive
())
GetViewShell
()
->
libreOfficeKitViewCallback
(
LOK_CALLBACK_STATE_CHANGED
,
".uno:SlideMasterPage=true"
);
// AutoLayouts needs to be finished
GetDoc
()
->
StopWorkStartupDelay
();
...
...
sfx2/source/sidebar/SidebarController.cxx
Dosyayı görüntüle @
37e7ed49
...
...
@@ -45,6 +45,7 @@
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/lok.hxx>
#include <o3tl/make_unique.hxx>
#include <LibreOfficeKit/LibreOfficeKitEnums.h>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
...
...
@@ -63,6 +64,32 @@ namespace
const
static
char
gsReadOnlyCommandName
[]
=
".uno:EditDoc"
;
const
static
sal_Int32
gnWidthCloseThreshold
(
70
);
const
static
sal_Int32
gnWidthOpenThreshold
(
40
);
static
std
::
string
UnoNameFromDeckId
(
const
OUString
&
rsDeckId
)
{
if
(
rsDeckId
==
"SdCustomAnimationDeck"
)
return
".uno:CustomAnimation"
;
if
(
rsDeckId
==
"PropertyDeck"
)
return
".uno:ModifyPage"
;
if
(
rsDeckId
==
"SdLayoutsDeck"
)
return
".uno:ModifyPage"
;
if
(
rsDeckId
==
"SdSlideTransitionDeck"
)
return
".uno:SlideChangeWindow"
;
if
(
rsDeckId
==
"SdAllMasterPagesDeck"
)
return
".uno:MasterSlidesPanel"
;
if
(
rsDeckId
==
"SdMasterPagesDeck"
)
return
".uno:MasterSlidesPanel"
;
if
(
rsDeckId
==
"GalleryDeck"
)
return
".uno:Gallery"
;
return
""
;
}
}
namespace
sfx2
{
namespace
sidebar
{
...
...
@@ -84,47 +111,48 @@ namespace {
static
const
char
gsDefaultDeckId
[]
=
"PropertyDeck"
;
}
SidebarController
::
SidebarController
(
SidebarDockingWindow
*
pParentWindow
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
)
:
SidebarControllerInterfaceBase
(
m_aMutex
),
mpCurrentDeck
(),
mpParentWindow
(
pParentWindow
),
mpTabBar
(
VclPtr
<
TabBar
>::
Create
(
mpParentWindow
,
rxFrame
,
[
this
](
const
::
rtl
::
OUString
&
rsDeckId
)
{
return
this
->
OpenThenToggleDeck
(
rsDeckId
);
},
[
this
](
const
tools
::
Rectangle
&
rButtonBox
,
const
::
std
::
vector
<
TabBar
::
DeckMenuData
>&
rMenuData
)
{
return
this
->
ShowPopupMenu
(
rButtonBox
,
rMenuData
);
},
this
)),
mxFrame
(
rxFrame
),
maCurrentContext
(
OUString
(),
OUString
()),
maRequestedContext
(),
mnRequestedForceFlags
(
SwitchFlag_NoForce
),
msCurrentDeckId
(
gsDefaultDeckId
),
maPropertyChangeForwarder
([
this
](){
return
this
->
BroadcastPropertyChange
();
}),
maContextChangeUpdate
([
this
](){
return
this
->
UpdateConfigurations
();
}),
maAsynchronousDeckSwitch
(),
mbIsDeckRequestedOpen
(),
mbIsDeckOpen
(),
mnSavedSidebarWidth
(
pParentWindow
->
GetSizePixel
().
Width
()),
maFocusManager
([
this
](
const
Panel
&
rPanel
){
return
this
->
ShowPanel
(
rPanel
);
}),
mxReadOnlyModeDispatch
(),
mbIsDocumentReadOnly
(
false
),
mpSplitWindow
(
nullptr
),
mnWidthOnSplitterButtonDown
(
0
),
mpResourceManager
()
SidebarController
::
SidebarController
(
SidebarDockingWindow
*
pParentWindow
,
const
SfxViewFrame
*
pViewFrame
)
:
SidebarControllerInterfaceBase
(
m_aMutex
)
,
mpCurrentDeck
()
,
mpParentWindow
(
pParentWindow
)
,
mpViewFrame
(
pViewFrame
)
,
mxFrame
(
pViewFrame
->
GetFrame
().
GetFrameInterface
())
,
mpTabBar
(
VclPtr
<
TabBar
>::
Create
(
mpParentWindow
,
mxFrame
,
[
this
](
const
::
rtl
::
OUString
&
rsDeckId
)
{
return
this
->
OpenThenToggleDeck
(
rsDeckId
);
},
[
this
](
const
tools
::
Rectangle
&
rButtonBox
,
const
::
std
::
vector
<
TabBar
::
DeckMenuData
>&
rMenuData
)
{
return
this
->
ShowPopupMenu
(
rButtonBox
,
rMenuData
);
},
this
))
,
maCurrentContext
(
OUString
(),
OUString
())
,
maRequestedContext
()
,
mnRequestedForceFlags
(
SwitchFlag_NoForce
)
,
msCurrentDeckId
(
gsDefaultDeckId
)
,
maPropertyChangeForwarder
([
this
]()
{
return
this
->
BroadcastPropertyChange
();
})
,
maContextChangeUpdate
([
this
]()
{
return
this
->
UpdateConfigurations
();
})
,
maAsynchronousDeckSwitch
()
,
mbIsDeckRequestedOpen
()
,
mbIsDeckOpen
()
,
mnSavedSidebarWidth
(
pParentWindow
->
GetSizePixel
().
Width
())
,
maFocusManager
([
this
](
const
Panel
&
rPanel
)
{
return
this
->
ShowPanel
(
rPanel
);
})
,
mxReadOnlyModeDispatch
()
,
mbIsDocumentReadOnly
(
false
)
,
mpSplitWindow
(
nullptr
)
,
mnWidthOnSplitterButtonDown
(
0
)
,
mpResourceManager
()
{
// Decks and panel collections for this sidebar
mpResourceManager
=
o3tl
::
make_unique
<
ResourceManager
>
();
}
rtl
::
Reference
<
SidebarController
>
SidebarController
::
create
(
SidebarDockingWindow
*
pParentWindow
,
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
)
rtl
::
Reference
<
SidebarController
>
SidebarController
::
create
(
SidebarDockingWindow
*
pParentWindow
,
const
SfxViewFrame
*
pViewFrame
)
{
rtl
::
Reference
<
SidebarController
>
instance
(
new
SidebarController
(
pParentWindow
,
rxFrame
));
rtl
::
Reference
<
SidebarController
>
instance
(
new
SidebarController
(
pParentWindow
,
pViewFrame
));
const
css
::
uno
::
Reference
<
css
::
frame
::
XFrame
>&
rxFrame
=
pViewFrame
->
GetFrame
().
GetFrameInterface
();
registerSidebarForFrame
(
instance
.
get
(),
rxFrame
->
getController
());
rxFrame
->
addFrameActionListener
(
instance
.
get
());
// Listen for window events.
...
...
@@ -698,6 +726,22 @@ void SidebarController::SwitchToDeck (
if
(
mpCurrentDeck
)
mpCurrentDeck
->
Hide
();
if
(
comphelper
::
LibreOfficeKit
::
isActive
())
{
if
(
const
SfxViewShell
*
pViewShell
=
mpViewFrame
->
GetViewShell
())
{
const
std
::
string
hide
=
UnoNameFromDeckId
(
msCurrentDeckId
);
if
(
!
hide
.
empty
())
pViewShell
->
libreOfficeKitViewCallback
(
LOK_CALLBACK_STATE_CHANGED
,
(
hide
+
"=false"
).
c_str
());
const
std
::
string
show
=
UnoNameFromDeckId
(
rDeckDescriptor
.
msId
);
if
(
!
show
.
empty
())
pViewShell
->
libreOfficeKitViewCallback
(
LOK_CALLBACK_STATE_CHANGED
,
(
show
+
"=true"
).
c_str
());
}
}
msCurrentDeckId
=
rDeckDescriptor
.
msId
;
}
mpTabBar
->
HighlightDeck
(
msCurrentDeckId
);
...
...
@@ -1173,9 +1217,19 @@ void SidebarController::UpdateDeckOpenState()
mpParentWindow
->
GetFloatingWindow
()
->
SetPosSizePixel
(
aNewPos
,
aNewSize
);
// Sidebar wide enought to render the menu; enable it.
if
(
comphelper
::
LibreOfficeKit
::
isActive
())
{
// Sidebar wide enought to render the menu; enable it.
mpTabBar
->
EnableMenuButton
(
true
);
if
(
const
SfxViewShell
*
pViewShell
=
mpViewFrame
->
GetViewShell
())
{
const
std
::
string
uno
=
UnoNameFromDeckId
(
msCurrentDeckId
);
if
(
!
uno
.
empty
())
pViewShell
->
libreOfficeKitViewCallback
(
LOK_CALLBACK_STATE_CHANGED
,
(
uno
+
"=true"
).
c_str
());
}
}
}
}
else
...
...
@@ -1201,9 +1255,19 @@ void SidebarController::UpdateDeckOpenState()
mpParentWindow
->
GetFloatingWindow
()
->
SetPosSizePixel
(
aNewPos
,
aNewSize
);
// Sidebar too narrow to render the menu; disable it.
if
(
comphelper
::
LibreOfficeKit
::
isActive
())
{
// Sidebar too narrow to render the menu; disable it.
mpTabBar
->
EnableMenuButton
(
false
);
if
(
const
SfxViewShell
*
pViewShell
=
mpViewFrame
->
GetViewShell
())
{
const
std
::
string
uno
=
UnoNameFromDeckId
(
msCurrentDeckId
);
if
(
!
uno
.
empty
())
pViewShell
->
libreOfficeKitViewCallback
(
LOK_CALLBACK_STATE_CHANGED
,
(
uno
+
"=false"
).
c_str
());
}
}
}
if
(
mnWidthOnSplitterButtonDown
>
nTabBarDefaultWidth
)
...
...
sfx2/source/sidebar/SidebarDockingWindow.cxx
Dosyayı görüntüle @
37e7ed49
...
...
@@ -47,8 +47,7 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, SidebarChi
else
{
const
SfxViewFrame
*
pViewFrame
=
pSfxBindings
->
GetDispatcher
()
->
GetFrame
();
const
SfxFrame
&
rFrame
=
pViewFrame
->
GetFrame
();
mpSidebarController
.
set
(
sfx2
::
sidebar
::
SidebarController
::
create
(
this
,
rFrame
.
GetFrameInterface
()).
get
());
mpSidebarController
.
set
(
sfx2
::
sidebar
::
SidebarController
::
create
(
this
,
pViewFrame
).
get
());
}
}
...
...
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