This repository has been archived on 2021-06-24. You can view files and clone it, but cannot push or open issues or pull requests.
ui/qml/widgets/controls/FlagButton.qml

43 lines
843 B
QML

import QtGraphicalEffects 1.0
import QtQuick 2.7
import QtQuick.Controls 2.4
import QtQuick.Controls.Material 2.0
import QtQuick.Layouts 1.3
import QtQuick.Window 2.11
import QtQuick.Controls 1.4
Rectangle {
width: img.width + 10
height: img.height + 5
property string emoji
color: selected ? windowItem.cwtch_color : windowItem.cwtch_background_color
property bool selected
property string locale
Image {
id: img
anchors.centerIn:parent
opacity: 1.0
source: "qrc:/qml/fonts/twemoji/72x72/" + emoji + ".png"
MouseArea {
anchors.fill: parent
onClicked: {
gcd.setLocale(locale)
}
}
}
Connections {
target: gcd
onSupplySettings: function(zoom, newLocale) {
selected = newLocale == locale
}
}
}