diff --git a/interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml b/interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml index 77c94c2ae5..b61c3430fd 100644 --- a/interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml +++ b/interface/resources/qml/dialogs/preferences/RadioButtonsPreference.qml @@ -11,10 +11,11 @@ import QtQuick 2.5 import "../../controls-uit" +import "../../styles-uit" Preference { id: root - + height: control.height + hifi.dimensions.controlInterlineHeight Component.onCompleted: { @@ -33,23 +34,35 @@ Preference { preference.save(); } - Row { + Column { id: control anchors { left: parent.left right: parent.right bottom: parent.bottom } - spacing: 5 + spacing: 3 + + RalewaySemiBold { + id: heading + size: hifi.fontSizes.inputLabel + text: preference.heading + color: hifi.colors.lightGrayText + visible: text !== "" + bottomPadding: 3 + } Repeater { id: repeater model: preference.items.length delegate: RadioButton { text: preference.items[index] + letterSpacing: 0 anchors { - verticalCenter: parent.verticalCenter + left: parent.left } + + leftPadding: 0 colorScheme: hifi.colorSchemes.dark } } diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 951925214c..a98d1ae1f1 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -245,6 +245,7 @@ void setupPreferences() { auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Snap turn / Smooth turn", getter, setter); QStringList items; items << "Snap turn" << "Smooth turn"; + preference->setHeading("Rotation mode"); preference->setItems(items); preferences->addPreference(preference); } diff --git a/libraries/shared/src/Preferences.h b/libraries/shared/src/Preferences.h index 27bcf7a71b..e1feea6c1b 100644 --- a/libraries/shared/src/Preferences.h +++ b/libraries/shared/src/Preferences.h @@ -356,16 +356,20 @@ public: class RadioButtonsPreference : public IntPreference { Q_OBJECT + Q_PROPERTY(QString heading READ getHeading CONSTANT) Q_PROPERTY(QStringList items READ getItems CONSTANT) public: RadioButtonsPreference(const QString& category, const QString& name, Getter getter, Setter setter) : IntPreference(category, name, getter, setter) { } Type getType() override { return RadioButtons; } + const QString& getHeading() { return _heading; } const QStringList& getItems() { return _items; } + void setHeading(const QString& heading) { _heading = heading; } void setItems(const QStringList& items) { _items = items; } protected: + QString _heading; QStringList _items; }; #endif