mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-21 17:49:57 +00:00
initial plasma6 support
This commit is contained in:
@ -15,20 +15,19 @@
|
||||
* along with awesome-widgets. If not, see http://www.gnu.org/licenses/ *
|
||||
***************************************************************************/
|
||||
|
||||
import QtQuick 2.0
|
||||
import QtQuick.Controls 1.3 as QtControls
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls
|
||||
|
||||
|
||||
Item {
|
||||
ScrollView {
|
||||
width: parent.width
|
||||
height: parent.height * 4 / 5
|
||||
|
||||
property var backend
|
||||
property alias text: textArea.text
|
||||
|
||||
QtControls.TextArea {
|
||||
TextArea {
|
||||
id: textArea
|
||||
anchors.fill: parent
|
||||
textFormat: TextEdit.PlainText
|
||||
|
||||
Column {
|
||||
@ -50,9 +49,9 @@ Item {
|
||||
}
|
||||
|
||||
onTextChanged: {
|
||||
var currentTag = getLastTag()
|
||||
let currentTag = getLastTag()
|
||||
// exit if there are spaces or empty
|
||||
if ((currentTag.indexOf(" ") != -1) || (currentTag.length == 0)) {
|
||||
if ((currentTag.indexOf(" ") !== -1) || (currentTag.length === 0)) {
|
||||
tooltip.visible = false
|
||||
return
|
||||
}
|
||||
@ -63,7 +62,7 @@ Item {
|
||||
// show tooltip if found more than 1 or current text does not match
|
||||
// tag found
|
||||
tooltip.visible = ((tags.count > 1)
|
||||
|| ((tags.count == 1) && (tags.model[0] != tooltip.substring)))
|
||||
|| ((tags.count === 1) && (tags.model[0] !== tooltip.substring)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,10 +77,10 @@ Item {
|
||||
|
||||
function getLastTag() {
|
||||
// get substring to analyze
|
||||
var substring = textArea.getText(0, textArea.cursorPosition)
|
||||
const substring = textArea.getText(0, textArea.cursorPosition)
|
||||
// find last position of index in the given substring
|
||||
var signIndex = substring.lastIndexOf('$') + 1
|
||||
if ((signIndex == 0) || (signIndex == textArea.cursorPosition))
|
||||
const signIndex = substring.lastIndexOf("$") + 1
|
||||
if ((signIndex === 0) || (signIndex === textArea.cursorPosition))
|
||||
return ""
|
||||
// get current tag text
|
||||
return substring.substr(signIndex)
|
||||
|
Reference in New Issue
Block a user