src/dialogs/configdialog.h

changeset 1010
969b48eddd6b
parent 984
a7b6f987d269
child 1014
f0a8ecb6a357
child 1217
314e12e23c3a
equal deleted inserted replaced
1009:85fd352bae45 1010:969b48eddd6b
25 class QDoubleSpinBox; 25 class QDoubleSpinBox;
26 26
27 // ============================================================================= 27 // =============================================================================
28 class ShortcutListItem : public QListWidgetItem 28 class ShortcutListItem : public QListWidgetItem
29 { 29 {
30 PROPERTY (public, QAction*, action, setAction, STOCK_WRITE) 30 public:
31 PROPERTY (public, QKeySequence, sequence, setSequence, STOCK_WRITE) 31 explicit ShortcutListItem (QListWidget* view = nullptr, int type = Type);
32 32
33 public: 33 QAction* action() const;
34 explicit ShortcutListItem (QListWidget* view = nullptr, int type = Type) : 34 QKeySequence sequence() const;
35 QListWidgetItem (view, type) {} 35 void setAction (QAction* action);
36 void setSequence (const QKeySequence& sequence);
37
38 private:
39 QAction* m_action;
40 QKeySequence m_sequence;
36 }; 41 };
37 42
38 struct ExternalProgramWidgets 43 struct ExternalProgramWidgets
39 { 44 {
40 class QLineEdit* input; 45 class QLineEdit* input;
61 }; 66 };
62 67
63 explicit ConfigDialog (QWidget* parent = nullptr, Tab defaulttab = (Tab) 0, Qt::WindowFlags f = 0); 68 explicit ConfigDialog (QWidget* parent = nullptr, Tab defaulttab = (Tab) 0, Qt::WindowFlags f = 0);
64 virtual ~ConfigDialog(); 69 virtual ~ConfigDialog();
65 70
66 QList<LDQuickColor> quickColors; 71 QList<ColorToolbarItem> quickColors;
67 72
68 private: 73 private:
69 class Ui_ConfigDialog& ui; 74 class Ui_ConfigDialog& ui;
70 QList<QListWidgetItem*> quickColorItems; 75 QList<QListWidgetItem*> quickColorItems;
71 QMap<QPushButton*, QColor> m_buttonColors; 76 QMap<QPushButton*, QColor> m_buttonColors;
73 class QSettings* m_settings; 78 class QSettings* m_settings;
74 79
75 void applySettings(); 80 void applySettings();
76 void addShortcut (QAction* act); 81 void addShortcut (QAction* act);
77 void setButtonBackground (QPushButton* button, QString value); 82 void setButtonBackground (QPushButton* button, QString value);
78 void updateQuickColorList (LDQuickColor* sel = nullptr); 83 void updateQuickColorList (ColorToolbarItem* sel = nullptr);
79 void setShortcutText (ShortcutListItem* item); 84 void setShortcutText (ShortcutListItem* item);
80 int getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack); 85 int getItemRow (QListWidgetItem* item, QList<QListWidgetItem*>& haystack);
81 QString quickColorString(); 86 QString quickColorString();
82 QListWidgetItem* getSelectedQuickColor(); 87 QListWidgetItem* getSelectedQuickColor();
83 QList<ShortcutListItem*> getShortcutSelection(); 88 QList<ShortcutListItem*> getShortcutSelection();

mercurial