Commit 58a4ccac authored by Ronan Abhamon's avatar Ronan Abhamon

fix(app): many code style changes

parent 3944fec6
...@@ -6,8 +6,6 @@ import Common.Styles 1.0 ...@@ -6,8 +6,6 @@ import Common.Styles 1.0
// =================================================================== // ===================================================================
DialogPlus { DialogPlus {
id: dialog
buttons: [ buttons: [
TextButtonA { TextButtonA {
text: qsTr('cancel') text: qsTr('cancel')
......
...@@ -3,6 +3,8 @@ import QtQuick.Controls 2.0 ...@@ -3,6 +3,8 @@ import QtQuick.Controls 2.0
import Common.Styles 1.0 import Common.Styles 1.0
// ===================================================================
// A simple custom vertical scrollbar.
// =================================================================== // ===================================================================
ScrollBar { ScrollBar {
......
...@@ -35,8 +35,12 @@ Button { ...@@ -35,8 +35,12 @@ Button {
? textColorHovered ? textColorHovered
: textColorNormal : textColorNormal
) )
font.bold: true
font.pointSize: AbstractTextButtonStyle.text.fontSize font {
bold: true
pointSize: AbstractTextButtonStyle.text.fontSize
}
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
text: button.text text: button.text
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
......
...@@ -47,8 +47,8 @@ CheckBox { ...@@ -47,8 +47,8 @@ CheckBox {
radius: CheckBoxTextStyle.radius radius: CheckBoxTextStyle.radius
visible: checkBox.checked visible: checkBox.checked
width: parent.width - x * 2 width: parent.width - x * 2
x: 4 // Fixed, no style. x: 4 // Fixed, no needed to use style file.
y: 4 // Fixed, no style. y: 4 // Same thing.
} }
} }
} }
...@@ -82,8 +82,12 @@ RowLayout { ...@@ -82,8 +82,12 @@ RowLayout {
Text { Text {
anchors.fill: textEdit anchors.fill: textEdit
color: ListFormStyle.value.placeholder.color color: ListFormStyle.value.placeholder.color
font.italic: true
font.pointSize: ListFormStyle.value.placeholder.fontSize font {
italic: true
pointSize: ListFormStyle.value.placeholder.fontSize
}
padding: textEdit.padding padding: textEdit.padding
text: textEdit.text.length === 0 && !textEdit.activeFocus text: textEdit.text.length === 0 && !textEdit.activeFocus
? listForm.placeholder ? listForm.placeholder
......
...@@ -37,11 +37,14 @@ ColumnLayout { ...@@ -37,11 +37,14 @@ ColumnLayout {
width: menu.entryWidth width: menu.entryWidth
RowLayout { RowLayout {
anchors.left: parent.left anchors {
anchors.leftMargin: MenuStyle.entry.leftMargin left: parent.left
anchors.right: parent.right leftMargin: MenuStyle.entry.leftMargin
anchors.rightMargin: MenuStyle.entry.rightMargin right: parent.right
anchors.verticalCenter: parent.verticalCenter rightMargin: MenuStyle.entry.rightMargin
verticalCenter: parent.verticalCenter
}
spacing: MenuStyle.entry.spacing spacing: MenuStyle.entry.spacing
Icon { Icon {
......
...@@ -3,6 +3,9 @@ import QtQuick.Controls 2.0 ...@@ -3,6 +3,9 @@ import QtQuick.Controls 2.0
import Common.Styles 1.0 import Common.Styles 1.0
// ===================================================================
// A reusable search input which display a entries model in a menu.
// Each entry can be filtered with the search input.
// =================================================================== // ===================================================================
Item { Item {
...@@ -11,12 +14,15 @@ Item { ...@@ -11,12 +14,15 @@ Item {
property alias delegate: list.delegate property alias delegate: list.delegate
property alias entryHeight: menu.entryHeight property alias entryHeight: menu.entryHeight
property alias maxMenuHeight: menu.maxMenuHeight property alias maxMenuHeight: menu.maxMenuHeight
// This property must implement `setFilterFixedString` and/or
// `invalidate` functions.
property alias model: list.model property alias model: list.model
property alias placeholderText: searchField.placeholderText property alias placeholderText: searchField.placeholderText
signal menuClosed () signal menuClosed ()
signal menuOpened () signal menuOpened ()
signal searchTextChanged (string text)
function _hideMenu () { function _hideMenu () {
menu.hide() menu.hide()
...@@ -48,7 +54,13 @@ Item { ...@@ -48,7 +54,13 @@ Item {
Keys.onEscapePressed: _hideMenu() Keys.onEscapePressed: _hideMenu()
onActiveFocusChanged: activeFocus && _showMenu() onActiveFocusChanged: activeFocus && _showMenu()
onTextChanged: searchTextChanged(text) onTextChanged: {
model.setFilterFixedString(text)
if (model.invalidate) {
model.invalidate()
}
}
} }
DropDownMenu { DropDownMenu {
......
pragma Singleton pragma Singleton
import QtQuick 2.7 import QtQuick 2.7
// ===================================================================
QtObject { QtObject {
property QtObject background: QtObject { property QtObject background: QtObject {
property int height: 30 property int height: 30
......
pragma Singleton pragma Singleton
import QtQuick 2.7 import QtQuick 2.7
// ===================================================================
QtObject { QtObject {
property int spacing: 8 property int spacing: 8
} }
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// ===================================================================
QtObject { QtObject {
property int radius: 3 property int radius: 3
property int size: 18 property int size: 18
......
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// ===================================================================
QtObject { QtObject {
property int buttonsSpacing: 8 property int buttonsSpacing: 8
......
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// ===================================================================
QtObject { QtObject {
property int lineHeight: 30 property int lineHeight: 30
......
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// ===================================================================
QtObject { QtObject {
property QtObject background: QtObject { property QtObject background: QtObject {
property int height: 22 property int height: 22
......
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// ===================================================================
QtObject { QtObject {
property QtObject backgroundColor: QtObject { property QtObject backgroundColor: QtObject {
property color hovered: Colors.o property color hovered: Colors.o
......
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// ===================================================================
QtObject { QtObject {
property QtObject backgroundColor: QtObject { property QtObject backgroundColor: QtObject {
property color hovered: Colors.p property color hovered: Colors.p
......
...@@ -3,6 +3,8 @@ import QtQuick 2.7 ...@@ -3,6 +3,8 @@ import QtQuick 2.7
import Common 1.0 import Common 1.0
// ===================================================================
QtObject { QtObject {
property QtObject item: QtObject { property QtObject item: QtObject {
property QtObject color: QtObject { property QtObject color: QtObject {
......
...@@ -100,7 +100,6 @@ ApplicationWindow { ...@@ -100,7 +100,6 @@ ApplicationWindow {
ActionButton { ActionButton {
icon: 'call' icon: 'call'
onClicked: CallsWindow.show() onClicked: CallsWindow.show()
}, },
ActionButton { ActionButton {
......
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