mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 23:53:48 +02:00
Modify layout of rotation mode settings options
This commit is contained in:
parent
a00cacc03e
commit
af1b4fef5d
3 changed files with 22 additions and 4 deletions
interface
libraries/shared/src
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue