Bug fixing

* fix bug with invalid applet and configuration load with newest qt
* fix bug with invalid DP configuration
* fix bug with invalid HTML tags operations
This commit is contained in:
Evgenii Alekseev 2017-06-02 17:33:02 +03:00
parent 934e30819c
commit 737759d03f
13 changed files with 34 additions and 26 deletions

View File

@ -72,7 +72,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: fontWeight id: fontWeight
model: general.fontWeightModel model: General.fontWeightModel
text: i18n("Font weight") text: i18n("Font weight")
value: plasmoid.configuration.fontWeight value: plasmoid.configuration.fontWeight
onValueEdited: cfg_fontWeight = newValue onValueEdited: cfg_fontWeight = newValue
@ -80,7 +80,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: fontStyle id: fontStyle
model: general.fontStyleModel model: General.fontStyleModel
text: i18n("Font style") text: i18n("Font style")
value: plasmoid.configuration.fontStyle value: plasmoid.configuration.fontStyle
onValueEdited: cfg_fontStyle = newValue onValueEdited: cfg_fontStyle = newValue
@ -94,7 +94,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: textStyle id: textStyle
model: general.textStyleModel model: General.textStyleModel
text: i18n("Style") text: i18n("Style")
value: plasmoid.configuration.textStyle value: plasmoid.configuration.textStyle
onValueEdited: cfg_textStyle = newValue onValueEdited: cfg_textStyle = newValue

View File

@ -95,16 +95,16 @@ Item {
textFormat: Text.RichText textFormat: Text.RichText
wrapMode: plasmoid.configuration.wrapText ? Text.WordWrap : Text.NoWrap wrapMode: plasmoid.configuration.wrapText ? Text.WordWrap : Text.NoWrap
horizontalAlignment: general.align[plasmoid.configuration.textAlign] horizontalAlignment: General.align[plasmoid.configuration.textAlign]
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
color: plasmoid.configuration.fontColor color: plasmoid.configuration.fontColor
font.family: plasmoid.configuration.fontFamily font.family: plasmoid.configuration.fontFamily
font.italic: plasmoid.configuration.fontStyle == "italic" ? true : false font.italic: plasmoid.configuration.fontStyle == "italic" ? true : false
font.pointSize: plasmoid.configuration.fontSize font.pointSize: plasmoid.configuration.fontSize
font.weight: general.fontWeight[plasmoid.configuration.fontWeight] font.weight: General.fontWeight[plasmoid.configuration.fontWeight]
style: general.textStyle[plasmoid.configuration.textStyle] style: General.textStyle[plasmoid.configuration.textStyle]
styleColor: plasmoid.configuration.textStyleColor styleColor: plasmoid.configuration.textStyleColor
PlasmaCore.ToolTipArea { PlasmaCore.ToolTipArea {

View File

@ -3,7 +3,7 @@
# common QML constants # common QML constants
singleton general 1.0 file:///usr/share/awesomewidgets/qml/general.qml singleton General 1.0 file:///usr/share/awesomewidgets/qml/General.qml
# custom QML UI classes # custom QML UI classes
AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml

View File

@ -58,7 +58,7 @@ Item {
backend: awKeys backend: awKeys
notifyBackend: awActions notifyBackend: awActions
textArea: textPattern textArea: textPattern
groups: general.awTagRegexp groups: General.awTagRegexp
} }
AWExtensions { AWExtensions {

View File

@ -39,8 +39,8 @@ Item {
property alias cfg_currentFontSize: fontSize.value property alias cfg_currentFontSize: fontSize.value
property string cfg_currentFontWeight: fontWeight.value property string cfg_currentFontWeight: fontWeight.value
property string cfg_currentFontStyle: fontStyle.value property string cfg_currentFontStyle: fontStyle.value
property alias cfg_currentFontColor: selectColor.text property alias cfg_currentFontColor: selectColor.value
property alias cfg_currentTextStyleColor: selectStyleColor.text property alias cfg_currentTextStyleColor: selectStyleColor.value
property string cfg_currentTextStyle: textStyle.value property string cfg_currentTextStyle: textStyle.value
@ -65,7 +65,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: fontWeight id: fontWeight
model: general.fontWeightModel model: General.fontWeightModel
text: i18n("Font weight") text: i18n("Font weight")
value: plasmoid.configuration.currentFontWeight value: plasmoid.configuration.currentFontWeight
onValueEdited: cfg_currentFontWeight = newValue onValueEdited: cfg_currentFontWeight = newValue
@ -73,7 +73,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: fontStyle id: fontStyle
model: general.fontStyleModel model: General.fontStyleModel
text: i18n("Font style") text: i18n("Font style")
value: plasmoid.configuration.currentFontStyle value: plasmoid.configuration.currentFontStyle
onValueEdited: cfg_currentFontStyle = newValue onValueEdited: cfg_currentFontStyle = newValue
@ -87,7 +87,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: textStyle id: textStyle
model: general.textStyleModel model: General.textStyleModel
text: i18n("Style") text: i18n("Style")
value: plasmoid.configuration.currentTextStyle value: plasmoid.configuration.currentTextStyle
onValueEdited: cfg_currentTextStyle = newValue onValueEdited: cfg_currentTextStyle = newValue

View File

@ -65,7 +65,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: fontWeight id: fontWeight
model: general.fontWeightModel model: General.fontWeightModel
text: i18n("Font weight") text: i18n("Font weight")
value: plasmoid.configuration.fontWeight value: plasmoid.configuration.fontWeight
onValueEdited: cfg_fontWeight = newValue onValueEdited: cfg_fontWeight = newValue
@ -73,7 +73,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: fontStyle id: fontStyle
model: general.fontStyleModel model: General.fontStyleModel
text: i18n("Font style") text: i18n("Font style")
value: plasmoid.configuration.fontStyle value: plasmoid.configuration.fontStyle
onValueEdited: cfg_fontStyle = newValue onValueEdited: cfg_fontStyle = newValue
@ -87,7 +87,7 @@ Item {
ComboBoxSelector { ComboBoxSelector {
id: textStyle id: textStyle
model: general.textStyleModel model: General.textStyleModel
text: i18n("Style") text: i18n("Style")
value: plasmoid.configuration.textStyle value: plasmoid.configuration.textStyle
onValueEdited: cfg_textStyle = newValue onValueEdited: cfg_textStyle = newValue

View File

@ -123,16 +123,16 @@ Item {
repeater.itemAt(i).font.family = plasmoid.configuration.currentFontFamily repeater.itemAt(i).font.family = plasmoid.configuration.currentFontFamily
repeater.itemAt(i).font.italic = plasmoid.configuration.currentFontStyle == "italic" ? true : false repeater.itemAt(i).font.italic = plasmoid.configuration.currentFontStyle == "italic" ? true : false
repeater.itemAt(i).font.pointSize = plasmoid.configuration.currentFontSize repeater.itemAt(i).font.pointSize = plasmoid.configuration.currentFontSize
repeater.itemAt(i).font.weight = general.fontWeight[plasmoid.configuration.currentFontWeight] repeater.itemAt(i).font.weight = General.fontWeight[plasmoid.configuration.currentFontWeight]
repeater.itemAt(i).style = general.textStyle[plasmoid.configuration.currentTextStyle] repeater.itemAt(i).style = General.textStyle[plasmoid.configuration.currentTextStyle]
repeater.itemAt(i).styleColor = plasmoid.configuration.currentTextStyleColor repeater.itemAt(i).styleColor = plasmoid.configuration.currentTextStyleColor
} else { } else {
repeater.itemAt(i).color = plasmoid.configuration.fontColor repeater.itemAt(i).color = plasmoid.configuration.fontColor
repeater.itemAt(i).font.family = plasmoid.configuration.fontFamily repeater.itemAt(i).font.family = plasmoid.configuration.fontFamily
repeater.itemAt(i).font.italic = plasmoid.configuration.fontStyle == "italic" ? true : false repeater.itemAt(i).font.italic = plasmoid.configuration.fontStyle == "italic" ? true : false
repeater.itemAt(i).font.pointSize = plasmoid.configuration.fontSize repeater.itemAt(i).font.pointSize = plasmoid.configuration.fontSize
repeater.itemAt(i).font.weight = general.fontWeight[plasmoid.configuration.fontWeight] repeater.itemAt(i).font.weight = General.fontWeight[plasmoid.configuration.fontWeight]
repeater.itemAt(i).style = general.textStyle[plasmoid.configuration.textStyle] repeater.itemAt(i).style = General.textStyle[plasmoid.configuration.textStyle]
repeater.itemAt(i).styleColor = plasmoid.configuration.textStyleColor repeater.itemAt(i).styleColor = plasmoid.configuration.textStyleColor
} }
repeater.itemAt(i).update() repeater.itemAt(i).update()

View File

@ -3,7 +3,7 @@
# common QML constants # common QML constants
singleton general 1.0 file:///usr/share/awesomewidgets/qml/general.qml singleton General 1.0 file:///usr/share/awesomewidgets/qml/General.qml
# custom QML UI classes # custom QML UI classes
AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml AboutTab file:///usr/share/awesomewidgets/qml/AboutTab.qml

View File

@ -52,7 +52,7 @@ Item {
backend: dpAdds backend: dpAdds
notifyBackend: dpAdds notifyBackend: dpAdds
textArea: textPattern textArea: textPattern
groups: general.dpTagRegexp groups: General.dpTagRegexp
} }
AWTextEditor { AWTextEditor {

View File

@ -90,6 +90,14 @@ Item {
function insert(text) { function insert(text) {
textArea.insert(textArea.cursorPosition, text) textArea.insert(textArea.cursorPosition, text)
} }
function removeSelection() {
textArea.remove(textArea.selectionStart, textArea.selectionEnd)
}
function selectedText() {
return textArea.selectedText
}
} }

View File

@ -31,10 +31,10 @@ QtControls.Button {
function updateText() { function updateText() {
// get selected text // get selected text
var selected = textField.selectedText var selected = textField.selectedText()
// remove it from widget // remove it from widget
textField.remove(textField.selectionStart, textField.selectionEnd) textField.removeSelection()
// insert edited text // insert edited text
textField.insert(textField.cursorPosition, start + selected + end) textField.insert(start + selected + end)
} }
} }

View File

@ -3,7 +3,7 @@
# common QML constants # common QML constants
singleton general 1.0 file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/general.qml singleton General 1.0 file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/General.qml
# custom QML UI classes # custom QML UI classes
AboutTab file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AboutTab.qml AboutTab file://@CMAKE_INSTALL_PREFIX@/@DATA_INSTALL_DIR@/@PROJECT_NAME@/qml/AboutTab.qml