Kaydet (Commit) 7e20c37c authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

Theme panel to change color/fonts of current styles

In a theme panel the user can change / replace the styles font
and colors used in some predefined style elements (for example
Heading). This is "fake" theme support and not the same thing that
MSO uses, but it still can be useful for the users to change the
appearance of the document. This is the initial commit of the work
and will be much extended. Currently it is only available when
experimental mode is enabled.

Change-Id: I8d34ce87d21975ec6020ac45ecaebb0701b63b2a
üst 25d200bf
......@@ -1027,6 +1027,32 @@
<value>true</value>
</prop>
</node>
<node oor:name="ThemePanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Themes</value>
</prop>
<prop oor:name="Id" oor:type="xs:string">
<value>ThemePanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
<value>DesignDeck</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
WriterVariants, any, visible ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
<value>private:resource/toolpanel/SwPanelFactory/ThemePanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
<value>1</value>
</prop>
<prop oor:name="IsExperimental" oor:type="xs:boolean">
<value>true</value>
</prop>
</node>
</node>
</node>
</oor:component-data>
......@@ -682,6 +682,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/sidebar/PageColumnControl \
sw/source/uibase/sidebar/PagePropertyPanel \
sw/source/uibase/sidebar/WrapPropertyPanel \
sw/source/uibase/sidebar/ThemePanel \
sw/source/uibase/sidebar/SwPanelFactory \
sw/source/uibase/smartmenu/stmenu \
sw/source/uibase/table/chartins \
......
......@@ -206,6 +206,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/sidebarpage \
sw/uiconfig/swriter/ui/sidebarwrap \
sw/uiconfig/swriter/ui/sidebarstylepresets \
sw/uiconfig/swriter/ui/sidebartheme \
sw/uiconfig/swriter/ui/sortdialog \
sw/uiconfig/swriter/ui/splittable \
sw/uiconfig/swriter/ui/statisticsinfopage \
......
......@@ -19,6 +19,7 @@
#include <com/sun/star/ui/XUIElementFactory.hpp>
#include <ThemePanel.hxx>
#include <StylePresetsPanel.hxx>
#include <PagePropertyPanel.hxx>
#include <WrapPropertyPanel.hxx>
......@@ -160,6 +161,12 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/ThemePanel"))
{
sw::sidebar::ThemePanel* pPanel = sw::sidebar::ThemePanel::Create(pParentWindow, xFrame, pBindings);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
}
return xElement;
}
......
This diff is collapsed.
/* -*- 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/.
*
*/
#ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_THEMEPANEL_HXX
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_THEMEPANEL_HXX
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <svx/pageitem.hxx>
#include <svx/rulritem.hxx>
#include <editeng/sizeitem.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
#include <svl/intitem.hxx>
#include <svl/lstner.hxx>
#include <svx/fntctrl.hxx>
#include "docsh.hxx"
namespace sw { namespace sidebar {
class ThemePanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
static ThemePanel* Create(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
virtual void NotifyItemUpdate(const sal_uInt16 nSId,
const SfxItemState eState,
const SfxPoolItem* pState,
const bool bIsEnabled) SAL_OVERRIDE;
SfxBindings* GetBindings() const
{
return mpBindings;
}
private:
ThemePanel(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
virtual ~ThemePanel();
SfxBindings* mpBindings;
ListBox* mpListBoxFonts;
ListBox* mpListBoxColors;
PushButton* mpApplyButton;
DECL_LINK(ClickHdl, void*);
};
}} // end of namespace sw::sidebar
#endif // INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_THEMEPANEL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.0"/>
<object class="GtkGrid" id="ThemePanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkGrid" id="grid1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Fonts</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkTreeView" id="listbox_fonts">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkTreeView" id="listbox_colors">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"/>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Colors</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkButton" id="apply">
<property name="label">gtk-apply</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">4</property>
</packing>
</child>
</object>
</child>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
</packing>
</child>
</object>
</interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment