| 1 |
// SPDX-License-Identifier: LGPL-2.1-or-later |
| 2 |
/*************************************************************************** |
| 3 |
* Copyright (c) 2009 Jürgen Riegel <[email protected]> * |
| 4 |
* * |
| 5 |
* This file is part of the FreeCAD CAx development system. * |
| 6 |
* * |
| 7 |
* This library is free software; you can redistribute it and/or * |
| 8 |
* modify it under the terms of the GNU Library General Public * |
| 9 |
* License as published by the Free Software Foundation; either * |
| 10 |
* version 2 of the License, or (at your option) any later version. * |
| 11 |
* * |
| 12 |
* This library is distributed in the hope that it will be useful, * |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 15 |
* GNU Library General Public License for more details. * |
| 16 |
* * |
| 17 |
* You should have received a copy of the GNU Library General Public * |
| 18 |
* License along with this library; see the file COPYING.LIB. If not, * |
| 19 |
* write to the Free Software Foundation, Inc., 59 Temple Place, * |
| 20 |
* Suite 330, Boston, MA 02111-1307, USA * |
| 21 |
* * |
| 22 |
***************************************************************************/ |
| 23 |
|
| 24 |
|
| 25 |
#ifndef GUI_TASKVIEW_TASKAPPERANCE_H |
| 26 |
#define GUI_TASKVIEW_TASKAPPERANCE_H |
| 27 |
|
| 28 |
#include <Gui/Selection/Selection.h> |
| 29 |
#include "TaskView.h" |
| 30 |
|
| 31 |
|
| 32 |
namespace App |
| 33 |
{ |
| 34 |
class Property; |
| 35 |
} |
| 36 |
|
| 37 |
namespace Gui |
| 38 |
{ |
| 39 |
class ViewProvider; |
| 40 |
|
| 41 |
namespace TaskView |
| 42 |
{ |
| 43 |
|
| 44 |
using TaskAppearance_Connection = boost::signals2::connection; |
| 45 |
class Ui_TaskAppearance; |
| 46 |
|
| 47 |
class TaskAppearance: public TaskBox, public Gui::SelectionSingleton::ObserverType |
| 48 |
{ |
| 49 |
Q_OBJECT |
| 50 |
|
| 51 |
public: |
| 52 |
explicit TaskAppearance(QWidget* parent = nullptr); |
| 53 |
~TaskAppearance() override; |
| 54 |
/// Observer message from the Selection |
| 55 |
void OnChange( |
| 56 |
Gui::SelectionSingleton::SubjectType& rCaller, |
| 57 |
Gui::SelectionSingleton::MessageType Reason |
| 58 |
) override; |
| 59 |
|
| 60 |
private Q_SLOTS: |
| 61 |
void setupConnections(); |
| 62 |
void onChangeModeActivated(const QString&); |
| 63 |
void onChangePlotActivated(const QString&); |
| 64 |
void onTransparencyValueChanged(int); |
| 65 |
void onPointSizeValueChanged(int); |
| 66 |
void onLineWidthValueChanged(int); |
| 67 |
|
| 68 |
protected: |
| 69 |
void changeEvent(QEvent* e) override; |
| 70 |
|
| 71 |
private: |
| 72 |
void slotChangedObject(const Gui::ViewProvider&, const App::Property& Prop); |
| 73 |
void setDisplayModes(const std::vector<Gui::ViewProvider*>&); |
| 74 |
void setPointSize(const std::vector<Gui::ViewProvider*>&); |
| 75 |
void setLineWidth(const std::vector<Gui::ViewProvider*>&); |
| 76 |
void setTransparency(const std::vector<Gui::ViewProvider*>&); |
| 77 |
std::vector<Gui::ViewProvider*> getSelection() const; |
| 78 |
|
| 79 |
private: |
| 80 |
QWidget* proxy; |
| 81 |
Ui_TaskAppearance* ui; |
| 82 |
TaskAppearance_Connection connectChangedObject; |
| 83 |
}; |
| 84 |
|
| 85 |
} // namespace TaskView |
| 86 |
} // namespace Gui |
| 87 |
|
| 88 |
#endif // GUI_TASKVIEW_TASKAPPERANCE_H |