Updates the material preferences including selecting a default material Preferences adds some options for what gets displayed in the Materials editor. The option to use the legacy editor is removed in favour of the new editor. A new preference page has been added that allows the user to select a default material. This will then be assigned to any newly created object. In support of this, a new widget PrefsMaterialTreeWidget has been added as an extension of the MaterialTreeWidget to automatically save and restore the selected material.
55 lines
2.2 KiB
C++
55 lines
2.2 KiB
C++
/***************************************************************************
|
|
* Copyright (c) 2023 David Carter <dcarter@david.carter.ca> *
|
|
* *
|
|
* This file is part of FreeCAD. *
|
|
* *
|
|
* FreeCAD is free software: you can redistribute it and/or modify it *
|
|
* under the terms of the GNU Lesser General Public License as *
|
|
* published by the Free Software Foundation, either version 2.1 of the *
|
|
* License, or (at your option) any later version. *
|
|
* *
|
|
* FreeCAD is distributed in the hope that it will be useful, but *
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of *
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
|
|
* Lesser General Public License for more details. *
|
|
* *
|
|
* You should have received a copy of the GNU Lesser General Public *
|
|
* License along with FreeCAD. If not, see *
|
|
* <https://www.gnu.org/licenses/>. *
|
|
* *
|
|
**************************************************************************/
|
|
|
|
#ifndef MATGUI_DLGSETTINGSDEFAULTMATERIAL_H
|
|
#define MATGUI_DLGSETTINGSDEFAULTMATERIAL_H
|
|
|
|
#include <Gui/PropertyPage.h>
|
|
#include <memory>
|
|
|
|
|
|
namespace MatGui
|
|
{
|
|
class Ui_DlgSettingsDefaultMaterial;
|
|
|
|
class DlgSettingsDefaultMaterial: public Gui::Dialog::PreferencePage
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit DlgSettingsDefaultMaterial(QWidget* parent = nullptr);
|
|
~DlgSettingsDefaultMaterial() override = default;
|
|
|
|
protected:
|
|
void saveSettings() override;
|
|
void loadSettings() override;
|
|
void changeEvent(QEvent* e) override;
|
|
|
|
private:
|
|
std::unique_ptr<Ui_DlgSettingsDefaultMaterial> ui;
|
|
|
|
void setupFilters();
|
|
};
|
|
|
|
} // namespace MatGui
|
|
|
|
#endif // MATGUI_DLGSETTINGSDEFAULTMATERIAL_H
|