Small Refactor (move all related widgets to subfolder)
Signed-off-by: Tayou <tayou@gmx.net>
This commit is contained in:
parent
3949f52f1d
commit
8a6c0e7314
@ -1015,21 +1015,21 @@ SET(LAUNCHER_SOURCES
|
|||||||
ui/widgets/WideBar.cpp
|
ui/widgets/WideBar.cpp
|
||||||
ui/widgets/ThemeCustomizationWidget.h
|
ui/widgets/ThemeCustomizationWidget.h
|
||||||
ui/widgets/ThemeCustomizationWidget.cpp
|
ui/widgets/ThemeCustomizationWidget.cpp
|
||||||
ui/widgets/GameOptionWidget.h
|
ui/widgets/GameOptions/GameOptionWidget.h
|
||||||
ui/widgets/GameOptionWidgetSlider.h
|
ui/widgets/GameOptions/GameOptionWidgetSlider.h
|
||||||
ui/widgets/GameOptionWidgetSlider.cpp
|
ui/widgets/GameOptions/GameOptionWidgetSlider.cpp
|
||||||
ui/widgets/GameOptionWidgetComboBox.h
|
ui/widgets/GameOptions/GameOptionWidgetComboBox.h
|
||||||
ui/widgets/GameOptionWidgetComboBox.cpp
|
ui/widgets/GameOptions/GameOptionWidgetComboBox.cpp
|
||||||
ui/widgets/GameOptionWidgetCheckBox.h
|
ui/widgets/GameOptions/GameOptionWidgetCheckBox.h
|
||||||
ui/widgets/GameOptionWidgetCheckBox.cpp
|
ui/widgets/GameOptions/GameOptionWidgetCheckBox.cpp
|
||||||
ui/widgets/GameOptionWidgetSpinnerFloat.h
|
ui/widgets/GameOptions/GameOptionWidgetSpinnerFloat.h
|
||||||
ui/widgets/GameOptionWidgetSpinnerFloat.cpp
|
ui/widgets/GameOptions/GameOptionWidgetSpinnerFloat.cpp
|
||||||
ui/widgets/GameOptionWidgetSpinnerInt.h
|
ui/widgets/GameOptions/GameOptionWidgetSpinnerInt.h
|
||||||
ui/widgets/GameOptionWidgetSpinnerInt.cpp
|
ui/widgets/GameOptions/GameOptionWidgetSpinnerInt.cpp
|
||||||
ui/widgets/GameOptionWidgetText.h
|
ui/widgets/GameOptions/GameOptionWidgetText.h
|
||||||
ui/widgets/GameOptionWidgetText.cpp
|
ui/widgets/GameOptions/GameOptionWidgetText.cpp
|
||||||
ui/widgets/GameOptionWidgetKeyBind.h
|
ui/widgets/GameOptions/GameOptionWidgetKeyBind.h
|
||||||
ui/widgets/GameOptionWidgetKeyBind.cpp
|
ui/widgets/GameOptions/GameOptionWidgetKeyBind.cpp
|
||||||
|
|
||||||
# GUI - instance group view
|
# GUI - instance group view
|
||||||
ui/instanceview/InstanceProxyModel.cpp
|
ui/instanceview/InstanceProxyModel.cpp
|
||||||
@ -1083,13 +1083,13 @@ qt_wrap_ui(LAUNCHER_UI
|
|||||||
ui/widgets/ModFilterWidget.ui
|
ui/widgets/ModFilterWidget.ui
|
||||||
ui/widgets/SubTaskProgressBar.ui
|
ui/widgets/SubTaskProgressBar.ui
|
||||||
ui/widgets/ThemeCustomizationWidget.ui
|
ui/widgets/ThemeCustomizationWidget.ui
|
||||||
ui/widgets/GameOptionWidgetSlider.ui
|
ui/widgets/GameOptions/GameOptionWidgetSlider.ui
|
||||||
ui/widgets/GameOptionWidgetComboBox.ui
|
ui/widgets/GameOptions/GameOptionWidgetComboBox.ui
|
||||||
ui/widgets/GameOptionWidgetCheckBox.ui
|
ui/widgets/GameOptions/GameOptionWidgetCheckBox.ui
|
||||||
ui/widgets/GameOptionWidgetSpinnerFloat.ui
|
ui/widgets/GameOptions/GameOptionWidgetSpinnerFloat.ui
|
||||||
ui/widgets/GameOptionWidgetSpinnerInt.ui
|
ui/widgets/GameOptions/GameOptionWidgetSpinnerInt.ui
|
||||||
ui/widgets/GameOptionWidgetText.ui
|
ui/widgets/GameOptions/GameOptionWidgetText.ui
|
||||||
ui/widgets/GameOptionWidgetKeyBind.ui
|
ui/widgets/GameOptions/GameOptionWidgetKeyBind.ui
|
||||||
ui/dialogs/CopyInstanceDialog.ui
|
ui/dialogs/CopyInstanceDialog.ui
|
||||||
ui/dialogs/ProfileSetupDialog.ui
|
ui/dialogs/ProfileSetupDialog.ui
|
||||||
ui/dialogs/ProgressDialog.ui
|
ui/dialogs/ProgressDialog.ui
|
||||||
|
@ -16,14 +16,14 @@
|
|||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "GameOptionDelegate.h"
|
#include "GameOptionDelegate.h"
|
||||||
#include "ui/widgets/GameOptionWidget.h"
|
#include "ui/widgets/GameOptions/GameOptionWidget.h"
|
||||||
#include "ui/widgets/GameOptionWidgetCheckBox.h"
|
#include "ui/widgets/GameOptions/GameOptionWidgetCheckBox.h"
|
||||||
#include "ui/widgets/GameOptionWidgetComboBox.h"
|
#include "ui/widgets/GameOptions/GameOptionWidgetComboBox.h"
|
||||||
#include "ui/widgets/GameOptionWidgetKeyBind.h"
|
#include "ui/widgets/GameOptions/GameOptionWidgetKeyBind.h"
|
||||||
#include "ui/widgets/GameOptionWidgetSlider.h"
|
#include "ui/widgets/GameOptions/GameOptionWidgetSlider.h"
|
||||||
#include "ui/widgets/GameOptionWidgetSpinnerFloat.h"
|
#include "ui/widgets/GameOptions/GameOptionWidgetSpinnerFloat.h"
|
||||||
#include "ui/widgets/GameOptionWidgetSpinnerInt.h"
|
#include "ui/widgets/GameOptions/GameOptionWidgetSpinnerInt.h"
|
||||||
#include "ui/widgets/GameOptionWidgetText.h"
|
#include "ui/widgets/GameOptions/GameOptionWidgetText.h"
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@ -94,4 +94,8 @@ void GameOptionDelegate::setModelData(QWidget* editor, QAbstractItemModel* model
|
|||||||
} else {
|
} else {
|
||||||
qDebug() << "[GameOptions] Saving widget data to Model failed because widget was null";
|
qDebug() << "[GameOptions] Saving widget data to Model failed because widget was null";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QSize GameOptionDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||||
|
{
|
||||||
|
return QSize(option.widget->height(), option.widget->width());
|
||||||
|
}
|
||||||
|
@ -37,6 +37,7 @@ class GameOptionDelegate : public QStyledItemDelegate {
|
|||||||
const QStyleOptionViewItem& option,
|
const QStyleOptionViewItem& option,
|
||||||
const QModelIndex& index) const override;
|
const QModelIndex& index) const override;
|
||||||
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
|
void setModelData(QWidget* editor, QAbstractItemModel* model, const QModelIndex& index) const override;
|
||||||
|
QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const override;
|
||||||
|
|
||||||
enum GameOptionWidgetType { slider, text, keybind, number, comboBox };
|
enum GameOptionWidgetType { slider, text, keybind, number, comboBox };
|
||||||
|
|
||||||
|
@ -89,3 +89,11 @@ void GameOptionWidgetSlider::saveEditorData(GameOptionItem optionItem) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSize GameOptionWidgetSlider::sizeHint() const
|
||||||
|
{
|
||||||
|
QSize size = GameOptionWidget::sizeHint();
|
||||||
|
size.setHeight(size.height() * 2);
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
@ -32,6 +32,7 @@ class GameOptionWidgetSlider : public GameOptionWidget {
|
|||||||
~GameOptionWidgetSlider() override;
|
~GameOptionWidgetSlider() override;
|
||||||
void setEditorData(GameOptionItem optionItem);
|
void setEditorData(GameOptionItem optionItem);
|
||||||
void saveEditorData(GameOptionItem optionItem) override;
|
void saveEditorData(GameOptionItem optionItem) override;
|
||||||
|
QSize sizeHint() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::GameOptionWidgetSlider* ui;
|
Ui::GameOptionWidgetSlider* ui;
|
Loading…
x
Reference in New Issue
Block a user