Editor: Improve Models category layout

Increase minimum input field width and give proper labels to string settings
pull/3236/head
Alexei Kotov 3 months ago
parent 224b9f0692
commit 0b1465446d

@ -408,12 +408,12 @@ void CSMPrefs::State::declare()
declareShortcut(mValues->mKeyBindings.mScriptEditorUncomment, "Uncomment Selection"); declareShortcut(mValues->mKeyBindings.mScriptEditorUncomment, "Uncomment Selection");
declareCategory("Models"); declareCategory("Models");
declareString(mValues->mModels.mBaseanim, "base animations").setTooltip("3rd person base model with textkeys-data"); declareString(mValues->mModels.mBaseanim, "Base Animations").setTooltip("Third person base model and animations");
declareString(mValues->mModels.mBaseanimkna, "base animations, kna") declareString(mValues->mModels.mBaseanimkna, "Base Animations, Beast")
.setTooltip("3rd person beast race base model with textkeys-data"); .setTooltip("Third person beast race base model and animations");
declareString(mValues->mModels.mBaseanimfemale, "base animations, female") declareString(mValues->mModels.mBaseanimfemale, "Base Animations, Female")
.setTooltip("3rd person female base model with textkeys-data"); .setTooltip("Third person female base model and animations");
declareString(mValues->mModels.mWolfskin, "base animations, wolf").setTooltip("3rd person werewolf skin"); declareString(mValues->mModels.mWolfskin, "Base Animations, Werewolf").setTooltip("Third person werewolf skin");
} }
void CSMPrefs::State::declareCategory(const std::string& key) void CSMPrefs::State::declareCategory(const std::string& key)

@ -1,6 +1,7 @@
#include "stringsetting.hpp" #include "stringsetting.hpp"
#include <QLabel>
#include <QLineEdit> #include <QLineEdit>
#include <QMutexLocker> #include <QMutexLocker>
@ -26,17 +27,21 @@ CSMPrefs::StringSetting& CSMPrefs::StringSetting::setTooltip(const std::string&
CSMPrefs::SettingWidgets CSMPrefs::StringSetting::makeWidgets(QWidget* parent) CSMPrefs::SettingWidgets CSMPrefs::StringSetting::makeWidgets(QWidget* parent)
{ {
QLabel* label = new QLabel(getLabel(), parent);
mWidget = new QLineEdit(QString::fromStdString(getValue()), parent); mWidget = new QLineEdit(QString::fromStdString(getValue()), parent);
mWidget->setMinimumWidth(300);
if (!mTooltip.empty()) if (!mTooltip.empty())
{ {
QString tooltip = QString::fromUtf8(mTooltip.c_str()); QString tooltip = QString::fromUtf8(mTooltip.c_str());
label->setToolTip(tooltip);
mWidget->setToolTip(tooltip); mWidget->setToolTip(tooltip);
} }
connect(mWidget, &QLineEdit::textChanged, this, &StringSetting::textChanged); connect(mWidget, &QLineEdit::textChanged, this, &StringSetting::textChanged);
return SettingWidgets{ .mLabel = nullptr, .mInput = mWidget }; return SettingWidgets{ .mLabel = label, .mInput = mWidget };
} }
void CSMPrefs::StringSetting::updateWidget() void CSMPrefs::StringSetting::updateWidget()

Loading…
Cancel
Save