mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-10-31 22:26:41 +00:00 
			
		
		
		
	Improve shortcut labels, Adjust menu titles and remove menu navigation (can conflict with shortcuts)
		
			
				
	
	
		
			49 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
	
		
			1 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| #ifndef CSM_PREFS_SHORTCUTSETTING_H
 | |
| #define CSM_PREFS_SHORTCUTSETTING_H
 | |
| 
 | |
| #include <QKeySequence>
 | |
| 
 | |
| #include "setting.hpp"
 | |
| 
 | |
| class QEvent;
 | |
| class QPushButton;
 | |
| 
 | |
| namespace CSMPrefs
 | |
| {
 | |
|     class ShortcutSetting : public Setting
 | |
|     {
 | |
|             Q_OBJECT
 | |
| 
 | |
|         public:
 | |
| 
 | |
|             ShortcutSetting(Category* parent, Settings::Manager* values, QMutex* mutex, const std::string& key,
 | |
|                 const std::string& label);
 | |
| 
 | |
|             virtual std::pair<QWidget*, QWidget*> makeWidgets(QWidget* parent);
 | |
| 
 | |
|         protected:
 | |
| 
 | |
|             bool eventFilter(QObject* target, QEvent* event);
 | |
| 
 | |
|         private:
 | |
| 
 | |
|             bool handleEvent(QObject* target, int mod, int value, bool active);
 | |
| 
 | |
|             void storeValue(const QKeySequence& sequence);
 | |
|             void resetState();
 | |
| 
 | |
|             static const int MaxKeys = 4;
 | |
| 
 | |
|             QPushButton* mButton;
 | |
| 
 | |
|             bool mEditorActive;
 | |
|             int mEditorPos;
 | |
|             int mEditorKeys[MaxKeys];
 | |
| 
 | |
|         private slots:
 | |
| 
 | |
|             void buttonToggled(bool checked);
 | |
|     };
 | |
| }
 | |
| 
 | |
| #endif
 |