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.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{
width: dialog.width - 2*dialog.windowSpace
property int pageHeight: mainColumn.height
PlasmaComponents.Page {
Layout.maximumWidth: content.width + units.smallSpacing * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
ColumnLayout {
id: content
Column{
id:mainColumn
spacing: 1.5*theme.defaultFont.pointSize
width: parent.width
width: dialog.maxWidth
spacing: units.largeSpacing
anchors.centerIn: parent
//////////////// Applets Size
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
//! BEGIN: Applet Size
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Header{
Header {
text: i18n("Applets Size")
}
RowLayout{
width: parent.width
property int step: 8
PlasmaComponents.Slider{
id:appletsSizeSlider
valueIndicatorText: i18n("Applets Size")
valueIndicatorVisible: true
RowLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
PlasmaComponents.Slider {
id: appletsSizeSlider
Layout.fillWidth: true
value: plasmoid.configuration.iconSize
minimumValue: 16
maximumValue: 128
stepSize: parent.step
Layout.fillWidth:true
property bool inStartup:true
property int tempValue: value
Component.onCompleted: {
value = plasmoid.configuration.iconSize;
inStartup = false;
}
onPressedChanged: {
stepSize: 8
function updateIconSize() {
if (!pressed) {
plasmoid.configuration.iconSize = value;
if (panelSizeSlider.value > value + 4)
panelSizeSlider.value = value + 4
plasmoid.configuration.iconSize = value
}
}
onTempValueChanged:{
if(!inStartup && !pressed){
plasmoid.configuration.iconSize = value;
}
onPressedChanged: {
updateIconSize()
}
Component.onCompleted: {
valueChanged.connect(updateIconSize)
}
}
PlasmaComponents.Label{
PlasmaComponents.Label {
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 ****************/
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
//! BEGIN: Zoom On Hover
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
enabled: plasmoid.configuration.durationTime > 0
Header{
Header {
text: i18n("Zoom On Hover")
}
RowLayout{
width: parent.width
RowLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
PlasmaComponents.Slider{
id:zoomSlider
PlasmaComponents.Slider {
Layout.fillWidth: true
id: zoomSlider
valueIndicatorText: i18n("Zoom Factor")
valueIndicatorVisible: true
value: Number(1 + plasmoid.configuration.zoomLevel / 20).toFixed(2)
minimumValue: 1
maximumValue: 2
stepSize: 0.05
Layout.fillWidth:true
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: {
function updateZoomLevel() {
if (!pressed) {
var result = Math.round((value - 1)*20)
var result = Math.round((value - 1) * 20)
plasmoid.configuration.zoomLevel = result
}
}
onTempValueChanged:{
if(!inStartup && !pressed){
var result = Math.round((value - 1)*20)
plasmoid.configuration.zoomLevel = result
}
onPressedChanged: {
updateZoomLevel()
}
Component.onCompleted: {
valueChanged.connect(updateZoomLevel)
}
}
PlasmaComponents.Label{
enabled: showBackground.checked
//text: " "+Number(zoomSlider.value).toFixed(2)
text: " "+Number((zoomSlider.value*100)-100).toFixed(0)+"%"
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
PlasmaComponents.Label {
text: Number(
(zoomSlider.value * 100) - 100).toFixed(0) + "%"
horizontalAlignment: Text.AlignRight
Layout.minimumWidth: theme.mSize(
theme.defaultFont).width * 5
}
}
}
//! END: Zoom On Hover
/**Animations Speed***/
//! BEGIN: Animations
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
Header {
text: i18n("Animations")
}
Flow{
width: parent.width
RowLayout {
Layout.fillWidth: true
spacing: 2
property bool inStartup: true
property int duration: plasmoid.configuration.durationTime
onDurationChanged: updateDurationVisual();
Component.onCompleted: {
updateDurationVisual();
inStartup = false;
}
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;
ExclusiveGroup {
id: animationsGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.durationTime = current.duration
}
}
PlasmaComponents.Button{
id: firstDuration
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("None")
width: (parent.width / 4) - 2
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 0;
}
}
onClicked: checked=true;
readonly property int duration: 0
}
PlasmaComponents.Button{
id: secondDuration
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x1")
width: (parent.width / 4) - 2
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 1;
}
}
onClicked: checked=true;
readonly property int duration: 1
}
PlasmaComponents.Button{
id: thirdDuration
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x2")
width: (parent.width / 4) - 2
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 2;
}
}
onClicked: checked=true;
readonly property int duration: 2
}
PlasmaComponents.Button{
id: fourthDuration
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("x3")
width: (parent.width/4) - 1
checked: parent.duration === duration
checkable: true
exclusiveGroup: animationsGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.durationTime = 3;
}
}
onClicked: checked=true;
readonly property int duration: 3
}
}
}
//! END: Animations
//! BEGIN: Background
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
Header {
text: i18n("Background")
}
PlasmaComponents.CheckBox{
PlasmaComponents.CheckBox {
id: showBackground
text: i18n("Show Panel Background")
checked: plasmoid.configuration.useThemePanel
property bool inStartup: true
onCheckedChanged:{
if(!inStartup)
plasmoid.configuration.useThemePanel = checked;
}
Component.onCompleted: {
checked = plasmoid.configuration.useThemePanel;
inStartup = false;
onClicked: {
plasmoid.configuration.useThemePanel = checked
}
}
RowLayout{
width: parent.width
RowLayout {
Layout.fillWidth: true
PlasmaComponents.Slider{
id:panelSizeSlider
PlasmaComponents.Slider {
id: panelSizeSlider
Layout.fillWidth: true
enabled: showBackground.checked
valueIndicatorText: i18n("Size")
valueIndicatorVisible: true
value: plasmoid.configuration.panelSize
minimumValue: 0
maximumValue: 256
maximumValue: plasmoid.configuration.iconSize + 4
stepSize: 2
Layout.fillWidth:true
property bool inStartup: true
property int tempValue: value
Component.onCompleted: {
value = plasmoid.configuration.panelSize
inStartup = false;
function updatePanelSize() {
if (!pressed)
plasmoid.configuration.panelSize = value
}
onPressedChanged: {
if (!pressed) {
plasmoid.configuration.panelSize = value;
}
updatePanelSize()
}
onTempValueChanged:{
if(!inStartup && !pressed){
plasmoid.configuration.panelSize = value;
}
Component.onCompleted: {
valueChanged.connect(updatePanelSize)
}
}
PlasmaComponents.Label{
PlasmaComponents.Label {
enabled: showBackground.checked
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**********/
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
//! BEGIN: Shadows
Column {
Layout.fillWidth: true
spacing: units.smallSpacing
Header {
text: i18n("Shadows")
}
RowLayout {
width: parent.width
ExclusiveGroup {
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*/
}
}
}
PlasmaComponents.ButtonRow {
Layout.fillWidth: true
spacing: units.smallSpacing
exclusive: true
Component.onCompleted: {
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;
}
property int shadows: plasmoid.configuration.shadows
inStartup = false;
}
onCheckedButtonChanged: {
if (checkedButton.checked)
plasmoid.configuration.shadows = checkedButton.shadow
}
PlasmaComponents.RadioButton {
id: noneShadow
text: i18n("None")
exclusiveGroup: shadowsGroup
checked: parent.shadows === shadow
readonly property int shadow: 0
}
PlasmaComponents.RadioButton {
id: lockedAppletsShadow
text: i18n("Only for locked applets")
exclusiveGroup: shadowsGroup
checked: parent.shadows === shadow
readonly property int shadow: 1
}
PlasmaComponents.RadioButton {
id: allAppletsShadow
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.components 2.0 as PlasmaComponents
import org.kde.plasma.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{
width: dialog.width - 2*dialog.windowSpace
property int pageHeight: mainColumn.height
Column{
id: mainColumn
spacing: 1.5*theme.defaultFont.pointSize
width: parent.width
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
import "../controls" as ExtraControls
PlasmaComponents.Page {
Layout.maximumWidth: content.width + units.smallSpacing * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
ColumnLayout {
id: content
width: dialog.maxWidth
spacing: units.largeSpacing
anchors.centerIn: parent
//! BEGIN: Location
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Header {
text: i18n("Location")
}
Flow{
width: parent.width
spacing: 2
property bool inStartup: true
property int dockLocation: dock.location
onDockLocationChanged: updateDockLocationVisual();
RowLayout {
id: locationLayout
Layout.fillWidth: true
spacing: 1
property int docksCount: dock.docksCount
onDocksCountChanged: {
lockReservedEdges();
updateDockLocationVisual();
lockReservedEdges()
}
Component.onCompleted: {
lockReservedEdges();
updateDockLocationVisual();
inStartup = false;
ExclusiveGroup {
id: locationGroup
onCurrentChanged: {
if (current.checked) {
dock.location = current.edge
locationLayout.lockReservedEdges()
}
}
}
Component.onCompleted: lockReservedEdges()
function lockReservedEdges() {
var edges = dock.freeEdges();
firstLocation.enabled = false;
secondLocation.enabled = false;
thirdLocation.enabled = false;
fourthLocation.enabled = false;
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;
}
var buttons = visibleChildren
var edges = dock.freeEdges()
for (var i = 0; i < buttons.length; i++) {
buttons[i].enabled = buttons[i].checked || freeEdge(
buttons[i].edge, edges)
}
}
function updateDockLocationVisual(){
if(dockLocation === PlasmaCore.Types.BottomEdge){
firstLocation.enabled = true;
firstLocation.checked = 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;
function freeEdge(edge, edges) {
for (var i = 0; i < edges.length; i++) {
if (edges[i] === edge)
return true
}
return false
}
PlasmaComponents.Button{
id: firstLocation
checkable: true
text: i18nc("bottom location","Bottom")
width: (parent.width / 4) - 2
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("bottom location", "Bottom")
iconSource: "arrow-down"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.BottomEdge
}
}
onClicked: checked=true;
readonly property int edge: PlasmaCore.Types.BottomEdge
}
PlasmaComponents.Button{
id: secondLocation
checkable: true
text: i18nc("left location","Left")
width: (parent.width / 4) - 2
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("left location", "Left")
iconSource: "arrow-left"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.LeftEdge
}
}
onClicked: checked=true;
readonly property int edge: PlasmaCore.Types.LeftEdge
}
PlasmaComponents.Button{
id: thirdLocation
checkable: true
text: i18nc("top location","Top")
width: (parent.width / 4) - 2
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("top location", "Top")
iconSource: "arrow-up"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.TopEdge
}
}
onClicked: checked=true;
readonly property int edge: PlasmaCore.Types.TopEdge
}
PlasmaComponents.Button{
id: fourthLocation
checkable: true
text: i18nc("right location","Right")
width: (parent.width/4) - 2
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("right location", "Right")
iconSource: "arrow-right"
checked: dock.location === edge
checkable: true
exclusiveGroup: locationGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.RightEdge
}
}
onClicked: checked=true;
readonly property int edge: PlasmaCore.Types.RightEdge
}
}
}
//! END: Location
//! BEGIN: Alignment
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
/////////// Applets Alignment //////////////////
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
Header {
text: i18n("Alignment")
}
//user set Panel Positions
// 0-Center, 1-Left, 2-Right, 3-Top, 4-Bottom
Flow{
width: parent.width
spacing: 2
RowLayout {
Layout.fillWidth: true
spacing: 1
property bool inStartup: true
property int panelPosition: plasmoid.configuration.panelPosition
function updatePanelPositionVisual(){
if((panelPosition == Latte.Dock.Left)||(panelPosition == Latte.Dock.Top)){
firstPosition.checked = true;
centerPosition.checked = false;
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: {
if (panelPosition === Latte.Dock.Justify)
dock.addInternalViewSplitter()
else
dock.removeInternalViewSplitter()
}
onPanelPositionChanged: updatePanelPositionVisual();
Component.onCompleted: {
updatePanelPositionVisual();
inStartup = false;
if (panelPosition === Latte.Dock.Justify)
dock.addInternalViewSplitter()
else
dock.removeInternalViewSplitter()
}
PlasmaComponents.Button{
id: firstPosition
checkable: true
text: panelIsVertical ? i18nc("top alignment","Top") : i18nc("left alignment","Left")
width: (parent.width / 4) - 2
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
}
ExclusiveGroup {
id: alignmentGroup
onCurrentChanged: {
if (current.checked)
plasmoid.configuration.panelPosition = current.position
}
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
text: i18nc("center alignment","Center")
width: (parent.width / 4) - 2
iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
exclusiveGroup: alignmentGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Center
}
}
onClicked: checked=true;
property int position: panelIsVertical ? Latte.Dock.Top : Latte.Dock.Left
}
PlasmaComponents.Button{
id: lastPosition
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("center alignment", "Center")
iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
checked: parent.panelPosition === position
checkable: true
text: panelIsVertical ? i18nc("bottom alignment","Bottom") : i18nc("right alignment","Right")
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;
}
exclusiveGroup: alignmentGroup
PlasmaComponents.Button{
id: splitTwoPosition
property int position: Latte.Dock.Center
}
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
text: i18nc("justify alignment","Justify")
width: (parent.width / 4)
exclusiveGroup: alignmentGroup
property int position: panelIsVertical ? Latte.Dock.Bottom : Latte.Dock.Right
}
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18nc("justify alignment", "Justify")
iconSource: "format-justify-fill"
checked: parent.panelPosition === position
checkable: true
exclusiveGroup: alignmentGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Justify;
}
}
onClicked: checked=true;
property int position: Latte.Dock.Justify
}
}
}
//! END: Alignment
//AlwaysVisible = 0,
//AutoHide,
//DodgeActive,
//DodgeMaximized,
//DodgeAllWindows
/********** Panel Visibility ****************/
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
//! BEGIN: Visibility
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Header {
text: i18n("Visibility")
}
//user set Panel Visibility
// 0-AlwaysVisible, 1-AutoHide, 2-DodgeActive, 3-DodgeMaximized, 4-DodgeAllWindows
Flow{
GridLayout {
width: parent.width
spacing: 2
rowSpacing: 1
columnSpacing: 1
columns: 3
property bool inStartup: true
property int mode: dock.visibility.mode
function updateModeVisual(){
if (mode === Latte.Dock.AlwaysVisible)
firstState.checked = true;
else
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;
ExclusiveGroup {
id: visibilityGroup
onCurrentChanged: {
if (current.checked)
dock.visibility.mode = current.mode
}
}
PlasmaComponents.Button{
id: firstState
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Always Visible")
width: (parent.width / 2) - 1
checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.AlwaysVisible
}
}
onClicked: checked=true;
property int mode: Latte.Dock.AlwaysVisible
}
PlasmaComponents.Button{
id: secondState
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Auto Hide")
width: (parent.width / 2) - 1
checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.AutoHide
}
}
onClicked: checked=true;
property int mode: Latte.Dock.AutoHide
}
PlasmaComponents.Button{
id: thirdState
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Dodge Active")
width: (parent.width / 2) - 1
checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeActive
}
}
onClicked: checked=true;
property int mode: Latte.Dock.DodgeActive
}
PlasmaComponents.Button{
id: fourthState
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Dodge Maximized")
width: (parent.width/2) - 1
checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeMaximized
}
}
onClicked: checked=true;
property int mode: Latte.Dock.DodgeMaximized
}
PlasmaComponents.Button{
id: fifthState
checkable: true
PlasmaComponents.Button {
Layout.fillWidth: true
text: i18n("Dodge All Windows")
width: (parent.width/2) - 1
checked: dock.visibility.mode === mode
checkable: true
exclusiveGroup: visibilityGroup
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeAllWindows
}
}
onClicked: checked=true;
property int mode: Latte.Dock.DodgeAllWindows
}
}
}
//! END: Visibility
//! BEGIN: Delay
ColumnLayout {
Layout.fillWidth: true
spacing: units.smallSpacing
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
Header {
text: i18n("Delay")
}
GridLayout{
columns: 2
columnSpacing: 0.3*theme.defaultFont.pointSize
width: parent.width
Row{
Layout.alignment: Qt.AlignHCenter
PlasmaComponents.Label{
text: i18n("Hide:")
RowLayout {
spacing: units.smallSpacing
PlasmaComponents.Label {
Layout.fillWidth: false
horizontalAlignment: Text.AlignRight
text: i18n("Show:")
}
ExtraControls.SpinBox {
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{
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;
}
}
}
suffix: i18n("ms.")
}
Row{
Layout.alignment: Qt.AlignHCenter
PlasmaComponents.Label{
text: i18n("Show:")
PlasmaComponents.Label {
Layout.fillWidth: false
Layout.leftMargin: units.largeSpacing
horizontalAlignment: Text.AlignRight
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{
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;
}
}
}
suffix: i18n("ms.")
}
}
}
//! END: Delay
}
}

@ -21,10 +21,9 @@
import QtQuick 2.0
import QtQuick.Layouts 1.3
import org.kde.plasma.components 2.0 as PlasmaComponents
PlasmaComponents.Label{
font.pointSize: 1.3 * theme.defaultFont.pointSize
import org.kde.plasma.extras 2.0 as PlasmaExtras
PlasmaExtras.Heading {
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
imagePath: "dialogs/background"
//old way to count the dialog width
//Math.max(420,appearancePage.noneShadow.width + appearancePage.lockedAppletsShadow.width + appearancePage.allAppletsShadow.width)
width: 33*theme.defaultFont.pixelSize
height: 37*theme.defaultFont.pixelSize
property int maxWidth: 420 //Math.max(420, behaviorPage.width, appearancePage.width, tasksPage.width)
property int maxHeight: 400
width: content.width + units.smallSpacing * 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" }
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;
}
FontLoader {
id: tangerineFont
name: "Tangerine"
source: "../fonts/tangerine.ttf"
}
ColumnLayout{
width: parent.width - 2*windowSpace
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: windowSpace
ColumnLayout {
id: content
Layout.minimumWidth: width
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
Layout.fillWidth: true
spacing: 0
KQuickControlAddons.QIconItem{
id:logo
width: 1.5*latteTxt.font.pixelSize
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{
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{
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
Layout.rightMargin: units.smallSpacing
Layout.alignment: Qt.AlignRight | Qt.AlignHCenter
horizontalAlignment: Text.AlignRight
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{
id:tabBar
PlasmaComponents.TabBar {
id: tabBar
Layout.fillWidth: true
PlasmaComponents.TabButton{
PlasmaComponents.TabButton {
text: i18n("Behavior")
tab: behaviorPage
}
PlasmaComponents.TabButton{
PlasmaComponents.TabButton {
text: i18n("Appearance")
tab: appearancePage
}
PlasmaComponents.TabButton{
PlasmaComponents.TabButton {
text: i18n("Tasks")
tab: tasksPage
visible: dock.tasksPresent();
visible: dock.tasksPresent()
}
}
Rectangle{
Rectangle {
id: pagesBackground
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 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
border.width: 1
border.color: theme.backgroundColor
PlasmaExtras.ScrollArea{
PlasmaExtras.ScrollArea {
id: scrollArea
anchors.fill: parent
anchors.margins: 3
PlasmaComponents.TabGroup{
width: pagesBackground.width - 6
height: currentTab.pageHeight
privateContents: [
BehaviorConfig{
id: behaviorPage
},
AppearanceConfig{
id: appearancePage
},
TasksConfig{
id: tasksPage
}
]
verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
PlasmaComponents.TabGroup {
id: tabGroup
width: currentTab.Layout.maximumWidth
height: currentTab.Layout.maximumHeight
BehaviorConfig {
id: behaviorPage
}
AppearanceConfig {
id: appearancePage
}
TasksConfig {
id: tasksPage
}
}
}
}
}
Row{
id: actionButtons
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: windowSpace
RowLayout {
id: actionButtons
spacing: 2
width: parent.width - 2*windowSpace
Layout.fillWidth: true
Layout.alignment: Qt.AlignCenter
PlasmaComponents.Button{
enabled: true
text: i18n("Add")
iconSource: "list-add"
spacing: units.largeSpacing
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: {
var edges = dock.freeEdges();
if (edges.length === 0) {
enabled = false;
Component.onCompleted: {
var edges = dock.freeEdges()
if (edges.length === 0) {
enabled = false
}
}
}
}
PlasmaComponents.Button{
enabled: true
text: i18n("Remove")
iconSource: "edit-delete"
width: parent.width/4 - 2
opacity: dock.docksCount > 1 ? 1 : 0
onClicked: dock.removeDock();
}
PlasmaComponents.Button {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Item{
width: parent.width/4 - 2
height: 1
}
text: i18n("Remove")
iconSource: "edit-delete"
visible: dock.docksCount > 1 ? true : false
PlasmaComponents.Button{
enabled: true
text: i18n("Quit")
iconSource: "window-close"
width: parent.width/4 - 2
onClicked: dock.removeDock()
}
PlasmaComponents.Button {
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
* 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
@ -25,199 +24,158 @@ 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.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{
width: dialog.width - 2*dialog.windowSpace
property int pageHeight: mainColumn.height
Column{
id: mainColumn
spacing: 1.5*theme.defaultFont.pointSize
width: parent.width
/******Appearance******/
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
PlasmaComponents.Page {
Layout.maximumWidth: content.width + units.smallSpacing * 2
Layout.maximumHeight: content.height + units.smallSpacing * 2
ColumnLayout {
id: content
width: dialog.maxWidth
spacing: units.largeSpacing
anchors.centerIn: parent
//! BEGIN: Tasks Appearance
ColumnLayout {
spacing: units.smallSpacing
Header {
text: i18n("Appearance")
}
Row{
Item{
width: 2*theme.defaultFont.pixelSize
height: 1
}
Column{
spacing: 0.4*theme.defaultFont.pixelSize
PlasmaComponents.CheckBox {
id: showGlow
text: i18n("Show glow around windows points")
PlasmaComponents.CheckBox {
id: showGlow
text: i18n("Show glow around windows points")
checked: plasmoid.configuration.showGlow
onCheckedChanged: {
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;
}
onClicked: {
plasmoid.configuration.showGlow = checked
}
}
PlasmaComponents.CheckBox {
id: dotsOnActive
text: i18n("Dots on active window")
PlasmaComponents.CheckBox {
id: threeColorsWindows
text: i18n("Different color for minimized windows")
checked: plasmoid.configuration.threeColorsWindows
onCheckedChanged: {
plasmoid.configuration.dotsOnActive = checked;
}
onClicked: {
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 {
id: reverseLinesPosition
text: i18n("Reverse position for lines and dots")
onClicked: {
plasmoid.configuration.dotsOnActive = checked
}
}
onCheckedChanged: {
plasmoid.configuration.reverseLinesPosition = checked;
}
PlasmaComponents.CheckBox {
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************/
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
//! BEGIN: Tasks Interaction
ColumnLayout {
spacing: units.smallSpacing
Header{
Header {
text: i18n("Interaction")
}
Row{
Item{
width: 2*theme.defaultFont.pixelSize
height: 1
}
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 {
id: showPreviewsChk
text: i18n("Preview windows on hovering")
checked: plasmoid.configuration.showToolTips
PlasmaComponents.CheckBox {
id: highlightWindowsChk
text: i18n("Highlight windows on hovering")
onCheckedChanged: {
plasmoid.configuration.highlightWindows = checked;
}
Component.onCompleted: checked = plasmoid.configuration.highlightWindows;
}
onClicked: {
plasmoid.configuration.showToolTips = checked
}
}
PlasmaComponents.CheckBox {
id: windowActionsChk
text: i18n("Show window actions in the context menu")
PlasmaComponents.CheckBox {
id: highlightWindowsChk
text: i18n("Highlight windows on hovering")
checked: plasmoid.configuration.highlightWindows
onCheckedChanged: {
plasmoid.configuration.showWindowActions = checked;
}
onClicked: {
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 {
id: smartLaunchersChk
text: i18n("Show progress information in task buttons")
onClicked: {
plasmoid.configuration.showWindowActions = checked
}
}
onCheckedChanged: {
plasmoid.configuration.smartLaunchersEnabled = checked;
}
PlasmaComponents.CheckBox {
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*******/
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
//! BEGIN: Tasks Filters
ColumnLayout {
spacing: units.smallSpacing
Header {
text: i18n("Filters")
}
Row{
Item{
width: 2*theme.defaultFont.pixelSize
height: 1
PlasmaComponents.CheckBox {
id: showOnlyCurrentScreen
text: i18n("Show only tasks from the current screen")
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{
spacing: 0.4*theme.defaultFont.pixelSize
PlasmaComponents.CheckBox {
id: showOnlyCurrentScreen
text: i18n("Show only tasks from the current screen")
onCheckedChanged: {
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;
}
PlasmaComponents.CheckBox {
id: showOnlyCurrentActivity
text: i18n("Show only tasks from the current activity")
checked: plasmoid.configuration.showOnlyCurrentActivity
onClicked: {
plasmoid.configuration.showOnlyCurrentActivity = checked
}
}
}
//! 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