notebookbar: minify for online
Notebookbar load takes some time. We don't use most of the items in online so minify .ui file to contain only needed widgets. Change-Id: I4796caae14bb63e3e04d318093209adfb87a77df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113623 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Jan Holesovsky <kendy@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114154 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
@@ -6098,7 +6098,7 @@ static void activateNotebookbar(std::u16string_view rApp)
|
||||
|
||||
if (aAppNode.isValid())
|
||||
{
|
||||
aAppNode.setNodeValue("Active", makeAny(OUString("notebookbar.ui")));
|
||||
aAppNode.setNodeValue("Active", makeAny(OUString("notebookbar_online.ui")));
|
||||
aAppNode.commit();
|
||||
}
|
||||
}
|
||||
|
@@ -15,14 +15,14 @@
|
||||
#include <vcl/weld.hxx>
|
||||
#include <com/sun/star/frame/XFrame.hpp>
|
||||
|
||||
/** Tabbed implementation of NotebookBar for Writer
|
||||
/**
|
||||
* Welded wrapper for NotebookBar used for online
|
||||
*/
|
||||
class VCL_DLLPUBLIC WeldedTabbedNotebookbar
|
||||
{
|
||||
std::unique_ptr<weld::Builder> m_xBuilder;
|
||||
|
||||
std::unique_ptr<weld::Container> m_xContainer;
|
||||
std::unique_ptr<weld::Notebook> m_xNotebook;
|
||||
|
||||
public:
|
||||
WeldedTabbedNotebookbar(const VclPtr<vcl::Window>& pContainerWindow,
|
||||
|
@@ -159,6 +159,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/scalc,\
|
||||
sc/uiconfig/scalc/ui/notebookbar_groups \
|
||||
sc/uiconfig/scalc/ui/notebookbar_groupedbar_full \
|
||||
sc/uiconfig/scalc/ui/notebookbar_groupedbar_compact \
|
||||
sc/uiconfig/scalc/ui/notebookbar_online \
|
||||
sc/uiconfig/scalc/ui/numberbox \
|
||||
sc/uiconfig/scalc/ui/managenamesdialog \
|
||||
sc/uiconfig/scalc/ui/mergecellsdialog \
|
||||
|
93
sc/uiconfig/scalc/ui/notebookbar_online.ui
Normal file
93
sc/uiconfig/scalc/ui/notebookbar_online.ui
Normal file
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sw">
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<requires lib="LibreOffice" version="1.0"/>
|
||||
<!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
|
||||
<object class="GtkGrid" id="NotebookBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="font">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-CharFontName">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="action_name">.uno:CharFontName</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="fontheight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_start">5</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-FontHeight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="action_name">.uno:FontHeight</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="SectionBottom127">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="toolbar_style">icons</property>
|
||||
<property name="show_arrow">False</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-NumberFormatType">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="action_name">.uno:NumberFormatType</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
@@ -117,6 +117,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/sdraw,\
|
||||
sd/uiconfig/sdraw/ui/notebookbar_compact \
|
||||
sd/uiconfig/sdraw/ui/notebookbar_single \
|
||||
sd/uiconfig/sdraw/ui/notebookbar_groupedbar_compact \
|
||||
sd/uiconfig/sdraw/ui/notebookbar_online \
|
||||
sd/uiconfig/sdraw/ui/paranumberingtab \
|
||||
sd/uiconfig/sdraw/ui/queryunlinkimagedialog \
|
||||
sd/uiconfig/sdraw/ui/vectorize \
|
||||
|
@@ -144,6 +144,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
|
||||
sd/uiconfig/simpress/ui/notebookbar_groups \
|
||||
sd/uiconfig/simpress/ui/notebookbar_groupedbar_full \
|
||||
sd/uiconfig/simpress/ui/notebookbar_groupedbar_compact \
|
||||
sd/uiconfig/simpress/ui/notebookbar_online \
|
||||
sd/uiconfig/simpress/ui/optimpressgeneralpage \
|
||||
sd/uiconfig/simpress/ui/pagesfieldbox \
|
||||
sd/uiconfig/simpress/ui/photoalbum \
|
||||
|
69
sd/uiconfig/sdraw/ui/notebookbar_online.ui
Normal file
69
sd/uiconfig/sdraw/ui/notebookbar_online.ui
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sw">
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<requires lib="LibreOffice" version="1.0"/>
|
||||
<!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
|
||||
<object class="GtkGrid" id="NotebookBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="font">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-CharFontName">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="action_name">.uno:CharFontName</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="fontheight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_start">5</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-FontHeight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="action_name">.uno:FontHeight</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
69
sd/uiconfig/simpress/ui/notebookbar_online.ui
Normal file
69
sd/uiconfig/simpress/ui/notebookbar_online.ui
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sw">
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<requires lib="LibreOffice" version="1.0"/>
|
||||
<!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
|
||||
<object class="GtkGrid" id="NotebookBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="font">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-CharFontName">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="action_name">.uno:CharFontName</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="fontheight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_start">5</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-FontHeight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="action_name">.uno:FontHeight</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
@@ -266,6 +266,9 @@ bool SfxNotebookBar::IsActive()
|
||||
|
||||
OUString aActive = comphelper::getString( aAppNode.getNodeValue( "Active" ) );
|
||||
|
||||
if (comphelper::LibreOfficeKit::isActive() && aActive == "notebookbar_online.ui")
|
||||
return true;
|
||||
|
||||
const utl::OConfigurationNode aModesNode = aAppNode.openNode("Modes");
|
||||
const Sequence<OUString> aModeNodeNames( aModesNode.getNodeNames() );
|
||||
|
||||
@@ -331,6 +334,8 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
|
||||
OUString aModuleName = xModuleManager->identify( xFrame );
|
||||
vcl::EnumContext::Application eApp = vcl::EnumContext::GetApplicationEnum( aModuleName );
|
||||
OUString sFile = lcl_getNotebookbarFileName( eApp );
|
||||
if (comphelper::LibreOfficeKit::isActive())
|
||||
sFile = "notebookbar_online.ui";
|
||||
OUString sNewFile = rUIFile + sFile;
|
||||
OUString sCurrentFile;
|
||||
VclPtr<NotebookBar> pNotebookBar = pSysWindow->GetNotebookBar();
|
||||
@@ -409,8 +414,10 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
|
||||
}
|
||||
else if (auto pNotebookBar = pSysWindow->GetNotebookBar())
|
||||
{
|
||||
pNotebookBar->Hide();
|
||||
pNotebookBar->GetParent()->Resize();
|
||||
vcl::Window* pParent = pNotebookBar->GetParent();
|
||||
RemoveListeners(pSysWindow);
|
||||
pSysWindow->CloseNotebookBar();
|
||||
pParent->Resize();
|
||||
SfxNotebookBar::ShowMenubar(true);
|
||||
}
|
||||
|
||||
|
@@ -235,7 +235,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
|
||||
sw/uiconfig/swriter/ui/notebookbar_groups \
|
||||
sw/uiconfig/swriter/ui/notebookbar_groupedbar_full \
|
||||
sw/uiconfig/swriter/ui/notebookbar_groupedbar_compact \
|
||||
sw/uiconfig/swriter/ui/pagecolumncontrol \
|
||||
sw/uiconfig/swriter/ui/notebookbar_online \
|
||||
sw/uiconfig/swriter/ui/pagemargincontrol \
|
||||
sw/uiconfig/swriter/ui/pageorientationcontrol \
|
||||
sw/uiconfig/swriter/ui/pagesizecontrol \
|
||||
|
95
sw/uiconfig/swriter/ui/notebookbar_online.ui
Normal file
95
sw/uiconfig/swriter/ui/notebookbar_online.ui
Normal file
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface domain="sw">
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<requires lib="LibreOffice" version="1.0"/>
|
||||
<!-- interface-local-resource-path ../../../icon-themes/colibre/cmd/ -->
|
||||
<object class="GtkGrid" id="NotebookBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="font">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="hexpand">True</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-CharFontName">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="action_name">.uno:CharFontName</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="fontheight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="margin_start">5</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-FontHeight">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="action_name">.uno:FontHeight</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="sfxlo-NotebookbarToolBox" id="SectionBottom127">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="toolbar_style">icons</property>
|
||||
<property name="show_arrow">False</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="Home-StylesPreview">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="halign">center</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="action_name">.uno:StylesPreview</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="homogeneous">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
@@ -18,8 +18,6 @@ WeldedTabbedNotebookbar::WeldedTabbedNotebookbar(
|
||||
pContainerWindow, AllSettings::GetUIRootDir(), rUIFilePath, rFrame, nWindowId))
|
||||
{
|
||||
m_xContainer = m_xBuilder->weld_container("NotebookBar");
|
||||
m_xNotebook = m_xBuilder->weld_notebook("ContextContainer");
|
||||
m_xNotebook->set_current_page("HomeLabel");
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
@@ -72,11 +72,7 @@ NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rU
|
||||
if ( doesCustomizedUIExist )
|
||||
sUIDir = getCustomizedUIRootDir();
|
||||
|
||||
bool bIsWelded = comphelper::LibreOfficeKit::isActive()
|
||||
&& (rUIXMLDescription == "modules/swriter/ui/notebookbar.ui"
|
||||
|| rUIXMLDescription == "modules/scalc/ui/notebookbar.ui"
|
||||
|| rUIXMLDescription == "modules/simpress/ui/notebookbar.ui"
|
||||
|| rUIXMLDescription == "modules/sdraw/ui/notebookbar.ui");
|
||||
bool bIsWelded = comphelper::LibreOfficeKit::isActive();
|
||||
if (bIsWelded)
|
||||
{
|
||||
m_bIsWelded = true;
|
||||
|
Reference in New Issue
Block a user