zz_configDialog.h

changeset 78
c190fe218506
parent 76
42284126072a
child 83
614ec2640e40
equal deleted inserted replaced
77:7c2f500405fe 78:c190fe218506
21 #include <qlabel.h> 21 #include <qlabel.h>
22 #include <qlineedit.h> 22 #include <qlineedit.h>
23 #include <qdialogbuttonbox.h> 23 #include <qdialogbuttonbox.h>
24 #include <qpushbutton.h> 24 #include <qpushbutton.h>
25 #include <qcheckbox.h> 25 #include <qcheckbox.h>
26 #include <qlistwidget.h>
26 27
27 class ConfigDialog : public QDialog { 28 class ConfigDialog : public QDialog {
28 Q_OBJECT 29 Q_OBJECT
29 30
30 public: 31 public:
32 QTabWidget* qTabs;
33 QWidget* qMainTab, *qShortcutsTab;
34
35 // =========================================================================
36 // Main tab widgets
31 QLabel* qLDrawPathLabel; 37 QLabel* qLDrawPathLabel;
32 QLabel* qGLBackgroundLabel, *qGLForegroundLabel, *qGLForegroundAlphaLabel; 38 QLabel* qGLBackgroundLabel, *qGLForegroundLabel, *qGLForegroundAlphaLabel;
33 QLabel* qGLLineThicknessLabel; 39 QLabel* qGLLineThicknessLabel;
34 QLineEdit* qLDrawPath; 40 QLineEdit* qLDrawPath;
35 QPushButton* qLDrawPathFindButton; 41 QPushButton* qLDrawPathFindButton;
36 QPushButton* qGLBackgroundButton, *qGLForegroundButton; 42 QPushButton* qGLBackgroundButton, *qGLForegroundButton;
37 QCheckBox* qLVColorize, *qGLColorBFC; 43 QCheckBox* qLVColorize, *qGLColorBFC;
38 QSlider* qGLForegroundAlpha, *qGLLineThickness; 44 QSlider* qGLForegroundAlpha, *qGLLineThickness;
39 45
46 // =========================================================================
47 // Shortcuts tab
48 QListWidget* qShortcutList;
49 QPushButton* qBTN_setShortcut, *qBTN_resetShortcut;
50 std::vector<QListWidgetItem*> qaShortcutItems;
51
40 QDialogButtonBox* qButtons; 52 QDialogButtonBox* qButtons;
41 53
42 ConfigDialog (ForgeWindow* parent); 54 ConfigDialog (ForgeWindow* parent);
43 ~ConfigDialog (); 55 ~ConfigDialog ();
44 static void staticDialog (ForgeWindow* window); 56 static void staticDialog (ForgeWindow* window);
45 57
46 private: 58 private:
59 void initMainTab ();
60 void initShortcutsTab ();
61
47 void makeSlider (QSlider*& qSlider, short int dMin, short int dMax, short int dDefault); 62 void makeSlider (QSlider*& qSlider, short int dMin, short int dMax, short int dDefault);
48 void setButtonBackground (QPushButton* qButton, str zValue); 63 void setButtonBackground (QPushButton* qButton, str zValue);
49 void pickColor (strconfig& cfg, QPushButton* qButton); 64 void pickColor (strconfig& cfg, QPushButton* qButton);
65 void setShortcutText (QListWidgetItem* qItem, actionmeta meta);
66 long getItemRow (QListWidgetItem* qItem);
50 67
51 private slots: 68 private slots:
52 void slot_findLDrawPath (); 69 void slot_findLDrawPath ();
53 void slot_setGLBackground (); 70 void slot_setGLBackground ();
54 void slot_setGLForeground (); 71 void slot_setGLForeground ();
72 void slot_setShortcut ();
73 void slot_resetShortcut ();
55 }; 74 };
75
76 // =============================================================================
77 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
78 // =============================================================================
79 class KeySequenceDialog : public QDialog {
80 Q_OBJECT
81
82 public:
83 explicit KeySequenceDialog (QKeySequence seq, QWidget* parent = nullptr, Qt::WindowFlags f = 0);
84 static bool staticDialog (actionmeta& meta, QWidget* parent = nullptr);
85
86 QLabel* qOutput;
87 QDialogButtonBox* qButtons;
88 QKeySequence seq;
89
90 private:
91 void updateOutput ();
92
93 private slots:
94 virtual void keyPressEvent (QKeyEvent* ev);
95 };

mercurial