~om26er/ubuntu-system-settings/test_ci

« back to all changes in this revision

Viewing changes to plugins/brightness/PageComponent.qml

  • Committer: CI bot
  • Author(s): Iain Lane
  • Date: 2014-02-06 15:47:27 UTC
  • mfrom: (575.1.20 brightness-panel)
  • Revision ID: ps-jenkins@lists.canonical.com-20140206154727-5jb0hso0uu8dnutq
Add the brightness panel Fixes: 1275699

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * This file is part of system-settings
 
3
 *
 
4
 * Copyright (C) 2013-14 Canonical Ltd.
 
5
 *
 
6
 * Contact: Iain Lane <iain.lane@canonical.com>
 
7
 *
 
8
 * This program is free software: you can redistribute it and/or modify it
 
9
 * under the terms of the GNU General Public License version 3, as published
 
10
 * by the Free Software Foundation.
 
11
 *
 
12
 * This program is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
14
 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
 
15
 * PURPOSE.  See the GNU General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU General Public License along
 
18
 * with this program.  If not, see <http://www.gnu.org/licenses/>.
 
19
 */
 
20
 
 
21
import GSettings 1.0
 
22
import QtQuick 2.0
 
23
import SystemSettings 1.0
 
24
import Ubuntu.Components 0.1
 
25
import Ubuntu.Components.ListItems 0.1 as ListItem
 
26
import Ubuntu.SystemSettings.Brightness 1.0
 
27
 
 
28
ItemPage {
 
29
    id: root
 
30
    objectName: "brightnessPage"
 
31
 
 
32
    title: i18n.tr("Brightness")
 
33
 
 
34
    UbuntuBrightnessPanel {
 
35
        id: brightnessPanel
 
36
    }
 
37
 
 
38
    Column {
 
39
        anchors.left: parent.left
 
40
        anchors.right: parent.right
 
41
 
 
42
        BrightnessSlider {}
 
43
 
 
44
        Binding {
 
45
            target: autoAdjustCheck
 
46
            property: "checked"
 
47
            value: adjust.visible && gsettings.autoBrightness
 
48
        }
 
49
 
 
50
        ListItem.Standard {
 
51
            id: adjust
 
52
            text: i18n.tr("Adjust automatically")
 
53
            visible: brightnessPanel.powerdRunning &&
 
54
                     brightnessPanel.autoBrightnessAvailable
 
55
            control: CheckBox {
 
56
                id: autoAdjustCheck
 
57
                checked: gsettings.autoBrightness
 
58
                onClicked: gsettings.autoBrightness = checked
 
59
            }
 
60
            Component.onCompleted: clicked.connect(autoAdjustCheck.clicked)
 
61
            showDivider: false
 
62
        }
 
63
        ListItem.Caption {
 
64
            text: i18n.tr(
 
65
                    "Brightens and dims the display to suit the surroundings")
 
66
            visible: adjust.visible
 
67
        }
 
68
    }
 
69
 
 
70
    GSettings {
 
71
        id: gsettings
 
72
        schema.id: "com.ubuntu.touch.system"
 
73
    }
 
74
}