diff --git a/applets/mediaframe/package/contents/ui/ConfigGeneral.qml b/applets/mediaframe/package/contents/ui/ConfigGeneral.qml index c4600a655..2f1e685d3 100644 --- a/applets/mediaframe/package/contents/ui/ConfigGeneral.qml +++ b/applets/mediaframe/package/contents/ui/ConfigGeneral.qml @@ -1,185 +1,179 @@ /* * Copyright 2015 Lars Pontoppidan * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. */ import QtQuick 2.7 import QtQuick.Controls 1.5 import QtQuick.Layouts 1.1 ColumnLayout { id: root property alias cfg_interval: intervalSpinBox.value property alias cfg_randomize: randomizeCheckBox.checked property alias cfg_pauseOnMouseOver: pauseOnMouseOverCheckBox.checked property alias cfg_useBackground: useBackgroundCheckBox.checked property alias cfg_leftClickOpenImage: leftClickOpenImageCheckBox.checked //property alias cfg_showCountdown: showCountdownCheckBox.checked property alias cfg_fillMode: root.fillMode /* * Image.Stretch - the image is scaled to fit * Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping * Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary * Image.Tile - the image is duplicated horizontally and vertically * Image.TileVertically - the image is stretched horizontally and tiled vertically * Image.TileHorizontally - the image is stretched vertically and tiled horizontally * Image.Pad - the image is not transformed */ property int fillMode: Image.PreserveAspectFit GridLayout { columns: 2 Label { Layout.row: 0 Layout.column: 0 Layout.alignment: Qt.AlignRight text: i18n("Change picture every") } SpinBox { id: intervalSpinBox Layout.row: 0 Layout.column: 1 suffix: i18n("s") decimals: 1 // Once a day should be high enough maximumValue: 24*(60*60) } // end SpinBox Label { id: fillLabel Layout.row: 1 Layout.column: 0 Layout.alignment: Qt.AlignRight text: i18n("Fill mode:") } ComboBox { id: comboBox Layout.row: 1 Layout.column: 1 width: units.gridUnit * 10 currentIndex: fillModeToIndex(fillMode) model: [ { text: i18n("Stretch"), + description: i18n("The image is scaled to fit the frame"), value: Image.Stretch }, { text: i18n("Preserve aspect fit"), + description: i18n("The image is scaled uniformly to fit without cropping"), value: Image.PreserveAspectFit }, { text: i18n("Preserve aspect crop"), + description: i18n("The image is scaled uniformly to fill, cropping if necessary"), value: Image.PreserveAspectCrop }, { text: i18n("Tile"), + description: i18n("The image is duplicated horizontally and vertically"), value: Image.Tile }, { text: i18n("Tile vertically"), + description: i18n("The image is stretched horizontally and tiled vertically"), value: Image.TileVertically }, { text: i18n("Tile horizontally"), + description: i18n("The image is stretched vertically and tiled horizontally"), value: Image.TileHorizontally }, { text: i18n("Pad"), + description: i18n("The image is not transformed"), value: Image.Pad } ] // end of ComboBox model - onCurrentIndexChanged: { - root.fillMode = comboBox.currentIndex - fillModeToIndex(root.fillMode) - //console.log(comboBox.currentIndex); - } - + onActivated: root.fillMode = comboBox.model[index].value function fillModeToIndex(fillMode) { - //console.log("function called"); if(fillMode == Image.Stretch) { - fillModeDescription.text = i18n( "The image is scaled to fit the frame"); return 0 } else if(fillMode == Image.PreserveAspectFit) { - fillModeDescription.text = i18n("The image is scaled uniformly to fit without cropping"); return 1 } else if(fillMode == Image.PreserveAspectCrop) { - fillModeDescription.text = i18n( "The image is scaled uniformly to fill, cropping if necessary"); return 2 } else if(fillMode == Image.Tile) { - fillModeDescription.text = i18n("The image is duplicated horizontally and vertically"); return 3 } else if(fillMode == Image.TileVertically) { - fillModeDescription.text = i18n("The image is stretched horizontally and tiled vertically"); return 4 } else if(fillMode == Image.TileHorizontally) { - fillModeDescription.text = i18n("The image is stretched vertically and tiled horizontally"); return 5 } else if(fillMode == Image.Pad) { - fillModeDescription.text = i18n("The image is not transformed"); return 6 } } // end of fillModeToIndex function } // end of ComboBox and related functions Label { id: fillModeDescription Layout.row: 2 Layout.column: 1 Layout.fillWidth: true elide: Text.ElideRight - text: i18n("The image is scaled uniformly to fit without cropping") + text: comboBox.model[comboBox.currentIndex] ? comboBox.model[comboBox.currentIndex].description : "" } } // end of top section GridLayout // these CheckBoxes should take over as their own ColumnLayout entries CheckBox { id: randomizeCheckBox text: i18n("Randomize items") } CheckBox { id: pauseOnMouseOverCheckBox text: i18n("Pause on mouseover") } CheckBox { id: useBackgroundCheckBox text: i18n("Background frame") } CheckBox { id: leftClickOpenImageCheckBox text: i18n("Left click image opens in external viewer") } Item { // tighten layout Layout.fillHeight: true } } // end ColumnLayout diff --git a/applets/notes/package/contents/ui/configAppearance.qml b/applets/notes/package/contents/ui/configAppearance.qml index e16da98ce..e0b4a625a 100644 --- a/applets/notes/package/contents/ui/configAppearance.qml +++ b/applets/notes/package/contents/ui/configAppearance.qml @@ -1,126 +1,124 @@ /* * Copyright 2015 Kai Uwe Broulik * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * 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. * * You should have received a copy of the GNU General Public License * along with this program. If not, see */ import QtQuick 2.0 import QtQuick.Controls 1.3 as QtControls import QtQuick.Layouts 1.1 as QtLayouts import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.private.notifications 1.0 - QtLayouts.ColumnLayout { id: appearancePage property string cfg_color PlasmaCore.Svg { id: noteSvg imagePath: "widgets/notes" } SystemPalette { id: syspal } QtControls.ScrollView { id: notesView QtLayouts.Layout.fillWidth: true QtLayouts.Layout.fillHeight: true frameVisible: true verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn // otherwise we get stuck in a re-layout loop horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff GridView { id: notesGrid width: notesView.width height: notesView.height cacheBuffer: 2000 // sometimes GridView gets confused and layouts items *somewhere* cellWidth: Math.floor(notesView.viewport.width / 3) cellHeight: cellWidth model: ["white", "black", "red", "orange", "yellow", "green", "blue", "pink", "translucent"] currentIndex: model.indexOf(cfg_color) onCurrentIndexChanged: cfg_color = model[currentIndex] highlight: Rectangle { color: syspal.highlight } highlightMoveDuration: 0 delegate: MouseArea { width: notesGrid.cellWidth height: notesGrid.cellHeight hoverEnabled: true onClicked: notesGrid.currentIndex = index Rectangle { anchors.fill: parent color: syspal.highlight opacity: 0.5 visible: parent.containsMouse } PlasmaCore.SvgItem { anchors { fill: parent margins: units.gridUnit / 2 } svg: noteSvg elementId: modelData + "-notes" PlasmaComponents.Label { anchors { fill: parent //this isn't a frameSVG, the default SVG margins take up around 7% of the frame size, so we use that margins: parent.width * 0.07 } horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter wrapMode: Text.WordWrap elide: Text.ElideRight text: { switch (modelData) { case "white": return i18n("A white sticky note") case "black": return i18n("A black sticky note") case "red": return i18n("A red sticky note") case "orange": return i18n("An orange sticky note") case "yellow": return i18n("A yellow sticky note") case "green": return i18n("A green sticky note") case "blue": return i18n("A blue sticky note") case "pink": return i18n("A pink sticky note") case "translucent": return i18n("A translucent sticky note") } } //this is deliberately _NOT_ the theme color as we are over a known bright background //an unknown colour over a known colour is a bad move as you end up with white on yellow color: { if (modelData === "black") { return "#dfdfdf" } else { return "#202020" } } } } } } } }