Commit b8780ac3 authored by Martin Straka's avatar Martin Straka

Set height of control elements in the search page

parent 0f0c2236
......@@ -71,6 +71,8 @@ ApplicationWindow {
property int textFontSizeSmall: if (textPointSmall > 0) {textPointSmall} else {8}
property int headerHeight: textFontSizeInPixels * 3
property int imgHeight: headerHeight * 0.8
// inputItemHeight holds height of controls elements computed from font size
property int inputItemHeight: headerHeight * 0.8
property int navImgHeight: headerHeight * 0.3
property int listItemHeight: headerHeight * 1.5
property int defaultMargin: Math.round(Screen.pixelDensity)
......
......@@ -114,7 +114,7 @@ Component {
id: filterPhraseText
placeholderText: qsTr("Filter phrase")
width: headerBar.width * 0.3
height: imgHeight
height: inputItemHeight
inputMethodHints: Qt.ImhNoPredictiveText
onTextChanged: {
proxyMessageModel.setFilterRegExpStr(filterPhraseText.text)
......
......@@ -93,7 +93,7 @@ Component {
id: searchPanel
anchors.top: headerBar.bottom
width: parent.width
height: searchOptionComboBox.height + searchButton.height + 3*defaultMargin
height: 2*inputItemHeight + 3*defaultMargin
function doSearchRequest() {
return (messages.searchMsg(messageModel, searchPhraseText.text, soughtMsgType) <= 0)
}
......@@ -105,7 +105,7 @@ Component {
currentIndex: 0
textRole: "key"
width: parent.width
height: searchButton.height
height: inputItemHeight
model: ListModel {
id: searchOptionComboBoxModel
// Don't change position of list elements and keys.
......@@ -131,7 +131,7 @@ Component {
placeholderText: qsTr("Enter phrase")
focus: true
width: searchOptionComboBox.width - defaultMargin - searchButton.width
height: searchButton.height
height: inputItemHeight
onAccepted: emptyList.visible = searchPanel.doSearchRequest()
/* TODO - the menu can be removed */
Menu {
......@@ -172,6 +172,7 @@ Component {
}
Button {
id: searchButton
height: inputItemHeight
text: qsTr("Search")
onClicked: {
emptyList.visible = searchPanel.doSearchRequest()
......
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