Changeset View
Changeset View
Standalone View
Standalone View
wallpapers/potd/contents/ui/config.qml
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 53 | Component.onCompleted: { | |||
---|---|---|---|---|---|
60 | } | 60 | } | ||
61 | } | 61 | } | ||
62 | 62 | | |||
63 | Row { | 63 | Row { | ||
64 | spacing: units.largeSpacing / 2 | 64 | spacing: units.largeSpacing / 2 | ||
65 | QtControls.Label { | 65 | QtControls.Label { | ||
66 | width: formAlignment - units.largeSpacing | 66 | width: formAlignment - units.largeSpacing | ||
67 | horizontalAlignment: Text.AlignRight | 67 | horizontalAlignment: Text.AlignRight | ||
68 | text: i18nd("plasma_applet_org.kde.potd", "Providers:") | 68 | text: i18nd("plasma_wallpaper_org.kde.potd", "Providers:") | ||
69 | anchors.verticalCenter: providerComboBox.verticalCenter | 69 | anchors.verticalCenter: providerComboBox.verticalCenter | ||
70 | } | 70 | } | ||
71 | QtControls.ComboBox { | 71 | QtControls.ComboBox { | ||
72 | id: providerComboBox | 72 | id: providerComboBox | ||
73 | property int textLength: 24 | 73 | property int textLength: 24 | ||
74 | width: theme.mSize(theme.defaultFont).width * textLength | 74 | width: theme.mSize(theme.defaultFont).width * textLength | ||
75 | model: providerModel | 75 | model: providerModel | ||
76 | textRole: "name" | 76 | textRole: "name" | ||
77 | onCurrentIndexChanged: { | 77 | onCurrentIndexChanged: { | ||
78 | cfg_Provider = providerModel.get(currentIndex)["id"] | 78 | cfg_Provider = providerModel.get(currentIndex)["id"] | ||
79 | } | 79 | } | ||
80 | } | 80 | } | ||
81 | } | 81 | } | ||
82 | 82 | | |||
83 | Row { | 83 | Row { | ||
84 | //x: formAlignment - positionLabel.paintedWidth | 84 | //x: formAlignment - positionLabel.paintedWidth | ||
85 | spacing: units.largeSpacing / 2 | 85 | spacing: units.largeSpacing / 2 | ||
86 | QtControls.Label { | 86 | QtControls.Label { | ||
87 | id: positionLabel | 87 | id: positionLabel | ||
88 | width: formAlignment - units.largeSpacing | 88 | width: formAlignment - units.largeSpacing | ||
89 | anchors { | 89 | anchors { | ||
90 | verticalCenter: resizeComboBox.verticalCenter | 90 | verticalCenter: resizeComboBox.verticalCenter | ||
91 | } | 91 | } | ||
92 | text: i18nd("plasma_applet_org.kde.potd", "Positioning:") | 92 | text: i18nd("plasma_wallpaper_org.kde.potd", "Positioning:") | ||
93 | horizontalAlignment: Text.AlignRight | 93 | horizontalAlignment: Text.AlignRight | ||
94 | } | 94 | } | ||
95 | QtControls.ComboBox { | 95 | QtControls.ComboBox { | ||
96 | id: resizeComboBox | 96 | id: resizeComboBox | ||
97 | property int textLength: 24 | 97 | property int textLength: 24 | ||
98 | width: theme.mSize(theme.defaultFont).width * textLength | 98 | width: theme.mSize(theme.defaultFont).width * textLength | ||
99 | model: [ | 99 | model: [ | ||
100 | { | 100 | { | ||
101 | 'label': i18nd("plasma_applet_org.kde.potd", "Scaled and Cropped"), | 101 | 'label': i18nd("plasma_wallpaper_org.kde.potd", "Scaled and Cropped"), | ||
102 | 'fillMode': Image.PreserveAspectCrop | 102 | 'fillMode': Image.PreserveAspectCrop | ||
103 | }, | 103 | }, | ||
104 | { | 104 | { | ||
105 | 'label': i18nd("plasma_applet_org.kde.potd","Scaled"), | 105 | 'label': i18nd("plasma_wallpaper_org.kde.potd", "Scaled"), | ||
106 | 'fillMode': Image.Stretch | 106 | 'fillMode': Image.Stretch | ||
107 | }, | 107 | }, | ||
108 | { | 108 | { | ||
109 | 'label': i18nd("plasma_applet_org.kde.potd","Scaled, Keep Proportions"), | 109 | 'label': i18nd("plasma_wallpaper_org.kde.potd", "Scaled, Keep Proportions"), | ||
110 | 'fillMode': Image.PreserveAspectFit | 110 | 'fillMode': Image.PreserveAspectFit | ||
111 | }, | 111 | }, | ||
112 | { | 112 | { | ||
113 | 'label': i18nd("plasma_applet_org.kde.potd", "Centered"), | 113 | 'label': i18nd("plasma_wallpaper_org.kde.potd", "Centered"), | ||
114 | 'fillMode': Image.Pad | 114 | 'fillMode': Image.Pad | ||
115 | }, | 115 | }, | ||
116 | { | 116 | { | ||
117 | 'label': i18nd("plasma_applet_org.kde.potd","Tiled"), | 117 | 'label': i18nd("plasma_wallpaper_org.kde.potd", "Tiled"), | ||
118 | 'fillMode': Image.Tile | 118 | 'fillMode': Image.Tile | ||
119 | } | 119 | } | ||
120 | ] | 120 | ] | ||
121 | 121 | | |||
122 | textRole: "label" | 122 | textRole: "label" | ||
123 | onCurrentIndexChanged: cfg_FillMode = model[currentIndex]["fillMode"] | 123 | onCurrentIndexChanged: cfg_FillMode = model[currentIndex]["fillMode"] | ||
124 | Component.onCompleted: setMethod(); | 124 | Component.onCompleted: setMethod(); | ||
125 | 125 | | |||
126 | function setMethod() { | 126 | function setMethod() { | ||
127 | for (var i = 0; i < model.length; i++) { | 127 | for (var i = 0; i < model.length; i++) { | ||
128 | if (model[i]["fillMode"] == wallpaper.configuration.FillMode) { | 128 | if (model[i]["fillMode"] == wallpaper.configuration.FillMode) { | ||
129 | resizeComboBox.currentIndex = i; | 129 | resizeComboBox.currentIndex = i; | ||
130 | var tl = model[i]["label"].length; | 130 | var tl = model[i]["label"].length; | ||
131 | } | 131 | } | ||
132 | } | 132 | } | ||
133 | } | 133 | } | ||
134 | } | 134 | } | ||
135 | } | 135 | } | ||
136 | 136 | | |||
137 | QtDialogs.ColorDialog { | 137 | QtDialogs.ColorDialog { | ||
138 | id: colorDialog | 138 | id: colorDialog | ||
139 | modality: Qt.WindowModal | 139 | modality: Qt.WindowModal | ||
140 | showAlphaChannel: false | 140 | showAlphaChannel: false | ||
141 | title: i18nd("plasma_applet_org.kde.potd", "Select Background Color") | 141 | title: i18nd("plasma_wallpaper_org.kde.potd", "Select Background Color") | ||
142 | } | 142 | } | ||
143 | 143 | | |||
144 | Row { | 144 | Row { | ||
145 | id: colorRow | 145 | id: colorRow | ||
146 | spacing: units.largeSpacing / 2 | 146 | spacing: units.largeSpacing / 2 | ||
147 | QtControls.Label { | 147 | QtControls.Label { | ||
148 | width: formAlignment - units.largeSpacing | 148 | width: formAlignment - units.largeSpacing | ||
149 | anchors.verticalCenter: colorButton.verticalCenter | 149 | anchors.verticalCenter: colorButton.verticalCenter | ||
150 | horizontalAlignment: Text.AlignRight | 150 | horizontalAlignment: Text.AlignRight | ||
151 | text: i18nd("plasma_applet_org.kde.potd", "Background Color:") | 151 | text: i18nd("plasma_wallpaper_org.kde.potd", "Background Color:") | ||
152 | } | 152 | } | ||
153 | QtControls.Button { | 153 | QtControls.Button { | ||
154 | id: colorButton | 154 | id: colorButton | ||
155 | width: units.gridUnit * 3 | 155 | width: units.gridUnit * 3 | ||
156 | text: " " // needed to it gets a proper height... | 156 | text: " " // needed to it gets a proper height... | ||
157 | onClicked: colorDialog.open() | 157 | onClicked: colorDialog.open() | ||
158 | 158 | | |||
159 | Rectangle { | 159 | Rectangle { | ||
Show All 13 Lines |