__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
// SPDX-License-Identifier: GPL-3.0-or-later // SPDX-FileCopyrightText: 2008 Robert Carr <[email protected]> import Gtk from 'gi://Gtk?version=3.0'; Gtk.init(null); let calcVal = ''; function updateDisplay() { label.set_markup(`<span size='30000'>${calcVal}</span>`); if (calcVal === '') label.set_markup("<span size='30000'>0</span>"); } function clear() { calcVal = ''; updateDisplay(); } function backspace() { calcVal = calcVal.substring(0, calcVal.length - 1); updateDisplay(); } function pressedEquals() { calcVal = calcVal.replace('sin', 'Math.sin'); calcVal = calcVal.replace('cos', 'Math.cos'); calcVal = calcVal.replace('tan', 'Math.tan'); calcVal = eval(calcVal); // Avoid ridiculous amounts of precision from toString. if (calcVal === Math.floor(calcVal)) calcVal = Math.floor(calcVal); else // bizarrely gjs loses str.toFixed() somehow?! calcVal = Math.floor(calcVal * 10000) / 10000; label.set_markup(`<span size='30000'>${calcVal}</span>`); } function pressedOperator(button) { calcVal += button.label; updateDisplay(); } function pressedNumber(button) { calcVal = (calcVal === 0 ? '' : calcVal) + button.label; updateDisplay(); } function swapSign() { calcVal = calcVal[0] === '-' ? calcVal.substring(1) : `-${calcVal}`; updateDisplay(); } function randomNum() { calcVal = `${Math.floor(Math.random() * 1000)}`; updateDisplay(); } function packButtons(buttons, vbox) { let hbox = new Gtk.HBox(); hbox.homogeneous = true; vbox.pack_start(hbox, true, true, 2); for (let i = 0; i <= 4; i++) hbox.pack_start(buttons[i], true, true, 1); } function createButton(str, func) { let btn = new Gtk.Button({label: str}); btn.connect('clicked', func); return btn; } function createButtons() { let vbox = new Gtk.VBox({homogeneous: true}); packButtons([ createButton('(', pressedNumber), createButton('←', backspace), createButton('↻', randomNum), createButton('Clr', clear), createButton('±', swapSign), ], vbox); packButtons([ createButton(')', pressedNumber), createButton('7', pressedNumber), createButton('8', pressedNumber), createButton('9', pressedNumber), createButton('/', pressedOperator), ], vbox); packButtons([ createButton('sin(', pressedNumber), createButton('4', pressedNumber), createButton('5', pressedNumber), createButton('6', pressedNumber), createButton('*', pressedOperator), ], vbox); packButtons([ createButton('cos(', pressedNumber), createButton('1', pressedNumber), createButton('2', pressedNumber), createButton('3', pressedNumber), createButton('-', pressedOperator), ], vbox); packButtons([ createButton('tan(', pressedNumber), createButton('0', pressedNumber), createButton('.', pressedNumber), createButton('=', pressedEquals), createButton('+', pressedOperator), ], vbox); return vbox; } let win = new Gtk.Window({ title: 'Calculator', resizable: false, opacity: 0.6, }); win.resize(250, 250); win.connect('destroy', () => Gtk.main_quit()); let label = new Gtk.Label({label: ''}); label.set_alignment(1, 0); updateDisplay(); let mainvbox = new Gtk.VBox(); mainvbox.pack_start(label, false, true, 1); mainvbox.pack_start(new Gtk.HSeparator(), false, true, 5); mainvbox.pack_start(createButtons(), true, true, 2); win.add(mainvbox); win.show_all(); Gtk.main();
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| README | File | 80 B | 0644 |
|
| calc.js | File | 3.55 KB | 0644 |
|
| dbus-client.js | File | 4.72 KB | 0644 |
|
| dbus-service.js | File | 3.42 KB | 0644 |
|
| gettext.js | File | 751 B | 0644 |
|
| gio-cat.js | File | 731 B | 0644 |
|
| glistmodel.js | File | 3.69 KB | 0644 |
|
| gtk-application.js | File | 3.64 KB | 0644 |
|
| gtk3-template.js | File | 1.57 KB | 0644 |
|
| gtk3-template.ui | File | 1.61 KB | 0644 |
|
| gtk3.js | File | 2.51 KB | 0644 |
|
| gtk4-frame-clock.js | File | 2.63 KB | 0644 |
|
| gtk4-template.js | File | 1.64 KB | 0644 |
|
| gtk4-template.ui | File | 1.61 KB | 0644 |
|
| gtk4.js | File | 1.87 KB | 0644 |
|
| http-client.js | File | 1.71 KB | 0644 |
|
| http-server.js | File | 1.39 KB | 0644 |
|
| test.jpg | File | 35.55 KB | 0644 |
|
| test.jpg.license | File | 158 B | 0644 |
|
| timers.js | File | 524 B | 0644 |
|
| webkit.js | File | 438 B | 0644 |
|
| websocket-client.js | File | 1.44 KB | 0644 |
|