config ui simplified

v0.6
audoban 8 years ago
parent 4ab37d33ed
commit 0f7e41ab7e

@ -25,374 +25,281 @@ import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{ PlasmaComponents.Page {
width: dialog.width - 2*dialog.windowSpace Layout.maximumWidth: content.width + units.smallSpacing * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
property int pageHeight: mainColumn.height
ColumnLayout {
id: content
Column{ width: dialog.maxWidth
id:mainColumn spacing: units.largeSpacing
spacing: 1.5*theme.defaultFont.pointSize anchors.centerIn: parent
width: parent.width
//////////////// Applets Size //! BEGIN: Applet Size
Column{ ColumnLayout {
width:parent.width Layout.fillWidth: true
spacing: 0.8*theme.defaultFont.pointSize spacing: units.smallSpacing
Header{ Header {
text: i18n("Applets Size") text: i18n("Applets Size")
} }
RowLayout{ RowLayout {
width: parent.width Layout.fillWidth: true
spacing: units.smallSpacing
property int step: 8
PlasmaComponents.Slider{
id:appletsSizeSlider
valueIndicatorText: i18n("Applets Size")
valueIndicatorVisible: true
PlasmaComponents.Slider {
id: appletsSizeSlider
Layout.fillWidth: true
value: plasmoid.configuration.iconSize
minimumValue: 16 minimumValue: 16
maximumValue: 128 maximumValue: 128
stepSize: 8
stepSize: parent.step
function updateIconSize() {
Layout.fillWidth:true
property bool inStartup:true
property int tempValue: value
Component.onCompleted: {
value = plasmoid.configuration.iconSize;
inStartup = false;
}
onPressedChanged: {
if (!pressed) { if (!pressed) {
plasmoid.configuration.iconSize = value; if (panelSizeSlider.value > value + 4)
panelSizeSlider.value = value + 4
plasmoid.configuration.iconSize = value
} }
} }
onTempValueChanged:{ onPressedChanged: {
if(!inStartup && !pressed){ updateIconSize()
plasmoid.configuration.iconSize = value; }
}
Component.onCompleted: {
valueChanged.connect(updateIconSize)
} }
} }
PlasmaComponents.Label{ PlasmaComponents.Label {
text: appletsSizeSlider.value + " px." text: appletsSizeSlider.value + " px."
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 5
} }
} }
} }
//! END: Applet Size
/********** Zoom On Hover ****************/ //! BEGIN: Zoom On Hover
Column{ ColumnLayout {
width: parent.width Layout.fillWidth: true
spacing: 0.8*theme.defaultFont.pointSize spacing: units.smallSpacing
enabled: plasmoid.configuration.durationTime > 0 enabled: plasmoid.configuration.durationTime > 0
Header{
Header {
text: i18n("Zoom On Hover") text: i18n("Zoom On Hover")
} }
RowLayout{ RowLayout {
width: parent.width Layout.fillWidth: true
spacing: units.smallSpacing
PlasmaComponents.Slider{ PlasmaComponents.Slider {
id:zoomSlider Layout.fillWidth: true
id: zoomSlider
valueIndicatorText: i18n("Zoom Factor") valueIndicatorText: i18n("Zoom Factor")
valueIndicatorVisible: true valueIndicatorVisible: true
value: Number(1 + plasmoid.configuration.zoomLevel / 20).toFixed(2)
minimumValue: 1 minimumValue: 1
maximumValue: 2 maximumValue: 2
stepSize: 0.05 stepSize: 0.05
Layout.fillWidth:true function updateZoomLevel() {
property bool inStartup:true
property real tempValue: value
Component.onCompleted: {
value = Number(1 + plasmoid.configuration.zoomLevel/20).toFixed(2)
inStartup = false;
// console.log("Slider:"+value);
}
onPressedChanged: {
if (!pressed) { if (!pressed) {
var result = Math.round((value - 1)*20) var result = Math.round((value - 1) * 20)
plasmoid.configuration.zoomLevel = result plasmoid.configuration.zoomLevel = result
} }
} }
onTempValueChanged:{ onPressedChanged: {
if(!inStartup && !pressed){ updateZoomLevel()
var result = Math.round((value - 1)*20) }
plasmoid.configuration.zoomLevel = result
} Component.onCompleted: {
valueChanged.connect(updateZoomLevel)
} }
} }
PlasmaComponents.Label{ PlasmaComponents.Label {
enabled: showBackground.checked text: Number(
//text: " "+Number(zoomSlider.value).toFixed(2) (zoomSlider.value * 100) - 100).toFixed(0) + "%"
text: " "+Number((zoomSlider.value*100)-100).toFixed(0)+"%" horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 theme.defaultFont).width * 5
} }
} }
} }
//! END: Zoom On Hover
/**Animations Speed***/ //! BEGIN: Animations
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Column{ Header {
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Animations") text: i18n("Animations")
} }
Flow{ RowLayout {
width: parent.width Layout.fillWidth: true
spacing: 2 spacing: 2
property bool inStartup: true
property int duration: plasmoid.configuration.durationTime property int duration: plasmoid.configuration.durationTime
onDurationChanged: updateDurationVisual(); ExclusiveGroup {
id: animationsGroup
Component.onCompleted: { onCurrentChanged: {
updateDurationVisual(); if (current.checked)
inStartup = false; plasmoid.configuration.durationTime = current.duration
}
function updateDurationVisual(){
if(duration === 0){
firstDuration.checked = true;
secondDuration.checked = false;
thirdDuration.checked = false;
fourthDuration.checked = false;
}
else if(duration === 1){
firstDuration.checked = false;
secondDuration.checked = true;
thirdDuration.checked = false;
fourthDuration.checked = false;
}
else if(duration === 2){
firstDuration.checked = false;
secondDuration.checked = false;
thirdDuration.checked = true;
fourthDuration.checked = false;
}
else if(duration === 3){
firstDuration.checked = false;
secondDuration.checked = false;
thirdDuration.checked = false;
fourthDuration.checked = true;
} }
} }
PlasmaComponents.Button {
PlasmaComponents.Button{ Layout.fillWidth: true
id: firstDuration
checkable: true
text: i18n("None") text: i18n("None")
width: (parent.width / 4) - 2 checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: { readonly property int duration: 0
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 0;
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: secondDuration Layout.fillWidth: true
checkable: true
text: i18n("x1") text: i18n("x1")
width: (parent.width / 4) - 2 checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: { readonly property int duration: 1
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 1;
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: thirdDuration Layout.fillWidth: true
checkable: true
text: i18n("x2") text: i18n("x2")
width: (parent.width / 4) - 2 checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: { readonly property int duration: 2
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 2;
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button {
PlasmaComponents.Button{ Layout.fillWidth: true
id: fourthDuration
checkable: true
text: i18n("x3") text: i18n("x3")
width: (parent.width/4) - 1 checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: { readonly property int duration: 3
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 3;
}
}
onClicked: checked=true;
} }
} }
} }
//! END: Animations
//! BEGIN: Background
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Column{ Header {
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Background") text: i18n("Background")
} }
PlasmaComponents.CheckBox{ PlasmaComponents.CheckBox {
id: showBackground id: showBackground
text: i18n("Show Panel Background") text: i18n("Show Panel Background")
checked: plasmoid.configuration.useThemePanel
property bool inStartup: true onClicked: {
onCheckedChanged:{ plasmoid.configuration.useThemePanel = checked
if(!inStartup)
plasmoid.configuration.useThemePanel = checked;
}
Component.onCompleted: {
checked = plasmoid.configuration.useThemePanel;
inStartup = false;
} }
} }
RowLayout{ RowLayout {
width: parent.width Layout.fillWidth: true
PlasmaComponents.Slider{ PlasmaComponents.Slider {
id:panelSizeSlider id: panelSizeSlider
Layout.fillWidth: true
enabled: showBackground.checked enabled: showBackground.checked
valueIndicatorText: i18n("Size")
valueIndicatorVisible: true
value: plasmoid.configuration.panelSize
minimumValue: 0 minimumValue: 0
maximumValue: 256 maximumValue: plasmoid.configuration.iconSize + 4
stepSize: 2 stepSize: 2
Layout.fillWidth:true function updatePanelSize() {
if (!pressed)
property bool inStartup: true plasmoid.configuration.panelSize = value
property int tempValue: value
Component.onCompleted: {
value = plasmoid.configuration.panelSize
inStartup = false;
} }
onPressedChanged: { onPressedChanged: {
if (!pressed) { updatePanelSize()
plasmoid.configuration.panelSize = value;
}
} }
onTempValueChanged:{ Component.onCompleted: {
if(!inStartup && !pressed){ valueChanged.connect(updatePanelSize)
plasmoid.configuration.panelSize = value;
}
} }
} }
PlasmaComponents.Label{ PlasmaComponents.Label {
enabled: showBackground.checked enabled: showBackground.checked
text: panelSizeSlider.value + " px." text: panelSizeSlider.value + " px."
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4 horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 5
} }
} }
} }
//! END: Background
/******Shadows**********/ //! BEGIN: Shadows
Column{ Column {
width: parent.width Layout.fillWidth: true
spacing: 0.8*theme.defaultFont.pointSize spacing: units.smallSpacing
Header{
Header {
text: i18n("Shadows") text: i18n("Shadows")
} }
RowLayout { PlasmaComponents.ButtonRow {
width: parent.width Layout.fillWidth: true
spacing: units.smallSpacing
ExclusiveGroup { exclusive: true
id: shadowsGroup
property bool inStartup: true
onCurrentChanged: {
if (!inStartup) {
if (current === noneShadow){
plasmoid.configuration.shadows = 0; /*No Shadows*/
} else if (current === lockedAppletsShadow){
plasmoid.configuration.shadows = 1; /*Locked Applets Shadows*/
} else if (current === allAppletsShadow){
plasmoid.configuration.shadows = 2; /*All Applets Shadows*/
}
}
}
Component.onCompleted: { property int shadows: plasmoid.configuration.shadows
if (plasmoid.configuration.shadows === 0 /*No Shadows*/){
noneShadow.checked = true;
} else if (plasmoid.configuration.shadows === 1 /*Locked Applets*/) {
lockedAppletsShadow.checked = true;
} else if (plasmoid.configuration.shadows === 2 /*All Applets*/) {
allAppletsShadow.checked = true;
}
inStartup = false; onCheckedButtonChanged: {
} if (checkedButton.checked)
plasmoid.configuration.shadows = checkedButton.shadow
} }
PlasmaComponents.RadioButton { PlasmaComponents.RadioButton {
id: noneShadow
text: i18n("None") text: i18n("None")
exclusiveGroup: shadowsGroup checked: parent.shadows === shadow
readonly property int shadow: 0
} }
PlasmaComponents.RadioButton { PlasmaComponents.RadioButton {
id: lockedAppletsShadow
text: i18n("Only for locked applets") text: i18n("Only for locked applets")
exclusiveGroup: shadowsGroup checked: parent.shadows === shadow
readonly property int shadow: 1
} }
PlasmaComponents.RadioButton { PlasmaComponents.RadioButton {
id: allAppletsShadow
text: i18n("All applets") text: i18n("All applets")
exclusiveGroup: shadowsGroup checked: parent.shadows === shadow
}
readonly property int shadow: 2
}
} }
} }
//! END: Shadows
} }
} }

@ -25,476 +25,328 @@ import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte import org.kde.latte 0.1 as Latte
import "../controls" as ExtraControls
PlasmaComponents.Page{
width: dialog.width - 2*dialog.windowSpace PlasmaComponents.Page {
Layout.maximumWidth: content.width + units.smallSpacing * 2
property int pageHeight: mainColumn.height Layout.maximumHeight: content.height + units.smallSpacing * 2
Column{ ColumnLayout {
id: mainColumn id: content
spacing: 1.5*theme.defaultFont.pointSize
width: parent.width width: dialog.maxWidth
spacing: units.largeSpacing
Column{ anchors.centerIn: parent
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize //! BEGIN: Location
ColumnLayout {
Header{ Layout.fillWidth: true
spacing: units.smallSpacing
Header {
text: i18n("Location") text: i18n("Location")
} }
Flow{ RowLayout {
width: parent.width id: locationLayout
spacing: 2 Layout.fillWidth: true
spacing: 1
property bool inStartup: true
property int dockLocation: dock.location
onDockLocationChanged: updateDockLocationVisual();
property int docksCount: dock.docksCount property int docksCount: dock.docksCount
onDocksCountChanged: { onDocksCountChanged: {
lockReservedEdges(); lockReservedEdges()
updateDockLocationVisual();
} }
Component.onCompleted: { ExclusiveGroup {
lockReservedEdges(); id: locationGroup
updateDockLocationVisual(); onCurrentChanged: {
inStartup = false; if (current.checked) {
dock.location = current.edge
locationLayout.lockReservedEdges()
}
}
} }
Component.onCompleted: lockReservedEdges()
function lockReservedEdges() { function lockReservedEdges() {
var edges = dock.freeEdges(); var buttons = visibleChildren
var edges = dock.freeEdges()
firstLocation.enabled = false;
secondLocation.enabled = false; for (var i = 0; i < buttons.length; i++) {
thirdLocation.enabled = false; buttons[i].enabled = buttons[i].checked || freeEdge(
fourthLocation.enabled = false; buttons[i].edge, edges)
for (var i=0; i<edges.length; ++i){
if (edges[i] === PlasmaCore.Types.BottomEdge){
firstLocation.enabled = true;
} else if (edges[i] === PlasmaCore.Types.LeftEdge){
secondLocation.enabled = true;
} else if (edges[i] === PlasmaCore.Types.TopEdge){
thirdLocation.enabled = true;
} else if (edges[i] === PlasmaCore.Types.RightEdge){
fourthLocation.enabled = true;
}
} }
} }
function updateDockLocationVisual(){ function freeEdge(edge, edges) {
if(dockLocation === PlasmaCore.Types.BottomEdge){ for (var i = 0; i < edges.length; i++) {
firstLocation.enabled = true; if (edges[i] === edge)
firstLocation.checked = true; return true
secondLocation.checked = false;
thirdLocation.checked = false;
fourthLocation.checked = false;
}
else if(dockLocation === PlasmaCore.Types.LeftEdge){
firstLocation.checked = false;
secondLocation.enabled = true;
secondLocation.checked = true;
thirdLocation.checked = false;
fourthLocation.checked = false;
}
else if(dockLocation === PlasmaCore.Types.TopEdge){
firstLocation.checked = false;
secondLocation.checked = false;
thirdLocation.enabled = true;
thirdLocation.checked = true;
fourthLocation.checked = false;
}
else if(dockLocation === PlasmaCore.Types.RightEdge){
firstLocation.checked = false;
secondLocation.checked = false;
thirdLocation.checked = false;
fourthLocation.enabled = true;
fourthLocation.checked = true;
} }
return false
} }
PlasmaComponents.Button {
PlasmaComponents.Button{ Layout.fillWidth: true
id: firstLocation text: i18nc("bottom location", "Bottom")
checkable: true
text: i18nc("bottom location","Bottom")
width: (parent.width / 4) - 2
iconSource: "arrow-down" iconSource: "arrow-down"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: { readonly property int edge: PlasmaCore.Types.BottomEdge
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.BottomEdge
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: secondLocation Layout.fillWidth: true
checkable: true text: i18nc("left location", "Left")
text: i18nc("left location","Left")
width: (parent.width / 4) - 2
iconSource: "arrow-left" iconSource: "arrow-left"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: { readonly property int edge: PlasmaCore.Types.LeftEdge
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.LeftEdge
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: thirdLocation Layout.fillWidth: true
checkable: true text: i18nc("top location", "Top")
text: i18nc("top location","Top")
width: (parent.width / 4) - 2
iconSource: "arrow-up" iconSource: "arrow-up"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: { readonly property int edge: PlasmaCore.Types.TopEdge
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.TopEdge
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button {
PlasmaComponents.Button{ Layout.fillWidth: true
id: fourthLocation text: i18nc("right location", "Right")
checkable: true
text: i18nc("right location","Right")
width: (parent.width/4) - 2
iconSource: "arrow-right" iconSource: "arrow-right"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: { readonly property int edge: PlasmaCore.Types.RightEdge
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.RightEdge
}
}
onClicked: checked=true;
} }
} }
} }
//! END: Location
//! BEGIN: Alignment
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
/////////// Applets Alignment ////////////////// Header {
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Alignment") text: i18n("Alignment")
} }
//user set Panel Positions RowLayout {
// 0-Center, 1-Left, 2-Right, 3-Top, 4-Bottom Layout.fillWidth: true
Flow{ spacing: 1
width: parent.width
spacing: 2
property bool inStartup: true
property int panelPosition: plasmoid.configuration.panelPosition property int panelPosition: plasmoid.configuration.panelPosition
onPanelPositionChanged: {
function updatePanelPositionVisual(){ if (panelPosition === Latte.Dock.Justify)
if((panelPosition == Latte.Dock.Left)||(panelPosition == Latte.Dock.Top)){ dock.addInternalViewSplitter()
firstPosition.checked = true; else
centerPosition.checked = false; dock.removeInternalViewSplitter()
lastPosition.checked = false;
splitTwoPosition.checked = false;
dock.removeInternalViewSplitter();
}
else if(panelPosition == Latte.Dock.Center){
firstPosition.checked = false;
centerPosition.checked = true;
lastPosition.checked = false;
splitTwoPosition.checked = false;
dock.removeInternalViewSplitter();
}
else if((panelPosition == Latte.Dock.Right)||(panelPosition == Latte.Dock.Bottom)){
firstPosition.checked = false;
centerPosition.checked = false;
lastPosition.checked = true;
splitTwoPosition.checked = false;
dock.removeInternalViewSplitter();
}
else if (panelPosition == Latte.Dock.Justify){
firstPosition.checked = false;
centerPosition.checked = false;
lastPosition.checked = false;
splitTwoPosition.checked = true;
//add the splitter visual
dock.addInternalViewSplitter();
}
} }
onPanelPositionChanged: updatePanelPositionVisual();
Component.onCompleted: { Component.onCompleted: {
updatePanelPositionVisual(); if (panelPosition === Latte.Dock.Justify)
inStartup = false; dock.addInternalViewSplitter()
else
dock.removeInternalViewSplitter()
} }
PlasmaComponents.Button{ ExclusiveGroup {
id: firstPosition id: alignmentGroup
checkable: true onCurrentChanged: {
text: panelIsVertical ? i18nc("top alignment","Top") : i18nc("left alignment","Left") if (current.checked)
width: (parent.width / 4) - 2 plasmoid.configuration.panelPosition = current.position
iconSource: panelIsVertical ? "format-align-vertical-top" : "format-justify-left"
onCheckedChanged: {
if(checked && !parent.inStartup){
if(panelIsVertical)
plasmoid.configuration.panelPosition = Latte.Dock.Top
else
plasmoid.configuration.panelPosition = Latte.Dock.Left
}
} }
onClicked: checked=true;
} }
PlasmaComponents.Button{
id: centerPosition PlasmaComponents.Button {
Layout.fillWidth: true
text: panelIsVertical ? i18nc("top alignment", "Top") : i18nc("left alignment", "Left")
iconSource: panelIsVertical ? "format-align-vertical-top" : "format-justify-left"
checked: parent.panelPosition === position
checkable: true checkable: true
text: i18nc("center alignment","Center") exclusiveGroup: alignmentGroup
width: (parent.width / 4) - 2
iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
onCheckedChanged: { property int position: panelIsVertical ? Latte.Dock.Top : Latte.Dock.Left
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Center
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: lastPosition Layout.fillWidth: true
text: i18nc("center alignment", "Center")
iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
checked: parent.panelPosition === position
checkable: true checkable: true
text: panelIsVertical ? i18nc("bottom alignment","Bottom") : i18nc("right alignment","Right") exclusiveGroup: alignmentGroup
width: (parent.width / 4) - 2
iconSource: panelIsVertical ? "format-align-vertical-bottom" : "format-justify-right"
onCheckedChanged: {
if(checked && !parent.inStartup){
if(panelIsVertical)
plasmoid.configuration.panelPosition = Latte.Dock.Bottom
else
plasmoid.configuration.panelPosition = Latte.Dock.Right
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{ property int position: Latte.Dock.Center
id: splitTwoPosition }
PlasmaComponents.Button {
Layout.fillWidth: true
text: panelIsVertical ? i18nc("bottom alignment", "Bottom") : i18nc("right alignment", "Right")
iconSource: panelIsVertical ? "format-align-vertical-bottom" : "format-justify-right"
checked: parent.panelPosition === position
checkable: true checkable: true
text: i18nc("justify alignment","Justify") exclusiveGroup: alignmentGroup
width: (parent.width / 4)
property int position: panelIsVertical ? Latte.Dock.Bottom : Latte.Dock.Right
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("justify alignment", "Justify")
iconSource: "format-justify-fill" iconSource: "format-justify-fill"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
onCheckedChanged: { property int position: Latte.Dock.Justify
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Justify;
}
}
onClicked: checked=true;
} }
} }
} }
//! END: Alignment
//AlwaysVisible = 0, //! BEGIN: Visibility
//AutoHide, ColumnLayout {
//DodgeActive, Layout.fillWidth: true
//DodgeMaximized, spacing: units.smallSpacing
//DodgeAllWindows
/********** Panel Visibility ****************/ Header {
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Visibility") text: i18n("Visibility")
} }
//user set Panel Visibility GridLayout {
// 0-AlwaysVisible, 1-AutoHide, 2-DodgeActive, 3-DodgeMaximized, 4-DodgeAllWindows
Flow{
width: parent.width width: parent.width
spacing: 2 rowSpacing: 1
columnSpacing: 1
columns: 3
property bool inStartup: true property bool inStartup: true
property int mode: dock.visibility.mode property int mode: dock.visibility.mode
ExclusiveGroup {
function updateModeVisual(){ id: visibilityGroup
if (mode === Latte.Dock.AlwaysVisible) onCurrentChanged: {
firstState.checked = true; if (current.checked)
else dock.visibility.mode = current.mode
firstState.checked = false; }
if (mode === Latte.Dock.AutoHide)
secondState.checked = true;
else
secondState.checked = false;
if (mode === Latte.Dock.DodgeActive)
thirdState.checked = true;
else
thirdState.checked = false;
if (mode === Latte.Dock.DodgeMaximized)
fourthState.checked = true;
else
fourthState.checked = false;
if (mode === Latte.Dock.DodgeAllWindows)
fifthState.checked = true;
else
fifthState.checked = false;
}
onModeChanged: updateModeVisual();
Component.onCompleted: {
updateModeVisual();
inStartup = false;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: firstState Layout.fillWidth: true
checkable: true
text: i18n("Always Visible") text: i18n("Always Visible")
width: (parent.width / 2) - 1 checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: { property int mode: Latte.Dock.AlwaysVisible
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.AlwaysVisible
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: secondState Layout.fillWidth: true
checkable: true
text: i18n("Auto Hide") text: i18n("Auto Hide")
width: (parent.width / 2) - 1 checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: { property int mode: Latte.Dock.AutoHide
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.AutoHide
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button{ PlasmaComponents.Button {
id: thirdState Layout.fillWidth: true
checkable: true
text: i18n("Dodge Active") text: i18n("Dodge Active")
width: (parent.width / 2) - 1 checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: { property int mode: Latte.Dock.DodgeActive
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeActive
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button {
PlasmaComponents.Button{ Layout.fillWidth: true
id: fourthState
checkable: true
text: i18n("Dodge Maximized") text: i18n("Dodge Maximized")
width: (parent.width/2) - 1 checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: { property int mode: Latte.Dock.DodgeMaximized
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeMaximized
}
}
onClicked: checked=true;
} }
PlasmaComponents.Button {
PlasmaComponents.Button{ Layout.fillWidth: true
id: fifthState
checkable: true
text: i18n("Dodge All Windows") text: i18n("Dodge All Windows")
width: (parent.width/2) - 1 checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: { property int mode: Latte.Dock.DodgeAllWindows
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeAllWindows
}
}
onClicked: checked=true;
} }
} }
} }
//! END: Visibility
//! BEGIN: Delay
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Column{ Header {
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Delay") text: i18n("Delay")
} }
GridLayout{ RowLayout {
columns: 2 spacing: units.smallSpacing
columnSpacing: 0.3*theme.defaultFont.pointSize PlasmaComponents.Label {
width: parent.width Layout.fillWidth: false
horizontalAlignment: Text.AlignRight
Row{ text: i18n("Show:")
Layout.alignment: Qt.AlignHCenter }
PlasmaComponents.Label{ ExtraControls.SpinBox {
text: i18n("Hide:") Layout.fillWidth: false
Layout.maximumWidth: implicitWidth
enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible
maximumValue: 3000
minimumValue: 0
value: dock.visibility.timerShow
stepSize: 100
onValueChanged: {
dock.visibility.timerShow = value
} }
LatteTextField{ suffix: i18n("ms.")
width: 9.5 * theme.defaultFont.pixelSize
property bool inStartup: true
Component.onCompleted: {
value = dock.visibility.timerHide
inStartup = false;
}
onValueChanged: {
if(!inStartup){
dock.visibility.timerHide = value;
}
}
}
} }
PlasmaComponents.Label {
Row{ Layout.fillWidth: false
Layout.alignment: Qt.AlignHCenter Layout.leftMargin: units.largeSpacing
PlasmaComponents.Label{ horizontalAlignment: Text.AlignRight
text: i18n("Show:") text: i18n("Hide:")
}
ExtraControls.SpinBox {
Layout.fillWidth: false
Layout.maximumWidth: implicitWidth
enabled: dock.visibility.mode !== Latte.Dock.AlwaysVisible
maximumValue: 3000
minimumValue: 0
value: dock.visibility.timerHide
stepSize: 100
onValueChanged: {
dock.visibility.timerHide = value
} }
LatteTextField{ suffix: i18n("ms.")
width: 9.5 * theme.defaultFont.pixelSize
property bool inStartup: true
Component.onCompleted: {
value = dock.visibility.timerShow
inStartup = false;
}
onValueChanged: {
if(!inStartup){
dock.visibility.timerShow = value;
}
}
}
} }
} }
} }
//! END: Delay
} }
} }

@ -21,10 +21,9 @@
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras
PlasmaComponents.Label{
font.pointSize: 1.3 * theme.defaultFont.pointSize
PlasmaExtras.Heading {
Layout.alignment: Qt.AlignLeft Layout.alignment: Qt.AlignLeft
level: 3
} }

@ -0,0 +1,242 @@
/*
* Copyright 2016 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock 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.
*
* Latte-Dock 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 <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.plasmoid 2.0
import org.kde.kquickcontrolsaddons 2.0 as KQuickControlAddons
import org.kde.latte 0.1 as Latte
PlasmaCore.FrameSvgItem {
id: dialog
imagePath: "dialogs/background"
//old way to count the dialog width
//Math.max(420,appearancePage.noneShadow.width + appearancePage.lockedAppletsShadow.width + appearancePage.allAppletsShadow.width)
width: content.width + units.largeSpacing * 2
height: content.height + units.smallSpacing * 2
property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
property int windowSpace: 8
FontLoader {
id: tangerineFont
name: "Tangerine"
source: "../fonts/tangerine.ttf"
}
ColumnLayout {
id: content
Layout.minimumWidth: width
Layout.minimumHeight: height
width: implicitWidth
height: implicitHeight
anchors.centerIn: parent
spacing: units.smallSpacing
RowLayout {
id: header
Layout.fillWidth: true
spacing: 0
KQuickControlAddons.QIconItem {
id: logo
Layout.alignment: Qt.AlignLeft | Qt.AlignHCenter
Layout.fillWidth: false
width: 1.5 * latteTxt.font.pixelSize
height: width
icon: "latte-dock"
}
PlasmaComponents.Label {
id: latteTxt
Layout.alignment: Qt.AlignLeft | Qt.AlignHCenter
Layout.fillWidth: false
text: i18n("atte")
font.family: tangerineFont.name
font.pointSize: 2 * theme.defaultFont.pointSize
font.italic: true
Layout.alignment: Qt.AlignLeft
}
PlasmaComponents.Label {
id: verLabel
font.family: "monospace"
font.pointSize: 0.8 * theme.defaultFont.pointSize
font.bold: true
opacity: 0.4
Layout.topMargin: 1.4 * units.iconSizes.small
Layout.alignment: Qt.AlignRight | Qt.AlignTop
horizontalAlignment: Text.AlignRight
Layout.fillWidth: true
text: i18n("ver:") + "@VERSION@"
}
PlasmaComponents.ToolButton {
id: pinButton
Layout.fillWidth: false
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
iconSource: "window-pin"
checkable: true
width: Math.round(units.gridUnit * 1.25)
height: width
property bool inStartup: true
onCheckedChanged: {
if (!inStartup) {
plasmoid.configuration.configurationSticker = checked
dockConfig.setSticker(checked)
}
}
Component.onCompleted: {
checked = plasmoid.configuration.configurationSticker
dockConfig.setSticker(plasmoid.configuration.configurationSticker)
inStartup = false
}
}
}
PlasmaComponents.TabBar {
id: tabBar
Layout.fillWidth: true
PlasmaComponents.TabButton {
text: i18n("Behavior")
tab: behaviorPage
}
PlasmaComponents.TabButton {
text: i18n("Appearance")
tab: appearancePage
}
PlasmaComponents.TabButton {
text: i18n("Tasks")
tab: tasksPage
visible: dock.tasksPresent()
}
}
Rectangle {
id: pagesBackground
Layout.fillWidth: true
height: childrenRect.height
property color bC: theme.backgroundColor
property color transparentBack: Qt.rgba(bC.r, bC.g, bC.b, 0.7)
color: transparentBack
border.width: 1
border.color: theme.backgroundColor
PlasmaExtras.ScrollArea {
anchors.fill: parent
anchors.margins: 3
verticalScrollBarPolicy: Qt.ScrollBarAlwaysOff
PlasmaComponents.TabGroup {
width: pagesBackground.width - 6
//FIXME: this creates a binding loop but I havent found any alternative yet
height: currentTab.childrenRect.height
privateContents: [
BehaviorConfig {
id: behaviorPage
},
AppearanceConfig {
id: appearancePage
},
TasksConfig {
id: tasksPage
}
]
}
}
}
RowLayout {
id: actionButtons
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
spacing: units.largeSpacing
PlasmaComponents.Button {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
text: i18n("Add")
iconSource: "list-add"
onClicked: dock.addNewDock()
Component.onCompleted: {
var edges = dock.freeEdges()
if (edges.length === 0) {
enabled = false
}
}
}
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
text: i18n("Remove")
iconSource: "edit-delete"
visible: dock.docksCount > 1 ? true : false
onClicked: dock.removeDock()
}
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.alignment: Qt.AlignRight
text: i18n("Quit")
iconSource: "window-close"
onClicked: dock.closeApplication()
}
}
}
}

@ -37,199 +37,211 @@ PlasmaCore.FrameSvgItem {
id: dialog id: dialog
imagePath: "dialogs/background" imagePath: "dialogs/background"
//old way to count the dialog width property int maxWidth: 420 //Math.max(420, behaviorPage.width, appearancePage.width, tasksPage.width)
//Math.max(420,appearancePage.noneShadow.width + appearancePage.lockedAppletsShadow.width + appearancePage.allAppletsShadow.width) property int maxHeight: 400
width: 33*theme.defaultFont.pixelSize width: content.width + units.smallSpacing * 2
height: 37*theme.defaultFont.pixelSize height: content.height + units.smallSpacing * 2
property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
property int windowSpace:8 FontLoader {
id: tangerineFont
FontLoader { id: tangerineFont; name: "Tangerine"; source: "../fonts/tangerine.ttf" } name: "Tangerine"
source: "../fonts/tangerine.ttf"
PlasmaComponents.ToolButton{
id: pinButton
anchors.right: parent.right
anchors.top: parent.top
checkable: true
iconSource: "window-pin"
width: Math.round(units.gridUnit * 1.25)
height: width
property bool inStartup: true
onCheckedChanged: {
if (!inStartup) {
plasmoid.configuration.configurationSticker = checked;
dockConfig.setSticker(checked);
}
}
Component.onCompleted: {
checked = plasmoid.configuration.configurationSticker;
dockConfig.setSticker(plasmoid.configuration.configurationSticker);
inStartup = false;
}
} }
ColumnLayout{ ColumnLayout {
width: parent.width - 2*windowSpace id: content
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top Layout.minimumWidth: width
anchors.topMargin: windowSpace Layout.minimumHeight: height
Layout.preferredWidth: width
Layout.preferredHeight: height
height: header.height + tabBar.height + pagesBackground.height + actionButtons.height + spacing * 3
spacing: 0 anchors.centerIn: parent
spacing: units.smallSpacing
RowLayout{ RowLayout {
id: header id: header
Layout.fillWidth: true Layout.fillWidth: true
spacing: 0 spacing: 0
KQuickControlAddons.QIconItem{ KQuickControlAddons.QIconItem {
id:logo id: logo
width: 1.5*latteTxt.font.pixelSize Layout.alignment: Qt.AlignLeft | Qt.AlignHCenter
Layout.fillWidth: false
width: 1.5 * latteTxt.font.pixelSize
height: width height: width
icon: "latte-dock" icon: "latte-dock"
} }
PlasmaComponents.Label{ PlasmaComponents.Label {
id: latteTxt id: latteTxt
Layout.alignment: Qt.AlignLeft | Qt.AlignHCenter
Layout.fillWidth: false
text: i18n("atte") text: i18n("atte")
font.family: tangerineFont.name font.family: tangerineFont.name
font.pointSize: 2 * theme.defaultFont.pointSize font.pointSize: 2 * theme.defaultFont.pointSize
font.italic: true font.italic: true
Layout.alignment: Qt.AlignLeft
} }
PlasmaComponents.Label{ PlasmaComponents.Label {
id: verLabel id: verLabel
font.family: "monospace" font.family: "monospace"
font.pointSize: 0.8 * theme.defaultFont.pointSize font.pointSize: 0.8 * theme.defaultFont.pointSize
font.bold: true font.bold: true
opacity: 0.4 opacity: 0.4
Layout.topMargin: 1.4 * units.iconSizes.small Layout.rightMargin: units.smallSpacing
Layout.alignment: Qt.AlignRight | Qt.AlignTop Layout.alignment: Qt.AlignRight | Qt.AlignHCenter
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
Layout.fillWidth: true Layout.fillWidth: true
text: i18n("ver:") +"@VERSION@" text: i18n("ver:") + "@VERSION@"
}
PlasmaComponents.ToolButton {
id: pinButton
Layout.fillWidth: false
Layout.fillHeight: false
Layout.preferredWidth: width
Layout.preferredHeight: height
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
iconSource: "window-pin"
checkable: true
width: Math.round(units.gridUnit * 1.25)
height: width
property bool inStartup: true
onClicked: {
plasmoid.configuration.configurationSticker = checked
dockConfig.setSticker(checked)
}
Component.onCompleted: {
checked = plasmoid.configuration.configurationSticker
dockConfig.setSticker(plasmoid.configuration.configurationSticker)
}
} }
} }
PlasmaComponents.TabBar{ PlasmaComponents.TabBar {
id:tabBar id: tabBar
Layout.fillWidth: true Layout.fillWidth: true
PlasmaComponents.TabButton{ PlasmaComponents.TabButton {
text: i18n("Behavior") text: i18n("Behavior")
tab: behaviorPage tab: behaviorPage
} }
PlasmaComponents.TabButton{ PlasmaComponents.TabButton {
text: i18n("Appearance") text: i18n("Appearance")
tab: appearancePage tab: appearancePage
} }
PlasmaComponents.TabButton{ PlasmaComponents.TabButton {
text: i18n("Tasks") text: i18n("Tasks")
tab: tasksPage tab: tasksPage
visible: dock.tasksPresent(); visible: dock.tasksPresent()
} }
} }
Rectangle{ Rectangle {
id: pagesBackground id: pagesBackground
Layout.fillWidth: true Layout.fillWidth: true
height: 28*theme.defaultFont.pixelSize Layout.fillHeight: false
Layout.minimumWidth: maxWidth
Layout.maximumHeight: height
width: maxWidth + units.smallSpacing * 4
height: behaviorPage.Layout.maximumHeight + units.smallSpacing * 2
property color bC: theme.backgroundColor property color bC: theme.backgroundColor
property color transparentBack: Qt.rgba(bC.r,bC.g,bC.b,0.7) property color transparentBack: Qt.rgba(bC.r, bC.g, bC.b, 0.7)
color: transparentBack color: transparentBack
border.width: 1 border.width: 1
border.color: theme.backgroundColor border.color: theme.backgroundColor
PlasmaExtras.ScrollArea {
PlasmaExtras.ScrollArea{ id: scrollArea
anchors.fill: parent anchors.fill: parent
anchors.margins: 3 verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
PlasmaComponents.TabGroup{
width: pagesBackground.width - 6 PlasmaComponents.TabGroup {
height: currentTab.pageHeight id: tabGroup
privateContents: [ width: currentTab.Layout.maximumWidth
BehaviorConfig{ height: currentTab.Layout.maximumHeight
id: behaviorPage
}, BehaviorConfig {
AppearanceConfig{ id: behaviorPage
id: appearancePage }
},
TasksConfig{ AppearanceConfig {
id: tasksPage id: appearancePage
} }
]
TasksConfig {
id: tasksPage
}
} }
} }
} }
}
Row{ RowLayout {
id: actionButtons id: actionButtons
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: windowSpace
spacing: 2 Layout.fillWidth: true
width: parent.width - 2*windowSpace Layout.alignment: Qt.AlignCenter
PlasmaComponents.Button{ spacing: units.largeSpacing
enabled: true
text: i18n("Add")
iconSource: "list-add"
width: parent.width/4 - 2 PlasmaComponents.Button {
Layout.alignment: Qt.AlignLeft
Layout.fillWidth: true
text: i18n("Add")
iconSource: "list-add"
onClicked: dock.addNewDock(); onClicked: dock.addNewDock()
Component.onCompleted: { Component.onCompleted: {
var edges = dock.freeEdges(); var edges = dock.freeEdges()
if (edges.length === 0) { if (edges.length === 0) {
enabled = false; enabled = false
}
} }
} }
} PlasmaComponents.Button {
PlasmaComponents.Button{ Layout.fillWidth: true
enabled: true Layout.alignment: Qt.AlignHCenter
text: i18n("Remove")
iconSource: "edit-delete"
width: parent.width/4 - 2
opacity: dock.docksCount > 1 ? 1 : 0
onClicked: dock.removeDock();
}
Item{ text: i18n("Remove")
width: parent.width/4 - 2 iconSource: "edit-delete"
height: 1 visible: dock.docksCount > 1 ? true : false
}
PlasmaComponents.Button{ onClicked: dock.removeDock()
enabled: true }
text: i18n("Quit")
iconSource: "window-close" PlasmaComponents.Button {
width: parent.width/4 - 2 Layout.fillWidth: true
Layout.alignment: Qt.AlignRight
onClicked: dock.closeApplication(); text: i18n("Quit")
iconSource: "window-close"
onClicked: dock.closeApplication()
}
} }
} }
} }

@ -1,97 +0,0 @@
/*
* Copyright 2016 Smith AR <audoban@openmailbox.org>
* Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock 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.
*
* Latte-Dock 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 <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import QtQuick.Layouts 1.3
import QtQuick.Controls 1.4
import org.kde.plasma.components 2.0 as PlasmaComponents
PlasmaComponents.TextField{
id: textField
validator: IntValidator {bottom: minValue; top: maxValue;}
text: value === 0 ? "" : value
font.italic: true
placeholderText: i18n("<none>")
property int step: 100
property int value: 0
property int minValue: 0
property int maxValue: 3000
function confirmValue(val){
var fixedVal = Math.min(maxValue, val);
if (fixedVal < minValue) {
return minValue;
} else {
return fixedVal;
}
}
onTextChanged: text !== "" ? value = parseInt(text) : value = 0;
Row{
// width: 4 * theme.defaultFont.pixelSize
anchors.right: parent.right
anchors.rightMargin: 2
anchors.verticalCenter: parent.verticalCenter
PlasmaComponents.Label{
text: i18n("ms.")
font.italic: true
opacity: (value === 0) ? 0 : 0.6
}
PlasmaComponents.Label{
text: " "
font.italic: true
}
PlasmaComponents.Button{
width: 2*theme.defaultFont.pixelSize - 4
height: width
text:"-"
onClicked: value = confirmValue(value - step);
}
PlasmaComponents.Button{
width: 2*theme.defaultFont.pixelSize - 4
height: width
text:"+"
onClicked: value = confirmValue(value + step);
}
}
MouseArea{
anchors.fill: parent
acceptedButtons: Qt.MiddleButton
onWheel: {
var angle = wheel.angleDelta.y / 8
if (angle>0) {
value = confirmValue(value + step);
} else if (angle<0){
value = confirmValue(value - step);
}
}
}
}

@ -17,7 +17,6 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
import QtQuick 2.0 import QtQuick 2.0
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Layouts 1.3 import QtQuick.Layouts 1.3
@ -25,199 +24,158 @@ import QtGraphicalEffects 1.0
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{ PlasmaComponents.Page {
width: dialog.width - 2*dialog.windowSpace Layout.maximumWidth: content.width + units.smallSpacing * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
property int pageHeight: mainColumn.height
ColumnLayout {
Column{ id: content
id: mainColumn width: dialog.maxWidth
spacing: 1.5*theme.defaultFont.pointSize spacing: units.largeSpacing
width: parent.width anchors.centerIn: parent
/******Appearance******/ //! BEGIN: Tasks Appearance
Column{ ColumnLayout {
width:parent.width spacing: units.smallSpacing
spacing: 0.8*theme.defaultFont.pointSize
Header {
Header{
text: i18n("Appearance") text: i18n("Appearance")
} }
Row{ PlasmaComponents.CheckBox {
Item{ id: showGlow
width: 2*theme.defaultFont.pixelSize text: i18n("Show glow around windows points")
height: 1 checked: plasmoid.configuration.showGlow
}
Column{
spacing: 0.4*theme.defaultFont.pixelSize
PlasmaComponents.CheckBox {
id: showGlow
text: i18n("Show glow around windows points")
onCheckedChanged: { onClicked: {
plasmoid.configuration.showGlow = checked; plasmoid.configuration.showGlow = checked
} }
}
Component.onCompleted: checked = plasmoid.configuration.showGlow;
}
PlasmaComponents.CheckBox {
id: threeColorsWindows
text: i18n("Different color for minimized windows")
onCheckedChanged: {
plasmoid.configuration.threeColorsWindows = checked;
}
Component.onCompleted: checked = plasmoid.configuration.threeColorsWindows;
}
PlasmaComponents.CheckBox { PlasmaComponents.CheckBox {
id: dotsOnActive id: threeColorsWindows
text: i18n("Dots on active window") text: i18n("Different color for minimized windows")
checked: plasmoid.configuration.threeColorsWindows
onCheckedChanged: { onClicked: {
plasmoid.configuration.dotsOnActive = checked; plasmoid.configuration.threeColorsWindows = checked
} }
}
Component.onCompleted: checked = plasmoid.configuration.dotsOnActive; PlasmaComponents.CheckBox {
} id: dotsOnActive
text: i18n("Dots on active window")
checked: plasmoid.configuration.dotsOnActive
PlasmaComponents.CheckBox { onClicked: {
id: reverseLinesPosition plasmoid.configuration.dotsOnActive = checked
text: i18n("Reverse position for lines and dots") }
}
onCheckedChanged: { PlasmaComponents.CheckBox {
plasmoid.configuration.reverseLinesPosition = checked; id: reverseLinesPosition
} text: i18n("Reverse position for lines and dots")
checked: plasmoid.configuration.reverseLinesPosition
Component.onCompleted: checked = plasmoid.configuration.reverseLinesPosition; onClicked: {
} plasmoid.configuration.reverseLinesPosition = checked
} }
} }
} }
//! END: Tasks Appearance
/*********Behavior************/ //! BEGIN: Tasks Interaction
Column{ ColumnLayout {
width:parent.width spacing: units.smallSpacing
spacing: 0.8*theme.defaultFont.pointSize
Header{ Header {
text: i18n("Interaction") text: i18n("Interaction")
} }
Row{ PlasmaComponents.CheckBox {
Item{ id: showPreviewsChk
width: 2*theme.defaultFont.pixelSize text: i18n("Preview windows on hovering")
height: 1 checked: plasmoid.configuration.showToolTips
}
Column{
spacing: 0.4*theme.defaultFont.pixelSize
PlasmaComponents.CheckBox {
id: showPreviewsChk
text: i18n("Preview windows on hovering")
onCheckedChanged: {
plasmoid.configuration.showToolTips = checked;
}
Component.onCompleted: checked = plasmoid.configuration.showToolTips;
}
PlasmaComponents.CheckBox { onClicked: {
id: highlightWindowsChk plasmoid.configuration.showToolTips = checked
text: i18n("Highlight windows on hovering") }
}
onCheckedChanged: {
plasmoid.configuration.highlightWindows = checked;
}
Component.onCompleted: checked = plasmoid.configuration.highlightWindows;
}
PlasmaComponents.CheckBox { PlasmaComponents.CheckBox {
id: windowActionsChk id: highlightWindowsChk
text: i18n("Show window actions in the context menu") text: i18n("Highlight windows on hovering")
checked: plasmoid.configuration.highlightWindows
onCheckedChanged: { onClicked: {
plasmoid.configuration.showWindowActions = checked; plasmoid.configuration.highlightWindows = checked
} }
}
Component.onCompleted: checked = plasmoid.configuration.showWindowActions; PlasmaComponents.CheckBox {
} id: windowActionsChk
text: i18n("Show window actions in the context menu")
checked: plasmoid.configuration.showWindowActions
PlasmaComponents.CheckBox { onClicked: {
id: smartLaunchersChk plasmoid.configuration.showWindowActions = checked
text: i18n("Show progress information in task buttons") }
}
onCheckedChanged: { PlasmaComponents.CheckBox {
plasmoid.configuration.smartLaunchersEnabled = checked; id: smartLaunchersChk
} text: i18n("Show progress information in task buttons")
checked: plasmoid.configuration.smartLaunchersEnabled
Component.onCompleted: checked = plasmoid.configuration.smartLaunchersEnabled; onClicked: {
} plasmoid.configuration.smartLaunchersEnabled = checked
} }
} }
} }
//! END: Tasks Interaction
/*******Filters*******/ //! BEGIN: Tasks Filters
Column{ ColumnLayout {
width:parent.width spacing: units.smallSpacing
spacing: 0.8*theme.defaultFont.pointSize
Header {
Header{
text: i18n("Filters") text: i18n("Filters")
} }
Row{ PlasmaComponents.CheckBox {
Item{ id: showOnlyCurrentScreen
width: 2*theme.defaultFont.pixelSize text: i18n("Show only tasks from the current screen")
height: 1 checked: plasmoid.configuration.showOnlyCurrentScreen
onClicked: {
plasmoid.configuration.showOnlyCurrentScreen = checked
} }
}
PlasmaComponents.CheckBox {
id: showOnlyCurrentDesktop
text: i18n("Show only tasks from the current desktop")
checked: plasmoid.configuration.showOnlyCurrentDesktop
onClicked: {
plasmoid.configuration.showOnlyCurrentDesktop = checked
}
}
Column{ PlasmaComponents.CheckBox {
spacing: 0.4*theme.defaultFont.pixelSize id: showOnlyCurrentActivity
text: i18n("Show only tasks from the current activity")
PlasmaComponents.CheckBox { checked: plasmoid.configuration.showOnlyCurrentActivity
id: showOnlyCurrentScreen
text: i18n("Show only tasks from the current screen") onClicked: {
onCheckedChanged: { plasmoid.configuration.showOnlyCurrentActivity = checked
plasmoid.configuration.showOnlyCurrentScreen = checked;
}
Component.onCompleted: checked = plasmoid.configuration.showOnlyCurrentScreen;
}
PlasmaComponents.CheckBox {
id: showOnlyCurrentDesktop
text: i18n("Show only tasks from the current desktop")
onCheckedChanged: {
plasmoid.configuration.showOnlyCurrentDesktop = checked;
}
Component.onCompleted: checked = plasmoid.configuration.showOnlyCurrentDesktop;
}
PlasmaComponents.CheckBox {
id: showOnlyCurrentActivity
text: i18n("Show only tasks from the current activity")
onCheckedChanged: {
plasmoid.configuration.showOnlyCurrentActivity = checked;
}
Component.onCompleted: checked = plasmoid.configuration.showOnlyCurrentActivity;
}
} }
} }
} }
//! END: Tasks Filters
} }
} }

@ -0,0 +1,40 @@
import QtQuick 2.0
import QtQuick.Controls 1.4 as Controls
import QtQuick.Controls.Styles.Plasma 2.0 as Styles
import org.kde.plasma.core 2.0 as PlasmaCore
Controls.SpinBox {
implicitWidth: theme.mSize(theme.defaultFont).width * 10
style: Styles.SpinBoxStyle {
PlasmaCore.Svg {
id: arrowSvg
imagePath: "widgets/arrows"
colorGroup: PlasmaCore.Theme.ButtonColorGroup
}
incrementControl: PlasmaCore.SvgItem {
implicitWidth: theme.mSize(theme.defaultFont).width * 1.8
anchors {
centerIn: parent
margins: 1
leftMargin: 0
rightMargin: 3
}
svg: arrowSvg
elementId: "up-arrow"
opacity: control.enabled ? (styleData.upPressed ? 1 : 0.6) : 0.5
}
decrementControl: PlasmaCore.SvgItem {
implicitWidth: theme.mSize(theme.defaultFont).width * 1.8
anchors {
centerIn: parent
margins: 1
leftMargin: 0
rightMargin: 3
}
svg: arrowSvg
elementId: "down-arrow"
opacity: control.enabled ? (styleData.upPressed ? 1 : 0.6) : 0.5
}
}
}
Loading…
Cancel
Save