aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/appearance/SunsetModule.qml
blob: 245094426645b39a34832373b7f620da7a2ba171 (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
// Copyright (C) 2026 Danilo M. <danix@danix.xyz>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2 as
// published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

import QtQuick
import "../.."

// hyprsunset's profiles and location.
Module {
    name: "sunset"
    label: "HyprSunset"
    // nf-fa-moon_o, present in Inconsolata Nerd Font.
    icon: "\uf186"
    settings: true
    dirty: Hyprsunset.dirty
    group: "Desktop"
    keywords: ["hyprsunset", "night", "light", "temperature", "gamma", "location", "profile"]

    // Not over unsaved edits: the reload would drop them.
    function refresh() { if (!Hyprsunset.dirty) Hyprsunset.refresh(); }

    page: Component {
        Page {
            title: "HyprSunset"
            actions: Component {
                SaveBar { saveText: "Save + Restart"; dirty: Hyprsunset.dirty
                          notice: Hyprsunset.saveNotice; error: Hyprsunset.saveError
                          onSave: Hyprsunset.save(); onDiscard: Hyprsunset.refresh() }
            }
            SunsetTab { width: parent.width }
        }
    }
}