Address review comments

This commit is contained in:
Nicolas Werner 2022-01-11 04:12:42 +01:00
parent f1a23355bd
commit 59bc8307c8
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
3 changed files with 8 additions and 13 deletions

View file

@ -6,22 +6,18 @@
import "ui" import "ui"
import Qt.labs.platform 1.1 as Platform import Qt.labs.platform 1.1 as Platform
import QtQuick 2.15 import QtQuick 2.15
import QtQuick.Controls 2.3 import QtQuick.Controls 2.15
import QtQuick.Layouts 1.2 import QtQuick.Layouts 1.2
import QtQuick.Window 2.13 import QtQuick.Window 2.15
import im.nheko 1.0 import im.nheko 1.0
Rectangle { Rectangle {
id: userSettingsDialog id: userSettingsDialog
property bool collapsed: width < 800 property int collapsePoint: 800
property bool collapsed: width < collapsePoint
color: Nheko.colors.window color: Nheko.colors.window
Shortcut {
sequence: StandardKey.Cancel
onActivated: userSettingsDialog.close()
}
ScrollView { ScrollView {
id: scroll id: scroll
@ -51,8 +47,8 @@ Rectangle {
columnSpacing: Nheko.paddingMedium columnSpacing: Nheko.paddingMedium
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: userSettingsDialog.collapsed ? Nheko.paddingLarge : (userSettingsDialog.width-600) * 0.4 anchors.leftMargin: userSettingsDialog.collapsed ? Nheko.paddingLarge : (userSettingsDialog.width-userSettingsDialog.collapsePoint) * 0.4
anchors.rightMargin: userSettingsDialog.collapsed ? Nheko.paddingLarge : (userSettingsDialog.width-600) * 0.4 anchors.rightMargin: anchors.leftMargin
Repeater { Repeater {
model: UserSettingsModel model: UserSettingsModel
@ -63,7 +59,6 @@ Rectangle {
Component.onCompleted: { Component.onCompleted: {
while (children.length) { while (children.length) {
console.log("Reparenting: " + children[0]);
children[0].parent = grid; children[0].parent = grid;
} }
} }
@ -79,7 +74,7 @@ Rectangle {
Layout.minimumWidth: implicitWidth Layout.minimumWidth: implicitWidth
Layout.leftMargin: model.type == UserSettingsModel.SectionTitle ? 0 : Nheko.paddingMedium Layout.leftMargin: model.type == UserSettingsModel.SectionTitle ? 0 : Nheko.paddingMedium
Layout.topMargin: model.type == UserSettingsModel.SectionTitle ? Nheko.paddingLarge : 0 Layout.topMargin: model.type == UserSettingsModel.SectionTitle ? Nheko.paddingLarge : 0
font.pointSize: 1.1 * fontInfo.pointSize font.pointSize: 1.1 * fontMetrics.font.pointSize
HoverHandler { HoverHandler {
id: hovered id: hovered

View file

@ -8,6 +8,7 @@ import QtQuick 2.9
import QtQuick.Controls 2.5 import QtQuick.Controls 2.5
import im.nheko 1.0 import im.nheko 1.0
// FIXME(Nico): Don't use hardcoded colors.
Button { Button {
id: control id: control

View file

@ -964,7 +964,6 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
return data(index, Values).toStringList().indexOf(i->emojiFont()); return data(index, Values).toStringList().indexOf(i->emojiFont());
case Ringtone: { case Ringtone: {
auto v = i->ringtone(); auto v = i->ringtone();
nhlog::ui()->critical("ringtone: {}", v.toStdString());
if (v == QStringView(u"Mute")) if (v == QStringView(u"Mute"))
return 0; return 0;
else if (v == QStringView(u"Default")) else if (v == QStringView(u"Default"))