Commit 7fdd7f1a authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Menu): use style file

parent ba2ec692
...@@ -59,6 +59,7 @@ ...@@ -59,6 +59,7 @@
<file>ui/modules/Linphone/Styles/CollapseStyle.qml</file> <file>ui/modules/Linphone/Styles/CollapseStyle.qml</file>
<file>ui/modules/Linphone/Styles/DialogStyle.qml</file> <file>ui/modules/Linphone/Styles/DialogStyle.qml</file>
<file>ui/modules/Linphone/Styles/ForceScrollBarStyle.qml</file> <file>ui/modules/Linphone/Styles/ForceScrollBarStyle.qml</file>
<file>ui/modules/Linphone/Styles/MenuStyle.qml</file>
<file>ui/modules/Linphone/Styles/PopupStyle.qml</file> <file>ui/modules/Linphone/Styles/PopupStyle.qml</file>
<file>ui/modules/Linphone/Styles/qmldir</file> <file>ui/modules/Linphone/Styles/qmldir</file>
<file>ui/modules/Linphone/Styles/SearchBoxStyle.qml</file> <file>ui/modules/Linphone/Styles/SearchBoxStyle.qml</file>
......
...@@ -5,13 +5,22 @@ QtObject { ...@@ -5,13 +5,22 @@ QtObject {
property int zPopup: 999 property int zPopup: 999
property int zMax: 999999 property int zMax: 999999
// TODO: Mutualize similar colors.
property QtObject colors: QtObject { property QtObject colors: QtObject {
property string a: 'transparent' property string a: 'transparent'
property string b: '#5E5E5F' property string b: '#5E5E5F' // Pressed toolbar.
property string c: '#C5C5C5' property string c: '#C5C5C5' // Released toolbar.
property string d: '#5A585B'
property string e: '#DEDEDE' property string d: '#5A585B' // Text color.
property string f: '#808080'
property string e: '#DEDEDE' // Timeline separator
property string f: '#808080' // Popup shadow.
property string g: '#8E8E8E' // MenuEntry Normal.
property string h: '#707070' // MenuEntry Hovered.
property string i: '#FE5E00' // MenuEntry Pressed.
property string j: '#434343' // MenuEntry Selected.
property string k: '#FFFFFF' // Text color.
} }
} }
...@@ -2,6 +2,7 @@ import QtQuick 2.7 ...@@ -2,6 +2,7 @@ import QtQuick 2.7
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import Linphone 1.0 import Linphone 1.0
import Linphone.Styles 1.0
// =================================================================== // ===================================================================
// Responsive flat menu with visual indicators. // Responsive flat menu with visual indicators.
...@@ -18,19 +19,19 @@ ColumnLayout { ...@@ -18,19 +19,19 @@ ColumnLayout {
signal entrySelected (int entry) signal entrySelected (int entry)
spacing: 2 spacing: MenuStyle.spacing
Repeater { Repeater {
model: entries model: entries
Rectangle { Rectangle {
color: _selectedEntry === index color: _selectedEntry === index
? '#434343' ? MenuStyle.entry.color.selected
: (mouseArea.pressed : (mouseArea.pressed
? '#FE5E00' ? MenuStyle.entry.color.pressed
: (mouseArea.containsMouse : (mouseArea.containsMouse
? '#707070' ? MenuStyle.entry.color.hovered
: '#8E8E8E' : MenuStyle.entry.color.normal
) )
) )
height: item.entryHeight height: item.entryHeight
...@@ -38,22 +39,22 @@ ColumnLayout { ...@@ -38,22 +39,22 @@ ColumnLayout {
RowLayout { RowLayout {
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 20 anchors.leftMargin: MenuStyle.entry.leftMargin
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 20 anchors.rightMargin: MenuStyle.entry.rightMargin
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 18 spacing: MenuStyle.entry.spacing
Icon { Icon {
Layout.preferredHeight: 24 Layout.preferredHeight: MenuStyle.entry.iconSize
Layout.preferredWidth: 24 Layout.preferredWidth: MenuStyle.entry.iconSize
icon: modelData.icon icon: modelData.icon
} }
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
color: '#FFFFFF' color: MenuStyle.entry.textColor
font.pointSize: 13 font.pointSize: MenuStyle.entry.fontSize
height: parent.height height: parent.height
text: modelData.entryName text: modelData.entryName
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
...@@ -61,9 +62,11 @@ ColumnLayout { ...@@ -61,9 +62,11 @@ ColumnLayout {
Icon { Icon {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
Layout.preferredHeight: 12 Layout.preferredHeight: MenuStyle.entry.selectionIconSize
Layout.preferredWidth: 12 Layout.preferredWidth: MenuStyle.entry.selectionIconSize
icon: _selectedEntry === index ? 'right_arrow' : '' icon: _selectedEntry === index
? MenuStyle.entry.selectionIcon
: ''
} }
} }
......
...@@ -4,6 +4,7 @@ import QtQuick 2.7 ...@@ -4,6 +4,7 @@ import QtQuick 2.7
QtObject { QtObject {
property int animationDuration: 200 property int animationDuration: 200
property int iconSize: 32 property int iconSize: 32
property string icon: 'collapse' property string icon: 'collapse'
property Rectangle background: Rectangle { property Rectangle background: Rectangle {
......
pragma Singleton
import QtQuick 2.7
import Linphone 1.0
QtObject {
property int spacing: 2
property QtObject entry: QtObject {
property int fontSize: 13
property int iconSize: 24
property int leftMargin: 20
property int rightMargin: 20
property int selectionIconSize: 12
property int spacing: 18
property string selectionIcon: 'right_arrow'
property string textColor: Constants.colors.k
property QtObject color: QtObject {
property string normal: Constants.colors.g
property string hovered: Constants.colors.h
property string pressed: Constants.colors.i
property string selected: Constants.colors.j
}
}
}
...@@ -6,9 +6,11 @@ import Linphone 1.0 ...@@ -6,9 +6,11 @@ import Linphone 1.0
QtObject { QtObject {
property QtObject shadow: QtObject { property QtObject shadow: QtObject {
property double radius: 8.0 property double radius: 8.0
property int horizontalOffset: 0 property int horizontalOffset: 0
property int samples: 15 property int samples: 15
property int verticalOffset: 2 property int verticalOffset: 2
property string color: Constants.colors.f property string color: Constants.colors.f
} }
} }
...@@ -11,12 +11,14 @@ QtObject { ...@@ -11,12 +11,14 @@ QtObject {
property int leftMargin: 18 property int leftMargin: 18
property int spacing: 16 property int spacing: 16
property int topMargin: 10 property int topMargin: 10
property string color: Constants.colors.d property string color: Constants.colors.d
property string icon: 'history' property string icon: 'history'
} }
property QtObject separator: QtObject { property QtObject separator: QtObject {
property int height: 1 property int height: 1
property string color: Constants.colors.e property string color: Constants.colors.e
} }
} }
...@@ -3,9 +3,10 @@ ...@@ -3,9 +3,10 @@
module Linphone.Style module Linphone.Style
# Components styles. # Components styles.
singleton CollapseStyle 1.0 CollapseStyle.qml singleton CollapseStyle 1.0 CollapseStyle.qml
singleton DialogStyle 1.0 DialogStyle.qml singleton DialogStyle 1.0 DialogStyle.qml
singleton ForceScrollBarStyle 1.0 ForceScrollBarStyle.qml singleton ForceScrollBarStyle 1.0 ForceScrollBarStyle.qml
singleton PopupStyle 1.0 PopupStyle.qml singleton MenuStyle 1.0 MenuStyle.qml
singleton SearchBoxStyle 1.0 SearchBoxStyle.qml singleton PopupStyle 1.0 PopupStyle.qml
singleton TimelineStyle 1.0 TimelineStyle.qml singleton SearchBoxStyle 1.0 SearchBoxStyle.qml
singleton TimelineStyle 1.0 TimelineStyle.qml
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