new configuration window with tabs

pull/1/head
Michail Vourlakos 8 years ago
parent 285090d961
commit 87d1cde1b3

@ -0,0 +1,296 @@
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.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{
width: dialog.width - 2*dialog.windowSpace
height: appearanceColumn.height
Column{
id: appearanceColumn
spacing: 1.5*theme.defaultFont.pointSize
width: parent.width
//////////////// Applets Size
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Applets Size")
}
RowLayout{
width: parent.width
property int step: 8
PlasmaComponents.Button{
text:"-"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: appletsSizeSlider.value -= parent.step
}
PlasmaComponents.Slider{
id:appletsSizeSlider
valueIndicatorText: i18n("Applets Size")
valueIndicatorVisible: true
minimumValue: 16
maximumValue: 128
stepSize: parent.step
Layout.fillWidth:true
property bool inStartup:true
Component.onCompleted: {
value = plasmoid.configuration.iconSize;
inStartup = false;
}
onValueChanged:{
if(!inStartup){
plasmoid.configuration.iconSize = value;
}
}
}
PlasmaComponents.Button{
text:"+"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: appletsSizeSlider.value += parent.step;
}
PlasmaComponents.Label{
text: plasmoid.configuration.iconSize + " px."
}
}
}
/********** Zoom On Hover ****************/
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Zoom On Hover")
}
RowLayout{
width: parent.width
PlasmaComponents.Button{
text:"-"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: zoomSlider.value -= 0.05
}
PlasmaComponents.Slider{
id:zoomSlider
valueIndicatorText: i18n("Zoom Factor")
valueIndicatorVisible: true
minimumValue: 1
maximumValue: 2
stepSize: 0.05
Layout.fillWidth:true
property bool inStartup:true
Component.onCompleted: {
value = Number(1 + plasmoid.configuration.zoomLevel/20).toFixed(2)
inStartup = false;
// console.log("Slider:"+value);
}
onValueChanged:{
if(!inStartup){
var result = Math.round((value - 1)*20)
plasmoid.configuration.zoomLevel = result
// console.log("Store:"+result);
}
}
}
PlasmaComponents.Button{
text:"+"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: zoomSlider.value += 0.05
}
PlasmaComponents.Label{
enabled: showBackground.checked
text: " "+Number(zoomSlider.value).toFixed(2)
}
}
}
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Background")
}
PlasmaComponents.CheckBox{
id: showBackground
text: i18n("Show Panel Background")
property bool inStartup: true
onCheckedChanged:{
if(!inStartup)
plasmoid.configuration.useThemePanel = checked;
}
Component.onCompleted: {
checked = plasmoid.configuration.useThemePanel;
inStartup = false;
}
}
RowLayout{
width: parent.width
PlasmaComponents.Button{
enabled: showBackground.checked
text:"-"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: panelSizeSlider.value -= 2
}
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
Component.onCompleted: {
value = plasmoid.configuration.panelSize
inStartup = false;
}
onValueChanged: {
if(!inStartup)
plasmoid.configuration.panelSize = value;
}
}
PlasmaComponents.Button{
enabled: showBackground.checked
text:"+"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: panelSizeSlider.value += 2
}
PlasmaComponents.Label{
enabled: showBackground.checked
text: panelSizeSlider.value + " px."
}
}
}
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
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*/
}
}
}
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;
}
}
PlasmaComponents.RadioButton {
id: noneShadow
text: i18n("None")
exclusiveGroup: shadowsGroup
}
PlasmaComponents.RadioButton {
id: lockedAppletsShadow
text: i18n("Only for locked applets")
exclusiveGroup: shadowsGroup
}
PlasmaComponents.RadioButton {
id: allAppletsShadow
text: i18n("All applets")
exclusiveGroup: shadowsGroup
}
}
}
}
}

@ -0,0 +1,401 @@
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.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{
width: dialog.width - 2*dialog.windowSpace
Column{
spacing: 1.5*theme.defaultFont.pointSize
width: parent.width
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Location")
}
Flow{
width: parent.width
spacing: 2
property bool inStartup: true
property int dockLocation: dock.location
onDockLocationChanged: updateDockLocationVisual();
Component.onCompleted: {
lockReservedEdges();
updateDockLocationVisual();
inStartup = false;
}
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;
}
}
}
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;
}
}
PlasmaComponents.Button{
id: firstLocation
checkable: true
text: i18n("Bottom")
width: (parent.width / 4) - 2
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.BottomEdge
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: secondLocation
checkable: true
text: i18n("Left")
width: (parent.width / 4) - 2
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.LeftEdge
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: thirdLocation
checkable: true
text: i18n("Top")
width: (parent.width / 4) - 2
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.TopEdge
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: fourthLocation
checkable: true
text: i18n("Right")
width: (parent.width/4) - 1
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.RightEdge
}
}
onClicked: checked=true;
}
}
}
/////////// Applets Alignment //////////////////
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Applets Alignment")
}
//user set Panel Positions
// 0-Center, 1-Left, 2-Right, 3-Top, 4-Bottom
Flow{
width: parent.width
spacing: 2
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.Double){
firstPosition.checked = false;
centerPosition.checked = false;
lastPosition.checked = false;
splitTwoPosition.checked = true;
//add the splitter visual
dock.addInternalViewSplitter();
}
}
onPanelPositionChanged: updatePanelPositionVisual();
Component.onCompleted: {
updatePanelPositionVisual();
inStartup = false;
}
PlasmaComponents.Button{
id: firstPosition
checkable: true
text: panelIsVertical ? i18n("Top") : i18n("Left")
width: (parent.width / 3) - 1
onCheckedChanged: {
if(checked && !parent.inStartup){
if(panelIsVertical)
plasmoid.configuration.panelPosition = Latte.Dock.Top
else
plasmoid.configuration.panelPosition = Latte.Dock.Left
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: centerPosition
checkable: true
text: i18n("Center")
width: (parent.width / 3) - 1
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Center
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: lastPosition
checkable: true
text: panelIsVertical ? i18n("Bottom") : i18n("Right")
width: (parent.width / 3) - 2
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
checkable: true
text: panelIsVertical ? i18n("Top")+ " | "+ i18n("Bottom") : i18n("Left") +" | "+ i18n("Right")
width: parent.width
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Double;
}
}
onClicked: checked=true;
}
}
}
//AlwaysVisible = 0,
//AutoHide,
//DodgeActive,
//DodgeMaximized,
//DodgeAllWindows
/********** Panel Visibility ****************/
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
Header{
text: i18n("Visibility")
}
//user set Panel Visibility
// 0-AlwaysVisible, 1-AutoHide, 2-DodgeActive, 3-DodgeMaximized, 4-DodgeAllWindows
Flow{
width: parent.width
spacing: 2
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;
}
PlasmaComponents.Button{
id: firstState
checkable: 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
checkable: 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
checkable: 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
checkable: 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
checkable: true
text: i18n("Dodge All Windows")
width: (parent.width/2) - 1
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeAllWindows
}
}
onClicked: checked=true;
}
}
}
}
}

@ -0,0 +1,10 @@
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
Layout.alignment: Qt.AlignLeft
}

@ -8,730 +8,147 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
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"
width: Math.max(420,noneShadow.width + lockedAppletsShadow.width + allAppletsShadow.width)
height: mainColumn.height+2*windowSpace
//old way to count the dialog width
//Math.max(420,appearancePage.noneShadow.width + appearancePage.lockedAppletsShadow.width + appearancePage.allAppletsShadow.width)
width: 31*theme.defaultFont.pixelSize
height: 37*theme.defaultFont.pixelSize
property bool panelIsVertical: plasmoid.formFactor === PlasmaCore.Types.Vertical
property int windowSpace:8
signal updateThickness();
FontLoader { id: tangerineFont; name: "Tangerine"; source: "../fonts/tangerine.ttf" }
Column{
id:mainColumn
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
spacing: 1.5*theme.defaultFont.pointSize
ColumnLayout{
width: parent.width - 2*windowSpace
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: windowSpace
//////////// Location ////////////////
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
RowLayout{
width: parent.width
PlasmaComponents.Label{
text: i18n("Location")
font.pointSize: 1.5 * theme.defaultFont.pointSize
Layout.alignment: Qt.AlignLeft
}
PlasmaComponents.Label{
font.pointSize: theme.defaultFont.pointSize
font.italic: true
opacity: 0.6
Layout.alignment: Qt.AlignRight
horizontalAlignment: Text.AlignRight
text: i18n("ver: ") +"@VERSION@"
}
}
Flow{
width: parent.width
spacing: 2
property bool inStartup: true
property int dockLocation: dock.location
onDockLocationChanged: updateDockLocationVisual();
Component.onCompleted: {
lockReservedEdges();
updateDockLocationVisual();
inStartup = false;
}
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;
}
}
}
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;
}
}
spacing: 0
PlasmaComponents.Button{
id: firstLocation
checkable: true
text: i18n("Bottom")
width: (parent.width / 4) - 2
RowLayout{
id: header
Layout.fillWidth: true
spacing: 0
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.BottomEdge
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: secondLocation
checkable: true
text: i18n("Left")
width: (parent.width / 4) - 2
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.LeftEdge
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: thirdLocation
checkable: true
text: i18n("Top")
width: (parent.width / 4) - 2
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.TopEdge
}
}
onClicked: checked=true;
}
KQuickControlAddons.QIconItem{
id:logo
PlasmaComponents.Button{
id: fourthLocation
checkable: true
text: i18n("Right")
width: (parent.width/4) - 1
width: 1.5*latteTxt.font.pixelSize
height: width
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.location = PlasmaCore.Types.RightEdge
}
}
onClicked: checked=true;
}
icon: "latte-dock"
}
}
/////////// Applets Alignment //////////////////
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
PlasmaComponents.Label{
text: i18n("Applets Alignment")
font.pointSize: 1.5 * theme.defaultFont.pointSize
id: latteTxt
text: i18n("atte")
font.family: tangerineFont.name
font.pointSize: 2 * theme.defaultFont.pointSize
font.italic: true
Layout.alignment: Qt.AlignLeft
}
//user set Panel Positions
// 0-Center, 1-Left, 2-Right, 3-Top, 4-Bottom
Flow{
width: parent.width
spacing: 2
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.Double){
firstPosition.checked = false;
centerPosition.checked = false;
lastPosition.checked = false;
splitTwoPosition.checked = true;
//add the splitter visual
dock.addInternalViewSplitter();
}
}
onPanelPositionChanged: updatePanelPositionVisual();
Component.onCompleted: {
updatePanelPositionVisual();
inStartup = false;
}
PlasmaComponents.Button{
id: firstPosition
checkable: true
text: panelIsVertical ? i18n("Top") : i18n("Left")
width: (parent.width / 3) - 1
onCheckedChanged: {
if(checked && !parent.inStartup){
if(panelIsVertical)
plasmoid.configuration.panelPosition = Latte.Dock.Top
else
plasmoid.configuration.panelPosition = Latte.Dock.Left
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: centerPosition
checkable: true
text: i18n("Center")
width: (parent.width / 3) - 1
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Center
}
}
onClicked: checked=true;
}
PlasmaComponents.Button{
id: lastPosition
checkable: true
text: panelIsVertical ? i18n("Bottom") : i18n("Right")
width: (parent.width / 3) - 2
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
checkable: true
text: panelIsVertical ? i18n("Top")+ " | "+ i18n("Bottom") : i18n("Left") +" | "+ i18n("Right")
width: parent.width
onCheckedChanged: {
if(checked && !parent.inStartup){
plasmoid.configuration.panelPosition = Latte.Dock.Double;
}
}
onClicked: checked=true;
}
}
}
//AlwaysVisible = 0,
//AutoHide,
//DodgeActive,
//DodgeMaximized,
//DodgeAllWindows
/********** Panel Visibility ****************/
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
PlasmaComponents.Label{
text: i18n("Visibility")
font.pointSize: 1.5 * theme.defaultFont.pointSize
}
//user set Panel Visibility
// 0-AlwaysVisible, 1-AutoHide, 2-DodgeActive, 3-DodgeMaximized, 4-DodgeAllWindows
Flow{
width: parent.width
spacing: 2
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;
}
id: verLabel
font.family: "serif"
font.pointSize: theme.defaultFont.pointSize
font.italic: true
opacity: 0.6
onModeChanged: updateModeVisual();
Component.onCompleted: {
updateModeVisual();
inStartup = false;
}
Layout.alignment: Qt.AlignRight
horizontalAlignment: Text.AlignRight
Layout.fillWidth: true
PlasmaComponents.Button{
id: firstState
checkable: 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
checkable: 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
checkable: 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
checkable: 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
checkable: true
text: i18n("Dodge All Windows")
width: (parent.width/2) - 1
onCheckedChanged: {
if(checked && !parent.inStartup){
dock.visibility.mode = Latte.Dock.DodgeAllWindows
}
}
onClicked: checked=true;
}
text: i18n("ver: ") +"@VERSION@"
}
}
//////////////// Applets Size
Column{
width:parent.width
spacing: 0.8*theme.defaultFont.pointSize
PlasmaComponents.Label{
text: i18n("Applets Size")
font.pointSize: 1.5 * theme.defaultFont.pointSize
}
RowLayout{
width: parent.width
property int step: 8
PlasmaComponents.Button{
text:"-"
PlasmaComponents.TabBar{
id:tabBar
Layout.fillWidth: true
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: appletsSizeSlider.value -= parent.step
}
PlasmaComponents.Slider{
id:appletsSizeSlider
valueIndicatorText: i18n("Applets Size")
valueIndicatorVisible: true
minimumValue: 16
maximumValue: 128
stepSize: parent.step
Layout.fillWidth:true
property bool inStartup:true
Component.onCompleted: {
value = plasmoid.configuration.iconSize;
inStartup = false;
}
onValueChanged:{
if(!inStartup){
plasmoid.configuration.iconSize = value;
updateThickness();
}
}
}
PlasmaComponents.Button{
text:"+"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: appletsSizeSlider.value += parent.step;
}
PlasmaComponents.Label{
text: plasmoid.configuration.iconSize + " px."
}
PlasmaComponents.TabButton{
text: i18n("Behavior")
tab: behaviorPage
}
}
/********** Zoom On Hover ****************/
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
PlasmaComponents.Label{
text: i18n("Zoom On Hover")
font.pointSize: 1.5 * theme.defaultFont.pointSize
PlasmaComponents.TabButton{
text: i18n("Appearance")
tab: appearancePage
}
RowLayout{
width: parent.width
PlasmaComponents.Button{
text:"-"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: zoomSlider.value -= 0.05
}
PlasmaComponents.Slider{
id:zoomSlider
valueIndicatorText: i18n("Zoom Factor")
valueIndicatorVisible: true
minimumValue: 1
maximumValue: 2
stepSize: 0.05
Layout.fillWidth:true
property bool inStartup:true
Component.onCompleted: {
value = Number(1 + plasmoid.configuration.zoomLevel/20).toFixed(2)
inStartup = false;
// console.log("Slider:"+value);
}
onValueChanged:{
if(!inStartup){
var result = Math.round((value - 1)*20)
plasmoid.configuration.zoomLevel = result
// console.log("Store:"+result);
}
}
}
PlasmaComponents.Button{
text:"+"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: zoomSlider.value += 0.05
}
PlasmaComponents.Label{
enabled: showBackground.checked
text: " "+Number(zoomSlider.value).toFixed(2)
}
PlasmaComponents.TabButton{
text: i18n("Tasks")
tab: tasksPage
}
}
Rectangle{
Layout.fillWidth: true
height: 28*theme.defaultFont.pixelSize
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
PlasmaComponents.Label{
text: i18n("Background")
font.pointSize: 1.5 * theme.defaultFont.pointSize
}
PlasmaComponents.CheckBox{
id: showBackground
text: i18n("Show Panel Background")
property bool inStartup: true
onCheckedChanged:{
if(!inStartup)
plasmoid.configuration.useThemePanel = checked;
}
Component.onCompleted: {
checked = plasmoid.configuration.useThemePanel;
inStartup = false;
}
}
RowLayout{
width: parent.width
PlasmaComponents.Button{
enabled: showBackground.checked
text:"-"
property color bC: theme.backgroundColor
property color transparentBack: Qt.rgba(bC.r,bC.g,bC.b,0.7)
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
color: transparentBack
onClicked: panelSizeSlider.value -= 2
}
border.width: 1
border.color: theme.backgroundColor
PlasmaComponents.Slider{
id:panelSizeSlider
enabled: showBackground.checked
valueIndicatorText: i18n("Size")
valueIndicatorVisible: true
PlasmaComponents.TabGroup{
anchors.fill: parent
anchors.margins: 3
minimumValue: 0
maximumValue: 256
stepSize: 2
Layout.fillWidth:true
property bool inStartup: true
Component.onCompleted: {
value = plasmoid.configuration.panelSize
inStartup = false;
}
onValueChanged: {
if(!inStartup)
plasmoid.configuration.panelSize = value;
privateContents: [
BehaviorConfig{
id: behaviorPage
},
AppearanceConfig{
id: appearancePage
},
TasksConfig{
id: tasksPage
}
}
PlasmaComponents.Button{
enabled: showBackground.checked
text:"+"
Layout.preferredWidth: parent.height
Layout.preferredHeight: parent.height
onClicked: panelSizeSlider.value += 2
}
PlasmaComponents.Label{
enabled: showBackground.checked
text: panelSizeSlider.value + " px."
}
]
}
}
}
Column{
width: parent.width
spacing: 0.8*theme.defaultFont.pointSize
PlasmaComponents.Label{
text: i18n("Shadows")
font.pointSize: 1.5 * theme.defaultFont.pointSize
}
Row{
id: actionButtons
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: windowSpace
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*/
}
}
}
spacing: windowSpace
width: parent.width - 2*windowSpace
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;
}
PlasmaComponents.Button{
enabled: true
text: i18n("Add New Dock")
inStartup = false;
}
}
onClicked: dock.addNewDock();
PlasmaComponents.RadioButton {
id: noneShadow
text: i18n("None")
exclusiveGroup: shadowsGroup
}
PlasmaComponents.RadioButton {
id: lockedAppletsShadow
text: i18n("Only for locked applets")
exclusiveGroup: shadowsGroup
}
PlasmaComponents.RadioButton {
id: allAppletsShadow
text: i18n("All applets")
exclusiveGroup: shadowsGroup
Component.onCompleted: {
var edges = dock.freeEdges();
if (edges.length === 0) {
enabled = false;
}
}
}
PlasmaComponents.Button{
enabled: true
text: i18n("Remove Dock")
Row{
PlasmaComponents.Button{
enabled: true
text: i18n("Add New Dock")
onClicked: dock.addNewDock();
Component.onCompleted: {
var edges = dock.freeEdges();
if (edges.length === 0) {
enabled = false;
}
}
}
PlasmaComponents.Button{
enabled: true
text: i18n("Remove Dock")
onClicked: dock.removeDock();
}
onClicked: dock.removeDock();
}
}
}

@ -0,0 +1,20 @@
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.plasmoid 2.0
import org.kde.latte 0.1 as Latte
PlasmaComponents.Page{
width: dialog.width - 2*dialog.windowSpace
Column{
spacing: 1.5*theme.defaultFont.pointSize
width: parent.width
}
}

@ -0,0 +1,41 @@
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide development of collaborative font projects, to support the font creation efforts of academic and linguistic communities, and to provide a free and open framework in which fonts may be shared and improved in partnership with others.
The OFL allows the licensed fonts to be used, studied, modified and redistributed freely as long as they are not sold by themselves. The fonts, including any derivative works, can be bundled, embedded, redistributed and/or sold with any software provided that any reserved names are not used by derivative works. The fonts and derivatives, however, cannot be released under any other type of license. The requirement for fonts to remain under this license does not apply to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright Holder(s) under this license and clearly marked as such. This may include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the copyright statement(s).
"Original Version" refers to the collection of Font Software components as distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting, or substituting -- in part or in whole -- any of the components of the Original Version, by changing formats or by porting the Font Software to a new environment.
"Author" refers to any designer, engineer, programmer, technical writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining a copy of the Font Software, to use, study, copy, merge, embed, modify, redistribute, and sell modified and unmodified copies of the Font Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components, in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled, redistributed and/or sold with any software, provided that each copy contains the above copyright notice and this license. These can be included either as stand-alone text files, human-readable headers or in the appropriate machine-readable metadata fields within text or binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font Name(s) unless explicit written permission is granted by the corresponding Copyright Holder. This restriction only applies to the primary font name as presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font Software shall not be used to promote, endorse or advertise any Modified Version, except to acknowledge the contribution(s) of the Copyright Holder(s) and the Author(s) or with their explicit written permission.
5) The Font Software, modified or unmodified, in part or in whole, must be distributed entirely under this license, and must not be distributed under any other license. The requirement for fonts to remain under this license does not apply to any document created using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Loading…
Cancel
Save