diff --git a/applets/mediaframe/package/contents/ui/ConfigGeneral.qml b/applets/mediaframe/package/contents/ui/ConfigGeneral.qml --- a/applets/mediaframe/package/contents/ui/ConfigGeneral.qml +++ b/applets/mediaframe/package/contents/ui/ConfigGeneral.qml @@ -26,7 +26,7 @@ import org.kde.kquickcontrolsaddons 2.0 as KQuickAddons -Item { +ColumnLayout { id: root width: parent.width height: parent.height @@ -50,134 +50,131 @@ */ property int fillMode: Image.PreserveAspectFit - ColumnLayout { - - width: parent.width - height: parent.height - - RowLayout { - Layout.fillWidth: true + RowLayout { + Layout.fillWidth: true - Label { - text: i18n("Change picture every") - } + Label { + text: i18n("Change picture every") + } - SpinBox { + SpinBox { - id: intervalSpinBox + id: intervalSpinBox - suffix: i18n("s") - decimals: 1 + suffix: i18n("s") + decimals: 1 - // Once a day should be high enough - maximumValue: 24*(60*60) - } + // Once a day should be high enough + maximumValue: 24*(60*60) } + } - ColumnLayout { - RowLayout { - Layout.fillWidth: true + ColumnLayout { + RowLayout { + Layout.fillWidth: true - Label { - text: i18n("Fill mode:") - } + Label { + text: i18n("Fill mode:") + } - ComboBox { - id: comboBox - currentIndex: fillModeToIndex(fillMode) - model: - [ - { - "text": i18n("Stretch"), - "value": Image.Stretch, - "description": i18n("The image is scaled to fit") - }, - { - "text": i18n("Preserve aspect fit"), - "value": Image.PreserveAspectFit, - "description": i18n("The image is scaled uniformly to fit without cropping") - }, - { - "text": i18n("Preserve aspect crop"), - "value": Image.PreserveAspectCrop, - "description": i18n("The image is scaled uniformly to fill, cropping if necessary") - }, - { - "text": i18n("Tile"), - "value": Image.Tile, - "description": i18n("The image is duplicated horizontally and vertically") - }, - { - "text": i18n("Tile vertically"), - "value": Image.TileVertically, - "description": i18n("The image is stretched horizontally and tiled vertically") - }, - { - "text": i18n("Tile horizontally"), - "value": Image.TileHorizontally, - "description": i18n("The image is stretched vertically and tiled horizontally") - }, - { - "text": i18n("Pad"), - "value": Image.Pad, - "description": i18n("The image is not transformed") - } - ] - - onActivated: root.fillMode = comboBoxItems.get(index).value - - onCurrentIndexChanged: fillModeDescription.text = comboBoxItems.get(currentIndex).description - - function fillModeToIndex(fillMode) { - if(fillMode == Image.Stretch) - return 0 - else if(fillMode == Image.PreserveAspectFit) - return 1 - else if(fillMode == Image.PreserveAspectCrop) - return 2 - else if(fillMode == Image.Tile) - return 3 - else if(fillMode == Image.TileVertically) - return 4 - else if(fillMode == Image.TileHorizontally) - return 5 - else if(fillMode == Image.Pad) - return 6 - } + ComboBox { + id: comboBox + currentIndex: fillModeToIndex(fillMode) + model: + [ + { + "text": i18n("Stretch"), + "value": Image.Stretch, + "description": i18n("The image is scaled to fit") + }, + { + "text": i18n("Preserve aspect fit"), + "value": Image.PreserveAspectFit, + "description": i18n("The image is scaled uniformly to fit without cropping") + }, + { + "text": i18n("Preserve aspect crop"), + "value": Image.PreserveAspectCrop, + "description": i18n("The image is scaled uniformly to fill, cropping if necessary") + }, + { + "text": i18n("Tile"), + "value": Image.Tile, + "description": i18n("The image is duplicated horizontally and vertically") + }, + { + "text": i18n("Tile vertically"), + "value": Image.TileVertically, + "description": i18n("The image is stretched horizontally and tiled vertically") + }, + { + "text": i18n("Tile horizontally"), + "value": Image.TileHorizontally, + "description": i18n("The image is stretched vertically and tiled horizontally") + }, + { + "text": i18n("Pad"), + "value": Image.Pad, + "description": i18n("The image is not transformed") + } + ] + + onActivated: root.fillMode = comboBoxItems.get(index).value + + onCurrentIndexChanged: fillModeDescription.text = comboBoxItems.get(currentIndex).description + + function fillModeToIndex(fillMode) { + if(fillMode == Image.Stretch) + return 0 + else if(fillMode == Image.PreserveAspectFit) + return 1 + else if(fillMode == Image.PreserveAspectCrop) + return 2 + else if(fillMode == Image.Tile) + return 3 + else if(fillMode == Image.TileVertically) + return 4 + else if(fillMode == Image.TileHorizontally) + return 5 + else if(fillMode == Image.Pad) + return 6 } } - Label { - id: fillModeDescription - text: i18n("The image is scaled uniformly to fit without cropping") - } } - - CheckBox { - id: randomizeCheckBox - text: i18n("Randomize items") + Label { + id: fillModeDescription + text: i18n("The image is scaled uniformly to fit without cropping") } + } - CheckBox { - id: pauseOnMouseOverCheckBox - text: i18n("Pause on mouseover") - } + CheckBox { + id: randomizeCheckBox + text: i18n("Randomize items") + } - CheckBox { - id: useBackgroundCheckBox - text: i18n("Background frame") - } + CheckBox { + id: pauseOnMouseOverCheckBox + text: i18n("Pause on mouseover") + } - CheckBox { - id: leftClickOpenImageCheckBox - text: i18n("Left click image opens in external viewer") - } + CheckBox { + id: useBackgroundCheckBox + text: i18n("Background frame") + } - /* - CheckBox { - id: showCountdownCheckBox - text: i18n("Show countdown") - } - */ + CheckBox { + id: leftClickOpenImageCheckBox + text: i18n("Left click image opens in external viewer") + } + Item { + Layout.fillHeight: true + } + + /* + CheckBox { + id: showCountdownCheckBox + text: i18n("Show countdown") } + */ }