From f5807df91c4031263d6015ab97880271973b8fe5 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 21 Mar 2022 18:56:48 +0100 Subject: [PATCH] add a container for styling constants, so we don't repeat literals all over the code --- electrum/gui/qml/components/Constants.qml | 16 ++++++++++++++++ electrum/gui/qml/components/main.qml | 2 ++ 2 files changed, 18 insertions(+) create mode 100644 electrum/gui/qml/components/Constants.qml diff --git a/electrum/gui/qml/components/Constants.qml b/electrum/gui/qml/components/Constants.qml new file mode 100644 index 000000000..3acad5be4 --- /dev/null +++ b/electrum/gui/qml/components/Constants.qml @@ -0,0 +1,16 @@ +import QtQuick 2.6 +import QtQuick.Controls.Material 2.0 + +QtObject { + readonly property int paddingSmall: 8 + readonly property int paddingMedium: 12 + readonly property int paddingLarge: 16 + readonly property int paddingXLarge: 20 + + readonly property int fontSizeXSmall: 10 + readonly property int fontSizeSmall: 12 + readonly property int fontSizeMedium: 15 + readonly property int fontSizeLarge: 18 + readonly property int fontSizeXLarge: 22 + readonly property int fontSizeXXLarge: 28 +} diff --git a/electrum/gui/qml/components/main.qml b/electrum/gui/qml/components/main.qml index 2f9bdaa64..32db41366 100644 --- a/electrum/gui/qml/components/main.qml +++ b/electrum/gui/qml/components/main.qml @@ -19,6 +19,8 @@ ApplicationWindow Material.primary: Material.Indigo Material.accent: Material.LightBlue + property QtObject constants: Constants {} + property alias stack: mainStackView header: ToolBar {