mirror of
https://github.com/KDE/latte-dock.git
synced 2025-02-03 09:47:22 +03:00
config ui simplified
This commit is contained in:
parent
134a3e7015
commit
b544c80a31
@ -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
|
||||
PlasmaComponents.Page {
|
||||
Layout.maximumWidth: content.width + units.smallSpacing * 2
|
||||
Layout.maximumHeight: content.height + units.smallSpacing * 2
|
||||
|
||||
property int pageHeight: mainColumn.height
|
||||
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: 8
|
||||
|
||||
stepSize: parent.step
|
||||
|
||||
Layout.fillWidth:true
|
||||
|
||||
property bool inStartup:true
|
||||
|
||||
property int tempValue: value
|
||||
|
||||
Component.onCompleted: {
|
||||
value = plasmoid.configuration.iconSize;
|
||||
inStartup = false;
|
||||
function updateIconSize() {
|
||||
if (!pressed) {
|
||||
if (panelSizeSlider.value > value + 4)
|
||||
panelSizeSlider.value = value + 4
|
||||
plasmoid.configuration.iconSize = value
|
||||
}
|
||||
}
|
||||
|
||||
onPressedChanged: {
|
||||
if (!pressed) {
|
||||
plasmoid.configuration.iconSize = value;
|
||||
}
|
||||
updateIconSize()
|
||||
}
|
||||
|
||||
onTempValueChanged:{
|
||||
if(!inStartup && !pressed){
|
||||
plasmoid.configuration.iconSize = value;
|
||||
}
|
||||
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);
|
||||
function updateZoomLevel() {
|
||||
if (!pressed) {
|
||||
var result = Math.round((value - 1) * 20)
|
||||
plasmoid.configuration.zoomLevel = result
|
||||
}
|
||||
}
|
||||
|
||||
onPressedChanged: {
|
||||
if (!pressed) {
|
||||
var result = Math.round((value - 1)*20)
|
||||
plasmoid.configuration.zoomLevel = result
|
||||
}
|
||||
updateZoomLevel()
|
||||
}
|
||||
|
||||
onTempValueChanged:{
|
||||
if(!inStartup && !pressed){
|
||||
var result = Math.round((value - 1)*20)
|
||||
plasmoid.configuration.zoomLevel = result
|
||||
}
|
||||
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
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 0;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: secondDuration
|
||||
checked: parent.duration === duration
|
||||
checkable: true
|
||||
exclusiveGroup: animationsGroup
|
||||
|
||||
readonly property int duration: 0
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("x1")
|
||||
width: (parent.width / 4) - 2
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 1;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: thirdDuration
|
||||
checked: parent.duration === duration
|
||||
checkable: true
|
||||
exclusiveGroup: animationsGroup
|
||||
|
||||
readonly property int duration: 1
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("x2")
|
||||
width: (parent.width / 4) - 2
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 2;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: fourthDuration
|
||||
checked: parent.duration === duration
|
||||
checkable: true
|
||||
text: i18n("x3")
|
||||
width: (parent.width/4) - 1
|
||||
exclusiveGroup: animationsGroup
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.durationTime = 3;
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
readonly property int duration: 2
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("x3")
|
||||
checked: parent.duration === duration
|
||||
checkable: true
|
||||
exclusiveGroup: animationsGroup
|
||||
|
||||
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;
|
||||
onClicked: {
|
||||
plasmoid.configuration.useThemePanel = checked
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
checked = plasmoid.configuration.useThemePanel;
|
||||
inStartup = false;
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout{
|
||||
width: parent.width
|
||||
|
||||
PlasmaComponents.Slider{
|
||||
id:panelSizeSlider
|
||||
enabled: showBackground.checked
|
||||
valueIndicatorText: i18n("Size")
|
||||
valueIndicatorVisible: true
|
||||
|
||||
minimumValue: 0
|
||||
maximumValue: 256
|
||||
|
||||
stepSize: 2
|
||||
|
||||
Layout.fillWidth:true
|
||||
|
||||
property bool inStartup: true
|
||||
property int tempValue: value
|
||||
|
||||
Component.onCompleted: {
|
||||
value = plasmoid.configuration.panelSize
|
||||
inStartup = false;
|
||||
}
|
||||
|
||||
onPressedChanged: {
|
||||
if (!pressed) {
|
||||
plasmoid.configuration.panelSize = value;
|
||||
}
|
||||
}
|
||||
|
||||
onTempValueChanged:{
|
||||
if(!inStartup && !pressed){
|
||||
plasmoid.configuration.panelSize = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.Label{
|
||||
enabled: showBackground.checked
|
||||
text: panelSizeSlider.value + " px."
|
||||
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 4
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/******Shadows**********/
|
||||
Column{
|
||||
width: parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
Header{
|
||||
text: i18n("Shadows")
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
width: parent.width
|
||||
Layout.fillWidth: true
|
||||
|
||||
ExclusiveGroup {
|
||||
id: shadowsGroup
|
||||
property bool inStartup: true
|
||||
PlasmaComponents.Slider {
|
||||
id: panelSizeSlider
|
||||
Layout.fillWidth: true
|
||||
enabled: showBackground.checked
|
||||
|
||||
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*/
|
||||
}
|
||||
}
|
||||
value: plasmoid.configuration.panelSize
|
||||
minimumValue: 0
|
||||
maximumValue: plasmoid.configuration.iconSize + 4
|
||||
stepSize: 2
|
||||
|
||||
function updatePanelSize() {
|
||||
if (!pressed)
|
||||
plasmoid.configuration.panelSize = value
|
||||
}
|
||||
|
||||
onPressedChanged: {
|
||||
updatePanelSize()
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
inStartup = false;
|
||||
valueChanged.connect(updatePanelSize)
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.RadioButton {
|
||||
id: noneShadow
|
||||
text: i18n("None")
|
||||
exclusiveGroup: shadowsGroup
|
||||
PlasmaComponents.Label {
|
||||
enabled: showBackground.checked
|
||||
text: panelSizeSlider.value + " px."
|
||||
horizontalAlignment: Text.AlignRight
|
||||
Layout.minimumWidth: theme.mSize(theme.defaultFont).width * 5
|
||||
}
|
||||
PlasmaComponents.RadioButton {
|
||||
id: lockedAppletsShadow
|
||||
text: i18n("Only for locked applets")
|
||||
exclusiveGroup: shadowsGroup
|
||||
}
|
||||
PlasmaComponents.RadioButton {
|
||||
id: allAppletsShadow
|
||||
text: i18n("All applets")
|
||||
exclusiveGroup: shadowsGroup
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//! END: Background
|
||||
|
||||
//! BEGIN: Shadows
|
||||
Column {
|
||||
Layout.fillWidth: true
|
||||
spacing: units.smallSpacing
|
||||
|
||||
Header {
|
||||
text: i18n("Shadows")
|
||||
}
|
||||
|
||||
PlasmaComponents.ButtonRow {
|
||||
Layout.fillWidth: true
|
||||
spacing: units.smallSpacing
|
||||
exclusive: true
|
||||
|
||||
property int shadows: plasmoid.configuration.shadows
|
||||
|
||||
onCheckedButtonChanged: {
|
||||
if (checkedButton.checked)
|
||||
plasmoid.configuration.shadows = checkedButton.shadow
|
||||
}
|
||||
|
||||
PlasmaComponents.RadioButton {
|
||||
text: i18n("None")
|
||||
checked: parent.shadows === shadow
|
||||
|
||||
readonly property int shadow: 0
|
||||
}
|
||||
PlasmaComponents.RadioButton {
|
||||
text: i18n("Only for locked applets")
|
||||
checked: parent.shadows === shadow
|
||||
|
||||
readonly property int shadow: 1
|
||||
}
|
||||
PlasmaComponents.RadioButton {
|
||||
text: i18n("All applets")
|
||||
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
|
||||
import "../controls" as ExtraControls
|
||||
|
||||
PlasmaComponents.Page{
|
||||
width: dialog.width - 2*dialog.windowSpace
|
||||
PlasmaComponents.Page {
|
||||
Layout.maximumWidth: content.width + units.smallSpacing * 2
|
||||
Layout.maximumHeight: content.height + units.smallSpacing * 2
|
||||
|
||||
property int pageHeight: mainColumn.height
|
||||
ColumnLayout {
|
||||
id: content
|
||||
|
||||
Column{
|
||||
id: mainColumn
|
||||
spacing: 1.5*theme.defaultFont.pointSize
|
||||
width: parent.width
|
||||
width: dialog.maxWidth
|
||||
spacing: units.largeSpacing
|
||||
anchors.centerIn: parent
|
||||
|
||||
Column{
|
||||
width:parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
//! BEGIN: Location
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: units.smallSpacing
|
||||
|
||||
Header{
|
||||
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();
|
||||
var buttons = visibleChildren
|
||||
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;
|
||||
}
|
||||
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"
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.location = PlasmaCore.Types.BottomEdge
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: secondLocation
|
||||
checked: dock.location === edge
|
||||
checkable: true
|
||||
text: i18nc("left location","Left")
|
||||
width: (parent.width / 4) - 2
|
||||
exclusiveGroup: locationGroup
|
||||
|
||||
readonly property int edge: PlasmaCore.Types.BottomEdge
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18nc("left location", "Left")
|
||||
iconSource: "arrow-left"
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.location = PlasmaCore.Types.LeftEdge
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: thirdLocation
|
||||
checked: dock.location === edge
|
||||
checkable: true
|
||||
text: i18nc("top location","Top")
|
||||
width: (parent.width / 4) - 2
|
||||
exclusiveGroup: locationGroup
|
||||
|
||||
readonly property int edge: PlasmaCore.Types.LeftEdge
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18nc("top location", "Top")
|
||||
iconSource: "arrow-up"
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.location = PlasmaCore.Types.TopEdge
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: fourthLocation
|
||||
checked: dock.location === edge
|
||||
checkable: true
|
||||
text: i18nc("right location","Right")
|
||||
width: (parent.width/4) - 2
|
||||
iconSource: "arrow-right"
|
||||
exclusiveGroup: locationGroup
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.location = PlasmaCore.Types.RightEdge
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
readonly property int edge: PlasmaCore.Types.TopEdge
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18nc("right location", "Right")
|
||||
iconSource: "arrow-right"
|
||||
checked: dock.location === edge
|
||||
checkable: true
|
||||
exclusiveGroup: locationGroup
|
||||
|
||||
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
|
||||
checkable: true
|
||||
text: i18nc("center alignment","Center")
|
||||
width: (parent.width / 4) - 2
|
||||
iconSource: panelIsVertical ? "format-align-vertical-center" : "format-justify-center"
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
plasmoid.configuration.panelPosition = Latte.Dock.Center
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: lastPosition
|
||||
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;
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: splitTwoPosition
|
||||
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("justify alignment","Justify")
|
||||
width: (parent.width / 4)
|
||||
exclusiveGroup: alignmentGroup
|
||||
|
||||
property int position: panelIsVertical ? Latte.Dock.Top : Latte.Dock.Left
|
||||
}
|
||||
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
|
||||
exclusiveGroup: alignmentGroup
|
||||
|
||||
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
|
||||
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 ****************/
|
||||
//! BEGIN: Visibility
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: units.smallSpacing
|
||||
|
||||
Column{
|
||||
width:parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
Header{
|
||||
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;
|
||||
ExclusiveGroup {
|
||||
id: visibilityGroup
|
||||
onCurrentChanged: {
|
||||
if (current.checked)
|
||||
dock.visibility.mode = current.mode
|
||||
}
|
||||
}
|
||||
|
||||
onModeChanged: updateModeVisual();
|
||||
|
||||
Component.onCompleted: {
|
||||
updateModeVisual();
|
||||
inStartup = false;
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: firstState
|
||||
checkable: true
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("Always Visible")
|
||||
width: (parent.width / 2) - 1
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.visibility.mode = Latte.Dock.AlwaysVisible
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: secondState
|
||||
checked: dock.visibility.mode === mode
|
||||
checkable: true
|
||||
exclusiveGroup: visibilityGroup
|
||||
|
||||
property int mode: Latte.Dock.AlwaysVisible
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("Auto Hide")
|
||||
width: (parent.width / 2) - 1
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.visibility.mode = Latte.Dock.AutoHide
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
PlasmaComponents.Button{
|
||||
id: thirdState
|
||||
checked: dock.visibility.mode === mode
|
||||
checkable: true
|
||||
exclusiveGroup: visibilityGroup
|
||||
|
||||
property int mode: Latte.Dock.AutoHide
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("Dodge Active")
|
||||
width: (parent.width / 2) - 1
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.visibility.mode = Latte.Dock.DodgeActive
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: fourthState
|
||||
checked: dock.visibility.mode === mode
|
||||
checkable: true
|
||||
exclusiveGroup: visibilityGroup
|
||||
|
||||
property int mode: Latte.Dock.DodgeActive
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("Dodge Maximized")
|
||||
width: (parent.width/2) - 1
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.visibility.mode = Latte.Dock.DodgeMaximized
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
id: fifthState
|
||||
checked: dock.visibility.mode === mode
|
||||
checkable: true
|
||||
text: i18n("Dodge All Windows")
|
||||
width: (parent.width/2) - 1
|
||||
exclusiveGroup: visibilityGroup
|
||||
|
||||
onCheckedChanged: {
|
||||
if(checked && !parent.inStartup){
|
||||
dock.visibility.mode = Latte.Dock.DodgeAllWindows
|
||||
}
|
||||
}
|
||||
onClicked: checked=true;
|
||||
property int mode: Latte.Dock.DodgeMaximized
|
||||
}
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("Dodge All Windows")
|
||||
checked: dock.visibility.mode === mode
|
||||
checkable: true
|
||||
exclusiveGroup: visibilityGroup
|
||||
|
||||
property int mode: Latte.Dock.DodgeAllWindows
|
||||
}
|
||||
}
|
||||
}
|
||||
//! END: Visibility
|
||||
|
||||
Column{
|
||||
width:parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
Header{
|
||||
//! BEGIN: Delay
|
||||
ColumnLayout {
|
||||
Layout.fillWidth: true
|
||||
spacing: units.smallSpacing
|
||||
|
||||
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:")
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
|
||||
Row{
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
PlasmaComponents.Label{
|
||||
text: i18n("Show:")
|
||||
onValueChanged: {
|
||||
dock.visibility.timerShow = value
|
||||
}
|
||||
|
||||
LatteTextField{
|
||||
width: 9.5 * theme.defaultFont.pixelSize
|
||||
property bool inStartup: true
|
||||
suffix: i18n("ms.")
|
||||
}
|
||||
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
|
||||
|
||||
Component.onCompleted: {
|
||||
value = dock.visibility.timerShow
|
||||
inStartup = false;
|
||||
}
|
||||
|
||||
onValueChanged: {
|
||||
if(!inStartup){
|
||||
dock.visibility.timerShow = value;
|
||||
}
|
||||
}
|
||||
onValueChanged: {
|
||||
dock.visibility.timerHide = 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
|
||||
}
|
||||
|
242
shell/contents/configuration/LatteDockConfiguration.qml
Normal file
242
shell/contents/configuration/LatteDockConfiguration.qml
Normal file
@ -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
|
||||
|
||||
spacing: 0
|
||||
Layout.minimumWidth: width
|
||||
Layout.minimumHeight: height
|
||||
Layout.preferredWidth: width
|
||||
Layout.preferredHeight: height
|
||||
height: header.height + tabBar.height + pagesBackground.height + actionButtons.height + spacing * 3
|
||||
|
||||
RowLayout{
|
||||
anchors.centerIn: parent
|
||||
spacing: units.smallSpacing
|
||||
|
||||
RowLayout {
|
||||
id: header
|
||||
Layout.fillWidth: true
|
||||
spacing: 0
|
||||
|
||||
KQuickControlAddons.QIconItem{
|
||||
id:logo
|
||||
KQuickControlAddons.QIconItem {
|
||||
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
|
||||
|
||||
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 {
|
||||
id: scrollArea
|
||||
|
||||
PlasmaExtras.ScrollArea{
|
||||
anchors.fill: parent
|
||||
anchors.margins: 3
|
||||
verticalScrollBarPolicy: Qt.ScrollBarAlwaysOn
|
||||
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOff
|
||||
|
||||
PlasmaComponents.TabGroup{
|
||||
width: pagesBackground.width - 6
|
||||
height: currentTab.pageHeight
|
||||
PlasmaComponents.TabGroup {
|
||||
id: tabGroup
|
||||
|
||||
privateContents: [
|
||||
BehaviorConfig{
|
||||
id: behaviorPage
|
||||
},
|
||||
AppearanceConfig{
|
||||
id: appearancePage
|
||||
},
|
||||
TasksConfig{
|
||||
id: tasksPage
|
||||
}
|
||||
]
|
||||
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
|
||||
|
||||
onClicked: dock.addNewDock();
|
||||
text: i18n("Add")
|
||||
iconSource: "list-add"
|
||||
|
||||
Component.onCompleted: {
|
||||
var edges = dock.freeEdges();
|
||||
if (edges.length === 0) {
|
||||
enabled = false;
|
||||
onClicked: dock.addNewDock()
|
||||
|
||||
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
|
||||
PlasmaComponents.Button {
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
onClicked: dock.removeDock();
|
||||
}
|
||||
text: i18n("Remove")
|
||||
iconSource: "edit-delete"
|
||||
visible: dock.docksCount > 1 ? true : false
|
||||
|
||||
Item{
|
||||
width: parent.width/4 - 2
|
||||
height: 1
|
||||
}
|
||||
onClicked: dock.removeDock()
|
||||
}
|
||||
|
||||
PlasmaComponents.Button{
|
||||
enabled: true
|
||||
text: i18n("Quit")
|
||||
iconSource: "window-close"
|
||||
width: parent.width/4 - 2
|
||||
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
|
||||
PlasmaComponents.Page {
|
||||
Layout.maximumWidth: content.width + units.smallSpacing * 2
|
||||
Layout.maximumHeight: content.height + units.smallSpacing * 2
|
||||
|
||||
property int pageHeight: mainColumn.height
|
||||
ColumnLayout {
|
||||
id: content
|
||||
width: dialog.maxWidth
|
||||
spacing: units.largeSpacing
|
||||
anchors.centerIn: parent
|
||||
|
||||
Column{
|
||||
id: mainColumn
|
||||
spacing: 1.5*theme.defaultFont.pointSize
|
||||
width: parent.width
|
||||
//! BEGIN: Tasks Appearance
|
||||
ColumnLayout {
|
||||
spacing: units.smallSpacing
|
||||
|
||||
/******Appearance******/
|
||||
Column{
|
||||
width:parent.width
|
||||
spacing: 0.8*theme.defaultFont.pointSize
|
||||
|
||||
Header{
|
||||
Header {
|
||||
text: i18n("Appearance")
|
||||
}
|
||||
|
||||
Row{
|
||||
Item{
|
||||
width: 2*theme.defaultFont.pixelSize
|
||||
height: 1
|
||||
PlasmaComponents.CheckBox {
|
||||
id: showGlow
|
||||
text: i18n("Show glow around windows points")
|
||||
checked: plasmoid.configuration.showGlow
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.showGlow = checked
|
||||
}
|
||||
}
|
||||
|
||||
Column{
|
||||
spacing: 0.4*theme.defaultFont.pixelSize
|
||||
PlasmaComponents.CheckBox {
|
||||
id: threeColorsWindows
|
||||
text: i18n("Different color for minimized windows")
|
||||
checked: plasmoid.configuration.threeColorsWindows
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: showGlow
|
||||
text: i18n("Show glow around windows points")
|
||||
onClicked: {
|
||||
plasmoid.configuration.threeColorsWindows = checked
|
||||
}
|
||||
}
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.showGlow = checked;
|
||||
}
|
||||
PlasmaComponents.CheckBox {
|
||||
id: dotsOnActive
|
||||
text: i18n("Dots on active window")
|
||||
checked: plasmoid.configuration.dotsOnActive
|
||||
|
||||
Component.onCompleted: checked = plasmoid.configuration.showGlow;
|
||||
}
|
||||
onClicked: {
|
||||
plasmoid.configuration.dotsOnActive = checked
|
||||
}
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: threeColorsWindows
|
||||
text: i18n("Different color for minimized windows")
|
||||
PlasmaComponents.CheckBox {
|
||||
id: reverseLinesPosition
|
||||
text: i18n("Reverse position for lines and dots")
|
||||
checked: plasmoid.configuration.reverseLinesPosition
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.threeColorsWindows = checked;
|
||||
}
|
||||
|
||||
Component.onCompleted: checked = plasmoid.configuration.threeColorsWindows;
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: dotsOnActive
|
||||
text: i18n("Dots on active window")
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.dotsOnActive = checked;
|
||||
}
|
||||
|
||||
Component.onCompleted: checked = plasmoid.configuration.dotsOnActive;
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: reverseLinesPosition
|
||||
text: i18n("Reverse position for lines and dots")
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.reverseLinesPosition = checked;
|
||||
}
|
||||
|
||||
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
|
||||
PlasmaComponents.CheckBox {
|
||||
id: showPreviewsChk
|
||||
text: i18n("Preview windows on hovering")
|
||||
checked: plasmoid.configuration.showToolTips
|
||||
|
||||
onClicked: {
|
||||
plasmoid.configuration.showToolTips = checked
|
||||
}
|
||||
Column{
|
||||
spacing: 0.4*theme.defaultFont.pixelSize
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: showPreviewsChk
|
||||
text: i18n("Preview windows on hovering")
|
||||
PlasmaComponents.CheckBox {
|
||||
id: highlightWindowsChk
|
||||
text: i18n("Highlight windows on hovering")
|
||||
checked: plasmoid.configuration.highlightWindows
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.showToolTips = checked;
|
||||
}
|
||||
onClicked: {
|
||||
plasmoid.configuration.highlightWindows = checked
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: checked = plasmoid.configuration.showToolTips;
|
||||
}
|
||||
PlasmaComponents.CheckBox {
|
||||
id: windowActionsChk
|
||||
text: i18n("Show window actions in the context menu")
|
||||
checked: plasmoid.configuration.showWindowActions
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: highlightWindowsChk
|
||||
text: i18n("Highlight windows on hovering")
|
||||
onClicked: {
|
||||
plasmoid.configuration.showWindowActions = checked
|
||||
}
|
||||
}
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.highlightWindows = checked;
|
||||
}
|
||||
PlasmaComponents.CheckBox {
|
||||
id: smartLaunchersChk
|
||||
text: i18n("Show progress information in task buttons")
|
||||
checked: plasmoid.configuration.smartLaunchersEnabled
|
||||
|
||||
Component.onCompleted: checked = plasmoid.configuration.highlightWindows;
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: windowActionsChk
|
||||
text: i18n("Show window actions in the context menu")
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.showWindowActions = checked;
|
||||
}
|
||||
|
||||
Component.onCompleted: checked = plasmoid.configuration.showWindowActions;
|
||||
}
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: smartLaunchersChk
|
||||
text: i18n("Show progress information in task buttons")
|
||||
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.smartLaunchersEnabled = checked;
|
||||
}
|
||||
|
||||
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
|
||||
//! BEGIN: Tasks Filters
|
||||
ColumnLayout {
|
||||
spacing: units.smallSpacing
|
||||
|
||||
Header{
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
Column{
|
||||
spacing: 0.4*theme.defaultFont.pixelSize
|
||||
PlasmaComponents.CheckBox {
|
||||
id: showOnlyCurrentDesktop
|
||||
text: i18n("Show only tasks from the current desktop")
|
||||
checked: plasmoid.configuration.showOnlyCurrentDesktop
|
||||
|
||||
PlasmaComponents.CheckBox {
|
||||
id: showOnlyCurrentScreen
|
||||
text: i18n("Show only tasks from the current screen")
|
||||
onCheckedChanged: {
|
||||
plasmoid.configuration.showOnlyCurrentScreen = checked;
|
||||
}
|
||||
onClicked: {
|
||||
plasmoid.configuration.showOnlyCurrentDesktop = checked
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: checked = plasmoid.configuration.showOnlyCurrentScreen;
|
||||
}
|
||||
PlasmaComponents.CheckBox {
|
||||
id: showOnlyCurrentActivity
|
||||
text: i18n("Show only tasks from the current activity")
|
||||
checked: plasmoid.configuration.showOnlyCurrentActivity
|
||||
|
||||
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;
|
||||
}
|
||||
onClicked: {
|
||||
plasmoid.configuration.showOnlyCurrentActivity = checked
|
||||
}
|
||||
}
|
||||
}
|
||||
//! END: Tasks Filters
|
||||
}
|
||||
}
|
||||
|
40
shell/contents/controls/SpinBox.qml
Normal file
40
shell/contents/controls/SpinBox.qml
Normal file
@ -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…
x
Reference in New Issue
Block a user