summaryrefslogtreecommitdiff
path: root/include/svx/sidebar
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-04 15:39:09 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-04 17:25:13 +0100
commit5d812cae7eacccb7819a46ae45c577295db9f190 (patch)
treed04e8dbaafedca13e1014d0c04d6234cdfa0f04c /include/svx/sidebar
parent7e61e1d644270f05664d358abeffbc8f72b01a96 (diff)
These are just floating windows, no need for all the special intrastructure
get rid of the roundabout way that these popups are popup controllers (of a kind) for real popups for the moment keeping them as loaded from resources Change-Id: I083e8609ab133e3dc4a036daf8bfb44c08a6719f
Diffstat (limited to 'include/svx/sidebar')
-rw-r--r--include/svx/sidebar/AreaPropertyPanelBase.hxx3
-rw-r--r--include/svx/sidebar/AreaTransparencyGradientPopup.hxx20
-rw-r--r--include/svx/sidebar/Popup.hxx101
3 files changed, 10 insertions, 114 deletions
diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index 7668f3bc8864..2454084e1cdd 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -152,7 +152,7 @@ protected:
Image maImgSquare;
Image maImgLinear;
- AreaTransparencyGradientPopup maTrGrPopup;
+ VclPtr<AreaTransparencyGradientPopup> mxTrGrPopup;
std::unique_ptr< XFillFloatTransparenceItem > mpFloatTransparenceItem;
std::unique_ptr< SfxUInt16Item > mpTransparanceItem;
@@ -170,7 +170,6 @@ protected:
DECL_LINK_TYPED(ClickImportBitmapHdl, Button*, void);
// for transparency gradient
- VclPtr<Control> CreateTransparencyGradientControl (PopupContainer* pParent);
DECL_LINK_TYPED( ClickTrGrHdl_Impl, ToolBox*, void );
void Initialize();
diff --git a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
index 31c041b3219a..519224b66786 100644
--- a/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
+++ b/include/svx/sidebar/AreaTransparencyGradientPopup.hxx
@@ -19,26 +19,24 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_AREATRANSPARENCYGRADIENTPOPUP_HXX
-#include "svx/sidebar/Popup.hxx"
-
-#include <functional>
-
+#include <vcl/floatwin.hxx>
class XFillFloatTransparenceItem;
-
namespace svx { namespace sidebar {
-class AreaTransparencyGradientPopup
- : public Popup
+class AreaTransparencyGradientControl;
+class AreaPropertyPanelBase;
+
+class AreaTransparencyGradientPopup : public FloatingWindow
{
+private:
+ VclPtr<AreaTransparencyGradientControl> m_xControl;
public:
- AreaTransparencyGradientPopup (
- vcl::Window* pParent,
- ::std::function<Control*(PopupContainer*)> const& rControlCreator);
+ AreaTransparencyGradientPopup(vcl::Window* pParent, AreaPropertyPanelBase& rPanel);
virtual ~AreaTransparencyGradientPopup() override;
-
void Rearrange (XFillFloatTransparenceItem* pItem);
+ virtual void dispose() override;
};
} } // end of namespace svx::sidebar
diff --git a/include/svx/sidebar/Popup.hxx b/include/svx/sidebar/Popup.hxx
deleted file mode 100644
index 0e0bccf7117e..000000000000
--- a/include/svx/sidebar/Popup.hxx
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- 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 .
- */
-#ifndef INCLUDED_SVX_SIDEBAR_POPUP_HXX
-#define INCLUDED_SVX_SIDEBAR_POPUP_HXX
-
-#include <svx/svxdllapi.h>
-#include <rtl/ustring.hxx>
-#include <tools/link.hxx>
-#include <vcl/vclptr.hxx>
-#include <svx/sidebar/PopupContainer.hxx>
-
-#include <functional>
-
-namespace vcl { class Window; }
-class ToolBox;
-
-namespace svx { namespace sidebar {
-
-/** A wrapper around a PopupContainer and a Control object.
- Usually used as drop down for a toolbox. Use Show() to start
- drop down mode and Hide() to end it.
-*/
-class SVX_DLLPUBLIC Popup
-{
-public:
- /** Create a Popup wrapper object.
- @param pParent
- Parent window of the PopupContainer, which in turn is the
- parent of the Control.
- @param rControlCreator
- A functor that is called to create the Control object
- (usually an instance of a class derived from
- Control).
- */
- Popup (
- vcl::Window* pParent,
- const ::std::function<Control*(PopupContainer*)>& rControlCreator,
- const ::rtl::OUString& rsAccessibleName);
- virtual ~Popup();
-
- /** Show the popup.
- @rToolBox
- The tool box is used to determine the position at which
- the popup is displayed.
- */
- void Show (ToolBox& rToolBox);
-
- /** Hide the popup.
- This method is called automatically when eg. the user clicks
- outside the popup or when the ESC-key is pressed. The
- application can call Hide() when the popup should be closed
- for other, non-standard reasons.
- */
- void Hide();
-
- void dispose();
-
-protected:
- VclPtr<Control> mxControl;
-
- /** Make sure that both PopupContainer and Control objects
- exist. Calls the maControlCreator functor if necessary.
- */
- void ProvideContainerAndControl();
-
- /** A derived specialisation class can override this method to do
- additional work.
- */
- void CreateContainerAndControl();
-
-private:
- VclPtr<vcl::Window> mpParent;
- ::std::function<VclPtr<Control>(PopupContainer*)> maControlCreator;
- ::std::function<void()> maPopupModeEndCallback;
- const ::rtl::OUString msAccessibleName;
- VclPtr<PopupContainer> mxContainer;
-
- DECL_LINK_TYPED(PopupModeEndHandler, FloatingWindow*, void);
-};
-
-} } // end of namespace svx::sidebar
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */