mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 06:45:48 +00:00
more correct fix for #57
This commit is contained in:
@ -24,12 +24,17 @@ import org.kde.plasma.private.desktoppanel 1.0
|
||||
|
||||
Item {
|
||||
id: aboutPage
|
||||
// backend
|
||||
DPAdds {
|
||||
id: dpAdds;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: DPAdds.isDebugEnabled()
|
||||
property bool debug: dpAdds.isDebugEnabled()
|
||||
|
||||
|
||||
Column {
|
||||
@ -45,26 +50,26 @@ Item {
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: DPAdds.getAboutText("header")
|
||||
text: dpAdds.getAboutText("header")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: DPAdds.getAboutText("version")
|
||||
text: dpAdds.getAboutText("version")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
text: DPAdds.getAboutText("description")
|
||||
text: dpAdds.getAboutText("description")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
textFormat: Text.RichText
|
||||
text: DPAdds.getAboutText("links")
|
||||
text: dpAdds.getAboutText("links")
|
||||
onLinkActivated: Qt.openUrlExternally(link);
|
||||
}
|
||||
|
||||
@ -75,7 +80,7 @@ Item {
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignBottom
|
||||
textFormat: Text.RichText
|
||||
text: DPAdds.getAboutText("copy")
|
||||
text: dpAdds.getAboutText("copy")
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -88,7 +93,7 @@ Item {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
text: DPAdds.getAboutText("translators")
|
||||
text: dpAdds.getAboutText("translators")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
@ -97,7 +102,7 @@ Item {
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
verticalAlignment: Text.AlignTop
|
||||
textFormat: Text.RichText
|
||||
text: DPAdds.getAboutText("3rdparty")
|
||||
text: dpAdds.getAboutText("3rdparty")
|
||||
onLinkActivated: Qt.openUrlExternally(link);
|
||||
}
|
||||
}
|
||||
|
@ -25,12 +25,17 @@ import org.kde.plasma.private.desktoppanel 1.0
|
||||
|
||||
Item {
|
||||
id: activeAppearancePage
|
||||
// backend
|
||||
DPAdds {
|
||||
id: dpAdds;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: DPAdds.isDebugEnabled()
|
||||
property bool debug: dpAdds.isDebugEnabled()
|
||||
property variant weight: {
|
||||
25: 0,
|
||||
50: 1,
|
||||
|
@ -25,12 +25,17 @@ import org.kde.plasma.private.desktoppanel 1.0
|
||||
|
||||
Item {
|
||||
id: advancedPage
|
||||
// backend
|
||||
DPAdds {
|
||||
id: dpAdds;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: DPAdds.isDebugEnabled()
|
||||
property bool debug: dpAdds.isDebugEnabled()
|
||||
|
||||
property alias cfg_height: widgetHeight.value
|
||||
property alias cfg_width: widgetWidth.value
|
||||
@ -237,7 +242,7 @@ Item {
|
||||
// QtControls.Button {
|
||||
// width: parent.width * 3 / 5
|
||||
// text: i18n("Edit panels")
|
||||
// onClicked: cfg_panels = DPAdds.editPanelsToContol(plasmoid.configuration.panels)
|
||||
// onClicked: cfg_panels = dpAdds.editPanelsToContol(plasmoid.configuration.panels)
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
@ -25,12 +25,17 @@ import org.kde.plasma.private.desktoppanel 1.0
|
||||
|
||||
Item {
|
||||
id: inactiveAppearancePage
|
||||
// backend
|
||||
DPAdds {
|
||||
id: dpAdds;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: AWKeys.isDebugEnabled()
|
||||
property bool debug: dpAdds.isDebugEnabled()
|
||||
property variant weight: {
|
||||
25: 0,
|
||||
50: 1,
|
||||
|
@ -28,8 +28,12 @@ import "."
|
||||
|
||||
Item {
|
||||
id: main
|
||||
// backend
|
||||
DPAdds {
|
||||
id: dpAdds;
|
||||
}
|
||||
|
||||
property bool debug: DPAdds.isDebugEnabled()
|
||||
property bool debug: dpAdds.isDebugEnabled()
|
||||
property variant tooltipSettings: {
|
||||
"tooltipColor": plasmoid.configuration.tooltipColor,
|
||||
"tooltipType": plasmoid.configuration.tooltipType,
|
||||
@ -54,14 +58,14 @@ Item {
|
||||
// ui
|
||||
GridLayout {
|
||||
anchors.fill: parent
|
||||
columns: plasmoid.configuration.verticalLayout ? 1 : DPAdds.numberOfDesktops()
|
||||
rows: plasmoid.configuration.verticalLayout ? DPAdds.numberOfDesktops() : 1
|
||||
columns: plasmoid.configuration.verticalLayout ? 1 : dpAdds.numberOfDesktops()
|
||||
rows: plasmoid.configuration.verticalLayout ? dpAdds.numberOfDesktops() : 1
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
Layout.columnSpan: 0
|
||||
Layout.rowSpan: 0
|
||||
model: DPAdds.numberOfDesktops()
|
||||
model: dpAdds.numberOfDesktops()
|
||||
|
||||
Text {
|
||||
id: text
|
||||
@ -73,13 +77,13 @@ Item {
|
||||
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
text: DPAdds.parsePattern(plasmoid.configuration.text, index + 1)
|
||||
text: dpAdds.parsePattern(plasmoid.configuration.text, index + 1)
|
||||
property alias tooltip: tooltip
|
||||
|
||||
MouseArea {
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onClicked: DPAdds.setCurrentDesktop(index + 1);
|
||||
onClicked: dpAdds.setCurrentDesktop(index + 1);
|
||||
onEntered: needTooltipUpdate()
|
||||
}
|
||||
|
||||
@ -112,8 +116,8 @@ Item {
|
||||
timer.start()
|
||||
return
|
||||
}
|
||||
repeater.itemAt(i).text = DPAdds.parsePattern(plasmoid.configuration.text, i + 1)
|
||||
if (DPAdds.currentDesktop() == i + 1) {
|
||||
repeater.itemAt(i).text = dpAdds.parsePattern(plasmoid.configuration.text, i + 1)
|
||||
if (dpAdds.currentDesktop() == i + 1) {
|
||||
repeater.itemAt(i).color = plasmoid.configuration.currentFontColor
|
||||
repeater.itemAt(i).font.family = plasmoid.configuration.currentFontFamily
|
||||
repeater.itemAt(i).font.italic = plasmoid.configuration.currentFontStyle == "italic" ? true : false
|
||||
@ -137,7 +141,7 @@ Item {
|
||||
if (debug) console.log("[main::onNeedTooltipUpdate]")
|
||||
|
||||
for (var i=0; i<repeater.count; i++) {
|
||||
repeater.itemAt(i).tooltip.text = DPAdds.toolTipImage(i + 1)
|
||||
repeater.itemAt(i).tooltip.text = dpAdds.toolTipImage(i + 1)
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,16 +173,16 @@ Item {
|
||||
Plasmoid.onActivated: {
|
||||
if (debug) console.log("[main::onActivated]")
|
||||
|
||||
// DPAdds.changePanelsState()
|
||||
// dpAdds.changePanelsState()
|
||||
}
|
||||
|
||||
Plasmoid.onUserConfiguringChanged: {
|
||||
if (plasmoid.userConfiguring) return
|
||||
if (debug) console.log("[main::onUserConfiguringChanged]")
|
||||
|
||||
DPAdds.setMark(plasmoid.configuration.mark)
|
||||
DPAdds.setPanelsToControl(plasmoid.configuration.panels)
|
||||
DPAdds.setToolTipData(tooltipSettings)
|
||||
dpAdds.setMark(plasmoid.configuration.mark)
|
||||
dpAdds.setPanelsToControl(plasmoid.configuration.panels)
|
||||
dpAdds.setToolTipData(tooltipSettings)
|
||||
|
||||
needUpdate()
|
||||
}
|
||||
@ -188,7 +192,7 @@ Item {
|
||||
|
||||
// init submodule
|
||||
Plasmoid.userConfiguringChanged(false)
|
||||
DPAdds.desktopChanged.connect(needUpdate)
|
||||
DPAdds.windowListChanged.connect(needTooltipUpdate)
|
||||
dpAdds.desktopChanged.connect(needUpdate)
|
||||
dpAdds.windowListChanged.connect(needTooltipUpdate)
|
||||
}
|
||||
}
|
||||
|
@ -23,12 +23,17 @@ import org.kde.plasma.private.desktoppanel 1.0
|
||||
|
||||
Item {
|
||||
id: widgetPage
|
||||
// backend
|
||||
DPAdds {
|
||||
id: dpAdds;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: DPAdds.isDebugEnabled()
|
||||
property bool debug: dpAdds.isDebugEnabled()
|
||||
|
||||
property alias cfg_text: textPattern.text
|
||||
|
||||
@ -61,7 +66,7 @@ Item {
|
||||
"family": plasmoid.configuration.fontFamily,
|
||||
"size": plasmoid.configuration.fontSize
|
||||
}
|
||||
var font = DPAdds.getFont(defaultFont)
|
||||
var font = dpAdds.getFont(defaultFont)
|
||||
var pos = textPattern.cursorPosition
|
||||
var selected = textPattern.selectedText
|
||||
textPattern.remove(textPattern.selectionStart, textPattern.selectionEnd)
|
||||
@ -198,7 +203,7 @@ Item {
|
||||
QtControls.ComboBox {
|
||||
id: tags
|
||||
width: parent.width - addTagButton.width - showValueButton.width
|
||||
model: DPAdds.dictKeys()
|
||||
model: dpAdds.dictKeys()
|
||||
}
|
||||
QtControls.Button {
|
||||
id: addTagButton
|
||||
@ -222,8 +227,8 @@ Item {
|
||||
|
||||
var message = i18n("Tag: %1", tags.currentText)
|
||||
message += "<br>"
|
||||
message += i18n("Value: %1", DPAdds.valueByKey(tags.currentText))
|
||||
DPAdds.sendNotification("tag", message)
|
||||
message += i18n("Value: %1", dpAdds.valueByKey(tags.currentText))
|
||||
dpAdds.sendNotification("tag", message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user