Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Сделана вкладка Keyboard в диалоге Настроки редактора. На этой вкладк…
…е сделана кнопка вызова диалога настройки кнопок панелей инструментов редактора.
- Loading branch information
Showing
4 changed files
with
143 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#include <QWidget> | ||
#include <QBoxLayout> | ||
#include <QGroupBox> | ||
#include <QtDebug> | ||
|
||
#include "../../main.h" | ||
|
||
#include "EditorConfigKeyboard.h" | ||
|
||
|
||
EditorConfigKeyboard::EditorConfigKeyboard(QWidget *parent) : ConfigPage(parent) | ||
{ | ||
setupUi(); | ||
setupSignals(); | ||
assembly(); | ||
} | ||
|
||
|
||
EditorConfigKeyboard::~EditorConfigKeyboard() | ||
{ | ||
|
||
} | ||
|
||
void EditorConfigKeyboard::setupUi(void) | ||
{ | ||
qDebug() << "Create keyboard config page"; | ||
|
||
// Кнопка редактирования файла конфигурации распределения кнопок по панелям инструментов редактора | ||
editToolButtonsConfigFile = new QPushButton(this); | ||
editToolButtonsConfigFile->setText(tr("Edit ToolButtons")); | ||
editToolButtonsConfigFile->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Fixed, QSizePolicy::ToolButton)); | ||
} | ||
|
||
|
||
// Связывание сигналов, генерируемых объектами класса и слотов для их обработки | ||
void EditorConfigKeyboard::setupSignals(void) | ||
{ | ||
connect(editToolButtonsConfigFile, &QPushButton::clicked, | ||
this, &EditorConfigKeyboard::onClickedEditToolButtonsConfigFile); | ||
} | ||
|
||
|
||
// Создание жиджетов панели "Keyboard" | ||
void EditorConfigKeyboard::assembly(void) | ||
{ | ||
// Группирующая рамка | ||
QGroupBox *toolButtonsBox=new QGroupBox(this); | ||
toolButtonsBox->setTitle(tr("ToolButtons preferences")); | ||
|
||
// Вставка виджетов в группирующую рамку | ||
QVBoxLayout *toolButtonsLayout = new QVBoxLayout(this); | ||
toolButtonsLayout->addWidget(editToolButtonsConfigFile); | ||
toolButtonsBox->setLayout(toolButtonsLayout); | ||
|
||
// Сборка основного слоя | ||
QVBoxLayout *centralLayout=new QVBoxLayout(this); | ||
centralLayout->addWidget(toolButtonsBox); | ||
centralLayout->addStretch(); | ||
|
||
// Установка основного слоя | ||
setLayout(centralLayout); | ||
} | ||
|
||
|
||
// Запуск диалога распределения кнопок по панелям инструментов редактора | ||
void EditorConfigKeyboard::onClickedEditToolButtonsConfigFile(void) | ||
{ | ||
// ShortcutSettingsScreen shortcutSettingsScreen; | ||
// shortcutSettingsScreen.setWindowTitle(tr("Keyboard config")); | ||
|
||
// shortcutSettingsScreen.exec(); | ||
} | ||
|
||
|
||
// Возвращает признак необходимости перезагрузки MyTetra, | ||
// в зависимости от уровеня сложности вносимых изменений | ||
// 0 - изменения можно делать на лету, перезагрузка MyTetra не нужна | ||
// 1 - для принятия изменений нужна перезагрузка MyTetra | ||
int EditorConfigKeyboard::applyChanges(void) | ||
{ | ||
qDebug() << "Apply changes editor misc"; | ||
|
||
int result = 0; | ||
|
||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#ifndef EDITORCONFIGKEYBOARD_H | ||
#define EDITORCONFIGKEYBOARD_H | ||
|
||
#include <QWidget> | ||
#include <QLineEdit> | ||
#include <QFontComboBox> | ||
#include <QSpinBox> | ||
#include <QPushButton> | ||
#include <QLabel> | ||
#include <QGroupBox> | ||
#include <QVBoxLayout> | ||
|
||
#include "views/appConfigWindow/ConfigPage.h" | ||
|
||
class EditorConfig; | ||
|
||
|
||
class EditorConfigKeyboard : public ConfigPage | ||
{ | ||
Q_OBJECT | ||
|
||
public: | ||
EditorConfigKeyboard(QWidget *parent = nullptr); | ||
virtual ~EditorConfigKeyboard(void); | ||
|
||
int applyChanges(void); | ||
|
||
private slots: | ||
void onClickedEditToolButtonsConfigFile(void); | ||
|
||
protected: | ||
|
||
QPushButton *editToolButtonsConfigFile; | ||
|
||
void setupUi(void); | ||
void setupSignals(void); | ||
void assembly(void); | ||
|
||
private: | ||
|
||
EditorConfig *conf; | ||
|
||
QLabel *indentStepLabel; | ||
QLabel *indentStepFlexion; | ||
QSpinBox *indentStep; | ||
|
||
}; | ||
|
||
|
||
#endif // EDITORCONFIGKEYBOARD_H | ||
|