shift-shell/dialer/package/contents/ui/Dialpad/PhoneNumberInput.qml
Michael Eden 7024f462b7 fix dial pad UI by using density independent units
Summary:
I fixed the strange dialer on the phone, here's a picture:

{F6433134}

Now I have a few questions:

1. To get the '#', '*', & '+' symbols to show up I need to install a font that supports those glyphs. I've only found the font `fonts-mplus`. I can slice this font to only get those glyphs and package them here, or add this font as a dependency.

We should likely have a font like this installed anyway, so people can see weird glyphs on the internet.

2. Is the correct way to set font sizes `pixelSize: units.gridUnit`?

Test Plan: manual testing?

Reviewers: bshah, mart

Reviewed By: bshah

Differential Revision: https://phabricator.kde.org/D17037
2018-11-20 10:50:07 -05:00

34 lines
774 B
QML

import QtQuick 2.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
// TODO: search through contacts while typing
PlasmaComponents.TextField {
id: root
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignBottom
style: TextFieldStyle {
background: Rectangle {
opacity: 0
}
}
// append some text to the end of this input
signal append(string digit)
onAppend: {
text += digit
}
onTextChanged: {
text = dialerUtils.formatNumber(text);
}
// remove last character from this text input
signal pop()
onPop: {
text = text.slice(0, -1)
}
}