Warning, /utilities/kalk/src/qml/BinaryPad.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2021-2022 Rohan Asokan <rohan.asokan@students.iiit.ac.in>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 import QtQuick
0007 import QtQuick.Layouts
0008 import org.kde.kirigami as Kirigami
0009 
0010 GridLayout {
0011     signal pressed(string text)
0012     signal clear()
0013     columns: 4
0014     rowSpacing: Kirigami.Units.smallSpacing
0015     columnSpacing: Kirigami.Units.smallSpacing
0016 
0017     // Buttons are from left to right
0018     // Row Number from bottom: 4
0019     NumberButton {text: "<<"; onClicked: text => pressed(text);}
0020     NumberButton {text: ">>"; onClicked: text => pressed(text);}
0021     NumberButton {text: "CLEAR"; display: "CLR"; onClicked: clear(); special: true;}
0022     NumberButton {text: "DEL"; display: "⌫"; onClicked: text => pressed(text); onLongClicked: clear(); special: true;}
0023 
0024     // Row number from bottom: 3
0025     NumberButton {text: "^"; onClicked: text => pressed(text); special: true;}
0026     NumberButton {text: "~"; onClicked: text => pressed(text); special: true;}
0027     NumberButton {text: "|"; onClicked: text => pressed(text); special: true;}
0028     NumberButton {text: "&"; onClicked: text => pressed(text); special: true;}
0029 
0030     // Row number from bottom: 2
0031     NumberButton {text: "/"; display: "÷"; onClicked: text => pressed(text);}
0032     NumberButton {text: "*"; display: "×"; onClicked: text => pressed(text);}
0033     NumberButton {text: "-"; onClicked: text => pressed(text);}
0034     NumberButton {text: "+"; onClicked: text => pressed(text);}
0035 
0036     // Row number from bottom: 1
0037     NumberButton {text: "0"; onClicked: text => pressed(text);}
0038     NumberButton {text: "1"; onClicked: text => pressed(text);}
0039     NumberButton {text: "";}
0040     NumberButton {text: "="; onClicked: text => pressed(text); special: true;}
0041 }