summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-07-08 00:03:43 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-07-11 13:14:37 +0000
commit4f71b88ad0ee71aead9ef20bb6efa58c5e1753b9 (patch)
tree2733496820e3b7af8a0401e30796ae35244aecc6 /sd
parentf541b99855bd70781f8d7d655ab259ff9eb596f0 (diff)
GSoC notebookbar: impress table tab
Change-Id: I50338e2f5405171785ea610a9febc3d4f5df96e5 Reviewed-on: https://gerrit.libreoffice.org/27052 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/Library_sd.mk1
-rw-r--r--sd/UIConfig_simpress.mk1
-rw-r--r--sd/source/ui/table/TableDesignBox.cxx80
-rw-r--r--sd/source/ui/table/TableDesignPane.cxx2
-rw-r--r--sd/source/ui/table/TableDesignPane.hxx6
-rw-r--r--sd/uiconfig/simpress/ui/notebookbar.ui25
-rw-r--r--sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui142
7 files changed, 255 insertions, 2 deletions
diff --git a/sd/Library_sd.mk b/sd/Library_sd.mk
index 72ea43ea9cbd..8bed9f67077d 100644
--- a/sd/Library_sd.mk
+++ b/sd/Library_sd.mk
@@ -400,6 +400,7 @@ $(eval $(call gb_Library_add_exception_objects,sd,\
sd/source/ui/slidesorter/view/SlsTheme \
sd/source/ui/slidesorter/view/SlsToolTip \
sd/source/ui/slidesorter/view/SlsViewCacheContext \
+ sd/source/ui/table/TableDesignBox \
sd/source/ui/table/TableDesignPane \
sd/source/ui/table/tablefunction \
sd/source/ui/table/tableobjectbar \
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index a5351dcf6a02..dad22b214fb5 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -133,6 +133,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
sd/uiconfig/simpress/ui/slidetransitionspanel \
sd/uiconfig/simpress/ui/slidetransitionspanelhorizontal \
sd/uiconfig/simpress/ui/tabledesignpanel \
+ sd/uiconfig/simpress/ui/tabledesignpanelhorizontal \
sd/uiconfig/simpress/ui/templatedialog \
))
diff --git a/sd/source/ui/table/TableDesignBox.cxx b/sd/source/ui/table/TableDesignBox.cxx
new file mode 100644
index 000000000000..981a9dcf4095
--- /dev/null
+++ b/sd/source/ui/table/TableDesignBox.cxx
@@ -0,0 +1,80 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "ViewShellBase.hxx"
+#include <sfx2/viewfrm.hxx>
+#include "TableDesignPane.hxx"
+#include <vcl/builderfactory.hxx>
+#include <vcl/layout.hxx>
+
+namespace sd
+{
+
+class TableDesignBox : public VclVBox
+{
+ VclPtr<TableDesignPane> m_pPane;
+ bool m_bIsInitialized;
+
+public:
+ TableDesignBox(vcl::Window* pParent);
+ ~TableDesignBox() override;
+
+ virtual void dispose() override;
+ virtual void StateChanged(StateChangedType nStateChange) override;
+};
+
+VCL_BUILDER_FACTORY(TableDesignBox);
+
+TableDesignBox::TableDesignBox(vcl::Window* pParent)
+ : VclVBox(pParent)
+ , m_bIsInitialized(false)
+{
+}
+
+TableDesignBox::~TableDesignBox()
+{
+ disposeOnce();
+}
+
+void TableDesignBox::dispose()
+{
+ m_pPane.disposeAndClear();
+ VclVBox::dispose();
+}
+
+void TableDesignBox::StateChanged(StateChangedType nStateChange)
+{
+ if(SfxViewFrame::Current() && !m_bIsInitialized)
+ {
+ ViewShellBase* pBase = ViewShellBase::GetViewShellBase(SfxViewFrame::Current());
+
+ if(pBase)
+ {
+ m_pPane = VclPtr<TableDesignPane>::Create(this, *pBase, false);
+ m_pPane->Show();
+ m_pPane->SetSizePixel(GetSizePixel());
+ m_bIsInitialized = true;
+ }
+ }
+ VclVBox::StateChanged(nStateChange);
+}
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 84873892fa85..f1eb9e83ba5f 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -317,7 +317,6 @@ void TableValueSet::Resize()
Image aImage = GetItemImage(GetItemId(0));
Size aItemSize = aImage.GetSizePixel();
- aItemSize.Width() += 10;
aItemSize.Height() += 10;
int nColumnCount = (aValueSetSize.Width() - GetScrollWidth()) / aItemSize.Width();
if (nColumnCount < 1)
@@ -783,6 +782,7 @@ void TableDesignWidget::FillDesignPreviewControl()
aSize.Height() += (10 * nRows);
m_pValueSet->set_width_request(aSize.Width());
m_pValueSet->set_height_request(aSize.Height());
+ m_pValueSet->Resize();
}
catch( Exception& )
{
diff --git a/sd/source/ui/table/TableDesignPane.hxx b/sd/source/ui/table/TableDesignPane.hxx
index 886848bcf471..13b45af85b12 100644
--- a/sd/source/ui/table/TableDesignPane.hxx
+++ b/sd/source/ui/table/TableDesignPane.hxx
@@ -115,6 +115,12 @@ public:
, aImpl(this, rBase, false)
{
}
+ TableDesignPane( vcl::Window* pParent, ViewShellBase& rBase, bool )
+ : PanelLayout(pParent, "TableDesignPanel",
+ "modules/simpress/ui/tabledesignpanelhorizontal.ui", css::uno::Reference<css::frame::XFrame>())
+ , aImpl(this, rBase, false)
+ {
+ }
};
class TableDesignDialog : public ModalDialog
diff --git a/sd/uiconfig/simpress/ui/notebookbar.ui b/sd/uiconfig/simpress/ui/notebookbar.ui
index 7ef837ece2e1..677c4845eb79 100644
--- a/sd/uiconfig/simpress/ui/notebookbar.ui
+++ b/sd/uiconfig/simpress/ui/notebookbar.ui
@@ -227,7 +227,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="sdlo-SmallButton" id="Paste">
+ <object class="vcllo-SmallButton" id="Paste">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -2571,6 +2571,29 @@
<property name="tab_fill">False</property>
</packing>
</child>
+ <child>
+ <object class="sdlo-TableDesignBox" id="TableDesignBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ <packing>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ <child type="tab">
+ <object class="GtkLabel" id="TableLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Table</property>
+ <style>
+ <class name="context-Table"/>
+ </style>
+ </object>
+ <packing>
+ <property name="position">9</property>
+ <property name="tab_fill">False</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui b/sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui
new file mode 100644
index 000000000000..72847b263efc
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/tabledesignpanelhorizontal.ui
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+ <requires lib="gtk+" version="3.0"/>
+ <requires lib="LibreOffice" version="1.0"/>
+ <object class="GtkBox" id="TableDesignPanel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">12</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="height_request">70</property>
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="sdlo-TableValueSet" id="previews:border">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="grid1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <property name="row_homogeneous">True</property>
+ <child>
+ <object class="GtkCheckButton" id="UseFirstRowStyle">
+ <property name="label" translatable="yes">_Header row</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="UseLastRowStyle">
+ <property name="label" translatable="yes">Tot_al row</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="UseBandingRowStyle">
+ <property name="label" translatable="yes">_Banded rows</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="UseBandingColumnStyle">
+ <property name="label" translatable="yes">Ba_nded columns</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="UseFirstColumnStyle">
+ <property name="label" translatable="yes">Fi_rst column</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="UseLastColumnStyle">
+ <property name="label" translatable="yes">_Last column</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">1</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="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+</interface>