summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/dms/Modules/ControlCenter/Components/Typography.qml
blob: f3e554f0d63354b6cf5d70a7729b32121f82de46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import QtQuick
import qs.Common
import qs.Widgets

StyledText {
    id: root

    enum Style {
        Title,
        Subtitle,
        Body,
        Caption,
        Button
    }

    property int style: Typography.Style.Body

    font.pixelSize: {
        switch (style) {
        case Typography.Style.Title: return Theme.fontSizeXLarge
        case Typography.Style.Subtitle: return Theme.fontSizeLarge
        case Typography.Style.Body: return Theme.fontSizeMedium
        case Typography.Style.Caption: return Theme.fontSizeSmall
        case Typography.Style.Button: return Theme.fontSizeSmall
        default: return Theme.fontSizeMedium
        }
    }

    font.weight: {
        switch (style) {
        case Typography.Style.Title: return Font.Bold
        case Typography.Style.Subtitle: return Font.Medium
        case Typography.Style.Body: return Font.Normal
        case Typography.Style.Caption: return Font.Normal
        case Typography.Style.Button: return Font.Medium
        default: return Font.Normal
        }
    }

    color: {
        switch (style) {
        case Typography.Style.Caption: return Theme.surfaceVariantText
        default: return Theme.surfaceText
        }
    }
}