mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 02:33:09 +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
|
@ -11,10 +11,11 @@
|
||||||
import QtQuick 2.5
|
import QtQuick 2.5
|
||||||
|
|
||||||
import "../../controls-uit"
|
import "../../controls-uit"
|
||||||
|
import "../../styles-uit"
|
||||||
|
|
||||||
Preference {
|
Preference {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
height: control.height + hifi.dimensions.controlInterlineHeight
|
height: control.height + hifi.dimensions.controlInterlineHeight
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
|
@ -33,23 +34,35 @@ Preference {
|
||||||
preference.save();
|
preference.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
Row {
|
Column {
|
||||||
id: control
|
id: control
|
||||||
anchors {
|
anchors {
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
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 {
|
Repeater {
|
||||||
id: repeater
|
id: repeater
|
||||||
model: preference.items.length
|
model: preference.items.length
|
||||||
delegate: RadioButton {
|
delegate: RadioButton {
|
||||||
text: preference.items[index]
|
text: preference.items[index]
|
||||||
|
letterSpacing: 0
|
||||||
anchors {
|
anchors {
|
||||||
verticalCenter: parent.verticalCenter
|
left: parent.left
|
||||||
}
|
}
|
||||||
|
|
||||||
|
leftPadding: 0
|
||||||
colorScheme: hifi.colorSchemes.dark
|
colorScheme: hifi.colorSchemes.dark
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,6 +245,7 @@ void setupPreferences() {
|
||||||
auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Snap turn / Smooth turn", getter, setter);
|
auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Snap turn / Smooth turn", getter, setter);
|
||||||
QStringList items;
|
QStringList items;
|
||||||
items << "Snap turn" << "Smooth turn";
|
items << "Snap turn" << "Smooth turn";
|
||||||
|
preference->setHeading("Rotation mode");
|
||||||
preference->setItems(items);
|
preference->setItems(items);
|
||||||
preferences->addPreference(preference);
|
preferences->addPreference(preference);
|
||||||
}
|
}
|
||||||
|
|
|
@ -356,16 +356,20 @@ public:
|
||||||
|
|
||||||
class RadioButtonsPreference : public IntPreference {
|
class RadioButtonsPreference : public IntPreference {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(QString heading READ getHeading CONSTANT)
|
||||||
Q_PROPERTY(QStringList items READ getItems CONSTANT)
|
Q_PROPERTY(QStringList items READ getItems CONSTANT)
|
||||||
public:
|
public:
|
||||||
RadioButtonsPreference(const QString& category, const QString& name, Getter getter, Setter setter)
|
RadioButtonsPreference(const QString& category, const QString& name, Getter getter, Setter setter)
|
||||||
: IntPreference(category, name, getter, setter) { }
|
: IntPreference(category, name, getter, setter) { }
|
||||||
Type getType() override { return RadioButtons; }
|
Type getType() override { return RadioButtons; }
|
||||||
|
|
||||||
|
const QString& getHeading() { return _heading; }
|
||||||
const QStringList& getItems() { return _items; }
|
const QStringList& getItems() { return _items; }
|
||||||
|
void setHeading(const QString& heading) { _heading = heading; }
|
||||||
void setItems(const QStringList& items) { _items = items; }
|
void setItems(const QStringList& items) { _items = items; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
QString _heading;
|
||||||
QStringList _items;
|
QStringList _items;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue