1
FalkonTutorials/qml/extensions/qml_tutorial_3/main.qml

45 lines
1.1 KiB
QML
Raw Normal View History

import org.kde.falkon 1.0 as Falkon
import QtQuick 2.3
Falkon.PluginInterface {
QtObject {
id: tutorial3Object
property int clickCount
}
init: function(state, settingsPath){
console.log(i18n('"Tutorial3" plugin loaded'))
tutorial3Object.clickCount = 0;
}
testPlugin: function() {
return true
}
unload: function() {
console.log(i18n('"Tutorial3" plugin unloaded'))
}
function buttonClicked() {
tutorial3Object.clickCount++;
console.log(i18n('"Tutorial3" clickCount increased to ' + tutorial3Object.clickCount))
}
Falkon.BrowserAction {
name: 'QML Tutorial 3'
identity: 'qml-tutorial-3-id'
title: i18n('Qml Tutorial 3')
toolTip: i18n('My little button')
icon: 'falkon'
badgeText: tutorial3Object.clickCount
location: Falkon.BrowserAction.NavigationToolBar | Falkon.BrowserAction.StatusBar
onClicked: buttonClicked()
popup: Rectangle {
width: 100;
height: 100;
}
}
}