Commit 5f901ac5 authored by Leander Schulten's avatar Leander Schulten

UI: Clip TextinputField by default. Fix selection color in main.qml. Clip SettingsView if necessary

parent 1d0e4739
Pipeline #199400 passed with stage
in 5 minutes and 38 seconds
...@@ -19,6 +19,7 @@ ScrollView{ ...@@ -19,6 +19,7 @@ ScrollView{
contentHeight: layout.implicitHeight contentHeight: layout.implicitHeight
contentWidth: Math.max(600, width - 2 * padding) contentWidth: Math.max(600, width - 2 * padding)
padding: 10 padding: 10
clip: contentHeight > height
GridLayout{ GridLayout{
id: layout id: layout
anchors.left: parent.left anchors.left: parent.left
...@@ -31,20 +32,11 @@ ScrollView{ ...@@ -31,20 +32,11 @@ ScrollView{
RowLayout{ RowLayout{
id: root id: root
enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_SETTINGS_FILE_PATH) enabled: UserManagment.currentUser.havePermission(Permission.CHANGE_SETTINGS_FILE_PATH)
Item{ TextInputField {
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: inputSettingsPath.implicitWidth id: inputSettingsPath
Layout.preferredHeight: inputSettingsPath.implicitHeight readOnly: true
Layout.topMargin: 4 text: Settings.jsonSettingsFilePath
clip: true
id: wrapper
TextInputField{
id: inputSettingsPath
readOnly: true
anchors.fill: parent
anchors.bottomMargin: 2
text: Settings.jsonSettingsFilePath
}
} }
Button{ Button{
Layout.minimumWidth: implicitWidth Layout.minimumWidth: implicitWidth
......
...@@ -10,21 +10,13 @@ RowLayout{ ...@@ -10,21 +10,13 @@ RowLayout{
property bool folder: false property bool folder: false
property var fileChooser: null property var fileChooser: null
height: 20 height: 20
Item{
TextInputField{
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredWidth: textField.implicitWidth id: textField
Layout.preferredHeight: textField.implicitHeight text: root.path
Layout.topMargin: 4 onAccepted: {
id: wrapper root.path = text
clip: true
TextInputField{
id:textField
text: root.path
anchors.fill: parent
anchors.bottomMargin: 2
onAccepted: {
root.path = text
}
} }
} }
Button{ Button{
......
...@@ -7,23 +7,25 @@ TextInput{ ...@@ -7,23 +7,25 @@ TextInput{
color: Material.foreground color: Material.foreground
selectByMouse: true selectByMouse: true
font.pixelSize: 15 font.pixelSize: 15
selectionColor: Material.textSelectionColor selectionColor: Material.accentColor
selectedTextColor: Material.primaryHighlightedTextColor
bottomPadding: 3
topPadding: 3
clip: contentWidth > width || underline.width > width
property alias underlineColor : underline.color property alias underlineColor : underline.color
property alias underline: underline property alias underline: underline
cursorDelegate: Rectangle{ cursorDelegate: Rectangle{
color: Material.accentColor color: Material.accentColor
x:parent.cursorRectangle.x x: parent.cursorRectangle.x
y:parent.cursorRectangle.y y: parent.cursorRectangle.y
width:parent.cursorRectangle.width+1 width: parent.cursorRectangle.width+1
height:parent.cursorRectangle.height height: parent.cursorRectangle.height
visible: parent.cursorVisible visible: parent.cursorVisible
Behavior on x { Behavior on x {
NumberAnimation { easing.type: Easing.OutCubic; easing.amplitude: 9; easing.period: 50.0; duration: 500 } NumberAnimation { easing.type: Easing.OutCubic; easing.amplitude: 9; easing.period: 50.0; duration: 500 }
} }
} }
//onCursorRectangleChanged: underline.clickX = cursorRectangle.x
TextUnderline{ TextUnderline{
id:underline id: underline
//hasFocus: parent.focus
} }
} }
...@@ -5,7 +5,7 @@ Rectangle{ ...@@ -5,7 +5,7 @@ Rectangle{
id:underline id:underline
property real extendetWidth: 10 property real extendetWidth: 10
//property real clickX: 0 //property real clickX: 0
anchors.top:parent.bottom anchors.bottom: parent.bottom
anchors.left:parent.left anchors.left:parent.left
width: parent.contentWidth+extendetWidth width: parent.contentWidth+extendetWidth
height: 2 height: 2
......
...@@ -349,7 +349,7 @@ ApplicationWindow { ...@@ -349,7 +349,7 @@ ApplicationWindow {
Layout.rightMargin: 2 Layout.rightMargin: 2
clip: true clip: true
color: Material.foreground color: Material.foreground
selectionColor: Material.textSelectionColor selectionColor: Material.accentColor
font: fontReference.font font: fontReference.font
text: Settings.jsonSettingsFilePath text: Settings.jsonSettingsFilePath
selectByMouse: true selectByMouse: true
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment