summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-05-10 19:16:47 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-05-17 12:40:15 +0000
commit6ebf9cfbf54052d7fae50cdab146cc5c63ba262a (patch)
tree60e9e0ccc0878746d7817d58497b7fa53c0468fd /sfx2
parent2049e55f507b00cf70f72706900e75d20ff3bb30 (diff)
Set different ui file for NotebookBar in each app
Changes: + added ui file for start center, calc and impress + NotebookBar not visible in Math, Draw Change-Id: Ie35935e67524ac712930b088591e9e53955de4a1 Reviewed-on: https://gerrit.libreoffice.org/24860 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/UIConfig_sfx.mk1
-rw-r--r--sfx2/source/dialog/backingcomp.cxx20
-rw-r--r--sfx2/uiconfig/ui/notebookbar.ui118
3 files changed, 139 insertions, 0 deletions
diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk
index f33666988f96..5e90b5af6590 100644
--- a/sfx2/UIConfig_sfx.mk
+++ b/sfx2/UIConfig_sfx.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/loadtemplatedialog \
sfx2/uiconfig/ui/managestylepage \
sfx2/uiconfig/ui/newstyle \
+ sfx2/uiconfig/ui/notebookbar \
sfx2/uiconfig/ui/optprintpage \
sfx2/uiconfig/ui/password \
sfx2/uiconfig/ui/printeroptionsdialog \
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index defdaa36ed12..0654b3e38373 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -48,6 +48,7 @@
#include <vcl/keycod.hxx>
#include <vcl/wrkwin.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/syswin.hxx>
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
@@ -428,6 +429,14 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f
if( pBack )
pBack->setOwningFrame( m_xFrame );
+ // set NotebookBar
+ SystemWindow* pSysWindow = static_cast<SystemWindow*>(pParent);
+ if (pSysWindow)
+ {
+ pSysWindow->SetNotebookBar("sfx/ui/notebookbar.ui", m_xFrame);
+ pSysWindow->GetNotebookBar()->Show();
+ }
+
// Set a minimum size for Start Center
if( pParent && pBack )
{
@@ -585,6 +594,17 @@ void SAL_CALL BackingComp::disposing( /*IN*/ const css::lang::EventObject& aEven
void SAL_CALL BackingComp::dispose()
throw(css::uno::RuntimeException, std::exception)
{
+ if (m_xFrame.is())
+ {
+ css::uno::Reference< css::awt::XWindow > xParentWindow = m_xFrame->getContainerWindow();
+ VclPtr< WorkWindow > pParent = static_cast<WorkWindow*>(VCLUnoHelper::GetWindow(xParentWindow).get());
+
+ // hide NotebookBar
+ SystemWindow* pSysWindow = static_cast<SystemWindow*>(pParent);
+ if (pSysWindow && pSysWindow->GetNotebookBar())
+ pSysWindow->GetNotebookBar()->Hide();
+ }
+
/* SAFE { */
SolarMutexGuard aGuard;
diff --git a/sfx2/uiconfig/ui/notebookbar.ui b/sfx2/uiconfig/ui/notebookbar.ui
new file mode 100644
index 000000000000..1f7bf46a1294
--- /dev/null
+++ b/sfx2/uiconfig/ui/notebookbar.ui
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.12"/>
+ <object class="GtkGrid" id="NotebookBar">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkNotebook" id="notebook1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <object class="GtkBox" id="box63">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkButton" id="Open">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:Open</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="OpenRemote">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action_name">.uno:OpenRemote</property>
+ <property name="relief">none</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">File</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Home</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="position">1</property>
+ <property name="tab_fill">False</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>