Commit 1ad918af authored by Alexander A. Maly's avatar Alexander A. Maly

Fixed "Сброк настроек" in menu and toolbar

parent 42b99b78
Pipeline #2934 passed with stages
in 4 minutes and 4 seconds
This diff is collapsed.
This diff is collapsed.
...@@ -5,58 +5,62 @@ ...@@ -5,58 +5,62 @@
#include <kumir2-libs/extensionsystem/settings.h> #include <kumir2-libs/extensionsystem/settings.h>
#include <QWidget> #include <QWidget>
#include <QGridLayout>
#include <QPushButton>
#include <QSet> #include <QSet>
class QGridLayout;
class QPushButton;
namespace CoreGUI { namespace CoreGUI
class ToolbarContextMenu : public QWidget class ToolbarContextMenu : public QWidget
{ {
public: public:
explicit ToolbarContextMenu(QWidget *parent = 0); explicit ToolbarContextMenu(QWidget *parent = 0);
void addProxy(QAction * proxyItem); void addProxy(QAction *proxyItem);
void addSeparator(); void addSeparator();
void finalize(); void finalize();
void setSettingsObject(ExtensionSystem::SettingsPtr settings, const QString &settingsPrefix); void setSettingsObject(ExtensionSystem::SettingsPtr settings, const QString &settingsPrefix);
void setExplicitImportNames(const QSet<QString> explicitItemNames); void setExplicitImportNames(const QSet<QString> explicitItemNames);
inline QAction * showAction() const { return showAction_; } QAction *showAction() const
return showAction_;
void saveSettings() const; void saveSettings() const;
void loadSettings(); void loadSettings();
static Qt::CheckState defaultVisible(const QString & objectName); static Qt::CheckState defaultVisible(const QString &objectName);
static Qt::CheckState f2cs(float value); static Qt::CheckState f2cs(float value);
static float cs2f(Qt::CheckState state); static float cs2f(Qt::CheckState state);
bool isItemVisible(Qt::CheckState state, const QString & objectName) const; bool isItemVisible(Qt::CheckState state, const QString &objectName) const;
protected Q_SLOTS: protected Q_SLOTS:
void toggleProxyButtonVisible(int iState); void toggleProxyButtonVisible(int iState);
void reset(); void reset();
void showAll(); void showAll();
void showMe(); void showMe();
protected: protected:
void showEvent(QShowEvent * event); void showEvent(QShowEvent *event);
void paintEvent(QPaintEvent *event); void paintEvent(QPaintEvent *event);
QList<QAction*> items_; QList<QAction *> items_;
QSet<QString> forcedItemNames_; QSet<QString> forcedItemNames_;
QGridLayout * grid_; QGridLayout *grid_;
int currentRow_; int currentRow_;
int currentColumn_; int currentColumn_;
QPushButton * btnClose_; QPushButton *btnClose_;
QPushButton * btnReset_; QPushButton *btnReset_;
QPushButton * btnShowAll_; QPushButton *btnShowAll_;
ExtensionSystem::SettingsPtr settings_; ExtensionSystem::SettingsPtr settings_;
QString settingsPrefix_; QString settingsPrefix_;
QSet<QString> explicitImportNames_; QSet<QString> explicitImportNames_;
bool ignoreStateChange_; bool ignoreStateChange_;
QAction* showAction_; QAction *showAction_;
}; };
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