Commit 8a2a2bde authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Main/MainWindowMenuBar): style done

parent c9d27e37
......@@ -428,6 +428,22 @@ Server url not configured.</translation>
<source>about</source>
<translation>About</translation>
</message>
<message>
<source>checkForUpdates</source>
<translation>Check for updates</translation>
</message>
<message>
<source>quit</source>
<translation>Quit</translation>
</message>
<message>
<source>importContacts</source>
<translation>Import contacts from vCards</translation>
</message>
<message>
<source>exportContacts</source>
<translation>Export contacts as vCards</translation>
</message>
</context>
<context>
<name>ManageAccounts</name>
......
......@@ -427,6 +427,22 @@ Url du serveur non configurée.</translation>
<source>about</source>
<translation>À propos</translation>
</message>
<message>
<source>checkForUpdates</source>
<translation>Vérifier les mises à jour</translation>
</message>
<message>
<source>quit</source>
<translation>Quitter</translation>
</message>
<message>
<source>importContacts</source>
<translation>Importer des contacts depuis des vCards</translation>
</message>
<message>
<source>exportContacts</source>
<translation>Exporter des contacts sous forme de vCards</translation>
</message>
</context>
<context>
<name>ManageAccounts</name>
......
......@@ -319,6 +319,7 @@
<file>ui/views/App/Styles/Main/ContactEditStyle.qml</file>
<file>ui/views/App/Styles/Main/ContactsStyle.qml</file>
<file>ui/views/App/Styles/Main/ConversationStyle.qml</file>
<file>ui/views/App/Styles/Main/MainWindowMenuBarStyle.qml</file>
<file>ui/views/App/Styles/Main/MainWindowStyle.qml</file>
<file>ui/views/App/Styles/qmldir</file>
<file>ui/views/App/Styles/Settings/SettingsWindowStyle.qml</file>
......
......@@ -2,27 +2,80 @@ import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import Common 1.0 as Common
import App.Styles 1.0
// ============================================================================
MenuBar {
style: MenuBarStyle {
background: Rectangle {
anchors.fill: parent
color: '#E8E8E7'
color: MainWindowMenuBarStyle.color
Rectangle {
anchors.bottom: parent.bottom
color: MainWindowMenuBarStyle.separator.color
height: MainWindowMenuBarStyle.separator.height
width: parent.width
}
}
itemDelegate: Rectangle {
implicitHeight: text.height + 8
implicitWidth: text.width + 18
color: 'transparent'
menuStyle: MenuStyle {
frame: Item {}
itemDelegate {
background: Rectangle {
color: (styleData.selected || styleData.open)
? MainWindowMenuBarStyle.subMenu.color.selected
: MainWindowMenuBarStyle.subMenu.color.normal
}
label: Label {
color: styleData.selected
? MainWindowMenuBarStyle.subMenu.text.color.selected
: MainWindowMenuBarStyle.subMenu.text.color.normal
text: styleData.text
}
shortcut: Label {
color: styleData.selected
? MainWindowMenuBarStyle.subMenu.text.color.selected
: MainWindowMenuBarStyle.subMenu.text.color.normal
text: styleData.shortcut
}
}
}
itemDelegate: Item {
implicitHeight: menuItem.height + MainWindowMenuBarStyle.separator.spacing
implicitWidth: menuItem.width
Item {
id: menuItem
Text {
id: text
implicitHeight: text.height + MainWindowMenuBarStyle.menu.text.verticalMargins * 2
implicitWidth: text.width + MainWindowMenuBarStyle.menu.text.horizontalMargins * 2
anchors.centerIn: parent
font: root.font
text: formatMnemonic(styleData.text, styleData.underlineMnemonic)
color: styleData.open ? '#FE5E00' : '#515557'
Text {
id: text
anchors.centerIn: parent
color: styleData.open
? MainWindowMenuBarStyle.menu.text.color.selected
: MainWindowMenuBarStyle.menu.text.color.normal
text: formatMnemonic(styleData.text, styleData.underlineMnemonic)
}
Rectangle {
anchors.bottom: parent.bottom
color: MainWindowMenuBarStyle.menu.indicator.color
visible: styleData.open
height: MainWindowMenuBarStyle.menu.indicator.height
width: parent.width
}
}
}
}
......@@ -33,8 +86,16 @@ import QtQuick.Controls.Styles 1.4
title: qsTr('options')
MenuItem {
shortcut: 'Ctrl+P'
text: qsTr('settings')
}
MenuSeparator {}
MenuItem {
shortcut: StandardKey.Quit
text: qsTr('quit')
}
}
Menu {
......@@ -51,6 +112,17 @@ import QtQuick.Controls.Styles 1.4
MenuSeparator {}
MenuItem {
text: qsTr('importContacts')
}
MenuItem {
text: qsTr('exportContacts')
}
MenuSeparator {}
MenuItem {
shortcut: 'Ctrl+D'
text: qsTr('debugWindow')
}
}
......@@ -59,8 +131,14 @@ import QtQuick.Controls.Styles 1.4
title: qsTr('help')
MenuItem {
shortcut: StandardKey.HelpContents
text: qsTr('about')
}
}
MenuSeparator {}
MenuItem {
text: qsTr('checkForUpdates')
}
}
}
pragma Singleton
import QtQuick 2.7
import Common 1.0
// =============================================================================
QtObject {
property color color: Colors.v
property QtObject menu: QtObject {
property QtObject text: QtObject {
property int horizontalMargins: 9
property int verticalMargins: 4
property QtObject color: QtObject {
property color selected: Colors.i
property color normal: Colors.b
}
}
property QtObject indicator: QtObject {
property color color: Colors.i
property int height: 2
}
}
property QtObject separator: QtObject {
property color color: Colors.u
property int height: 1
property int spacing: 4
}
property QtObject subMenu: QtObject {
property QtObject color: QtObject {
property color selected: Colors.i
property color normal: Colors.k
}
property QtObject text: QtObject {
property QtObject color: QtObject {
property color selected: Colors.k
property color normal: Colors.b
}
}
}
}
......@@ -7,9 +7,10 @@ module App.Styles
singleton CallStyle 1.0 Calls/CallStyle.qml
singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qml
singleton ContactEditStyle 1.0 Main/ContactEditStyle.qml
singleton ContactsStyle 1.0 Main/ContactsStyle.qml
singleton ConversationStyle 1.0 Main/ConversationStyle.qml
singleton MainWindowStyle 1.0 Main/MainWindowStyle.qml
singleton ContactEditStyle 1.0 Main/ContactEditStyle.qml
singleton ContactsStyle 1.0 Main/ContactsStyle.qml
singleton ConversationStyle 1.0 Main/ConversationStyle.qml
singleton MainWindowMenuBarStyle 1.0 Main/MainWindowMenuBarStyle.qml
singleton MainWindowStyle 1.0 Main/MainWindowStyle.qml
singleton SettingsWindowStyle 1.0 Settings/SettingsWindowStyle.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