Commit 3c9afa3d authored by Ronan Abhamon's avatar Ronan Abhamon

fix(app): fix font size on miscellaneous components

parent dd4b5859
...@@ -347,7 +347,7 @@ Url du serveur non configurée.</translation> ...@@ -347,7 +347,7 @@ Url du serveur non configurée.</translation>
</message> </message>
<message> <message>
<source>codecStatus</source> <source>codecStatus</source>
<translation>status</translation> <translation>Status</translation>
</message> </message>
</context> </context>
<context> <context>
......
...@@ -87,7 +87,7 @@ int main (int argc, char *argv[]) { ...@@ -87,7 +87,7 @@ int main (int argc, char *argv[]) {
if (info.suffix() == "ttf") { if (info.suffix() == "ttf") {
QString path = info.absoluteFilePath(); QString path = info.absoluteFilePath();
if (path.startsWith(":/assets/fonts/")) if (path.startsWith(":/assets/fonts/"))
qDebug() << QFontDatabase::addApplicationFont(path); QFontDatabase::addApplicationFont(path);
} }
} }
......
...@@ -30,6 +30,7 @@ CheckBox { ...@@ -30,6 +30,7 @@ CheckBox {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
font.pointSize: CheckBoxTextStyle.fontSize
hoverEnabled: true hoverEnabled: true
indicator: Rectangle { indicator: Rectangle {
......
...@@ -6,6 +6,7 @@ import Common 1.0 ...@@ -6,6 +6,7 @@ import Common 1.0
// ============================================================================= // =============================================================================
QtObject { QtObject {
property int fontSize: 10
property int radius: 3 property int radius: 3
property int size: 18 property int size: 18
......
...@@ -7,160 +7,167 @@ import Linphone 1.0 ...@@ -7,160 +7,167 @@ import Linphone 1.0
import App.Styles 1.0 import App.Styles 1.0
// ============================================================================ // ============================================================================
MenuBar { MenuBar {
id: container id: container
// -------------------------------------------------------------------------- // --------------------------------------------------------------------------
property bool hide: false property bool hide: false
// --------------------------------------------------------------------------
// Workaround to hide toolbar.
// Use private properties of MenuBar.
__contentItem.height: hide
? 0
: MainWindowMenuBarStyle.height
__contentItem.transform: Scale {
yScale: Number(!hide)
}
// --------------------------------------------------------------------------
style: MenuBarStyle {
background: Rectangle {
color: MainWindowMenuBarStyle.color
Rectangle {
anchors.bottom: parent.bottom
color: MainWindowMenuBarStyle.separator.color
height: MainWindowMenuBarStyle.separator.height
width: parent.width
}
}
menuStyle: MenuStyle {
frame: Item {}
itemDelegate { // --------------------------------------------------------------------------
background: Rectangle {
color: (styleData.selected || styleData.open)
? MainWindowMenuBarStyle.subMenu.color.selected
: MainWindowMenuBarStyle.subMenu.color.normal
}
label: Label { // Workaround to hide toolbar.
color: styleData.selected // Use private properties of MenuBar.
? MainWindowMenuBarStyle.subMenu.text.color.selected
: MainWindowMenuBarStyle.subMenu.text.color.normal
text: styleData.text
}
shortcut: Label { __contentItem.height: hide
color: styleData.selected ? 0
? MainWindowMenuBarStyle.subMenu.text.color.selected : MainWindowMenuBarStyle.height
: MainWindowMenuBarStyle.subMenu.text.color.normal
text: styleData.shortcut __contentItem.transform: Scale {
} yScale: Number(!hide)
} }
}
// --------------------------------------------------------------------------
itemDelegate: Item {
implicitHeight: menuItem.height + MainWindowMenuBarStyle.separator.spacing style: MenuBarStyle {
implicitWidth: menuItem.width background: Rectangle {
color: MainWindowMenuBarStyle.color
Item {
id: menuItem Rectangle {
anchors.bottom: parent.bottom
implicitHeight: text.height + MainWindowMenuBarStyle.menu.text.verticalMargins * 2 color: MainWindowMenuBarStyle.separator.color
implicitWidth: text.width + MainWindowMenuBarStyle.menu.text.horizontalMargins * 2 height: MainWindowMenuBarStyle.separator.height
width: parent.width
Text { }
id: text }
anchors.centerIn: parent menuStyle: MenuStyle {
color: styleData.open id: menuStyle
? MainWindowMenuBarStyle.menu.text.color.selected
: MainWindowMenuBarStyle.menu.text.color.normal font.pointSize: MainWindowMenuBarStyle.subMenu.text.fontSize
text: formatMnemonic(styleData.text, styleData.underlineMnemonic) frame: Item {}
}
itemDelegate {
Rectangle { background: Rectangle {
anchors.bottom: parent.bottom color: (styleData.selected || styleData.open)
color: MainWindowMenuBarStyle.menu.indicator.color ? MainWindowMenuBarStyle.subMenu.color.selected
visible: styleData.open : MainWindowMenuBarStyle.subMenu.color.normal
}
height: MainWindowMenuBarStyle.menu.indicator.height
width: parent.width label: Label {
} color: styleData.selected
} ? MainWindowMenuBarStyle.subMenu.text.color.selected
} : MainWindowMenuBarStyle.subMenu.text.color.normal
} font: menuStyle.font
text: styleData.text
// -------------------------------------------------------------------------- }
Menu { shortcut: Label {
title: qsTr('options') color: styleData.selected
? MainWindowMenuBarStyle.subMenu.text.color.selected
MenuItem { : MainWindowMenuBarStyle.subMenu.text.color.normal
shortcut: 'Ctrl+P' font: menuStyle.font
text: qsTr('settings') text: styleData.shortcut
}
onTriggered: { }
var window = App.getSettingsWindow() }
if (window.visibility === Window.Minimized) {
window.visibility = Window.AutomaticVisibility itemDelegate: Item {
} else { implicitHeight: menuItem.height + MainWindowMenuBarStyle.separator.spacing
window.setVisible(true) implicitWidth: menuItem.width
}
} Item {
} id: menuItem
MenuSeparator {} implicitHeight: text.height + MainWindowMenuBarStyle.menu.text.verticalMargins * 2
implicitWidth: text.width + MainWindowMenuBarStyle.menu.text.horizontalMargins * 2
MenuItem {
shortcut: StandardKey.Quit Text {
text: qsTr('quit') id: text
onTriggered: Qt.quit() anchors.centerIn: parent
} color: styleData.open
} ? MainWindowMenuBarStyle.menu.text.color.selected
: MainWindowMenuBarStyle.menu.text.color.normal
Menu {
title: qsTr('tools') font.pointSize: MainWindowMenuBarStyle.menu.text.fontSize
text: formatMnemonic(styleData.text, styleData.underlineMnemonic)
MenuItem { }
text: qsTr('audioAssistant')
} Rectangle {
anchors.bottom: parent.bottom
MenuSeparator {} color: MainWindowMenuBarStyle.menu.indicator.color
visible: styleData.open
MenuItem {
text: qsTr('importContacts') height: MainWindowMenuBarStyle.menu.indicator.height
} width: parent.width
}
MenuItem { }
text: qsTr('exportContacts') }
} }
}
// --------------------------------------------------------------------------
Menu {
title: qsTr('help') Menu {
title: qsTr('options')
MenuItem {
shortcut: StandardKey.HelpContents MenuItem {
text: qsTr('about') shortcut: 'Ctrl+P'
} text: qsTr('settings')
MenuSeparator {} onTriggered: {
var window = App.getSettingsWindow()
MenuItem { if (window.visibility === Window.Minimized) {
text: qsTr('checkForUpdates') window.visibility = Window.AutomaticVisibility
} } else {
} window.setVisible(true)
} }
}
}
MenuSeparator {}
MenuItem {
shortcut: StandardKey.Quit
text: qsTr('quit')
onTriggered: Qt.quit()
}
}
Menu {
title: qsTr('tools')
MenuItem {
text: qsTr('audioAssistant')
}
MenuSeparator {}
MenuItem {
text: qsTr('importContacts')
}
MenuItem {
text: qsTr('exportContacts')
}
}
Menu {
title: qsTr('help')
MenuItem {
shortcut: StandardKey.HelpContents
text: qsTr('about')
}
MenuSeparator {}
MenuItem {
text: qsTr('checkForUpdates')
}
}
}
...@@ -20,7 +20,7 @@ QtObject { ...@@ -20,7 +20,7 @@ QtObject {
property QtObject description: QtObject { property QtObject description: QtObject {
property color color: Colors.g property color color: Colors.g
property int fontSize: 10 property int fontSize: 11
} }
property QtObject title: QtObject { property QtObject title: QtObject {
......
...@@ -48,7 +48,7 @@ QtObject { ...@@ -48,7 +48,7 @@ QtObject {
property QtObject username: QtObject { property QtObject username: QtObject {
property color color: Colors.j property color color: Colors.j
property int fontSize: 9 property int fontSize: 10
property int width: 220 property int width: 220
} }
} }
......
...@@ -11,6 +11,7 @@ QtObject { ...@@ -11,6 +11,7 @@ QtObject {
property QtObject menu: QtObject { property QtObject menu: QtObject {
property QtObject text: QtObject { property QtObject text: QtObject {
property int fontSize: 10
property int horizontalMargins: 9 property int horizontalMargins: 9
property int verticalMargins: 4 property int verticalMargins: 4
...@@ -39,6 +40,8 @@ QtObject { ...@@ -39,6 +40,8 @@ QtObject {
} }
property QtObject text: QtObject { property QtObject text: QtObject {
property int fontSize: 10
property QtObject color: QtObject { property QtObject color: QtObject {
property color selected: Colors.k property color selected: Colors.k
property color normal: Colors.b property color normal: Colors.b
......
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