Skip to content

Commit 030c908

Browse files
committed
chore: kinda works i think
1 parent c642980 commit 030c908

9 files changed

+103
-7
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
source
12
result
23
node_modules
4+
pnpm-lock.yaml
5+
bun.lockb
6+
package-lock.json

flake.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
outputs = { nixpkgs, self, troll }:
1010
let
11-
appid = "surf.Tangent.Tangent";
11+
appid = "surf.tangent.Tangent";
1212
description = "Go on tangents.";
1313
in
1414
{

jsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
// So GNOME must use Firefox 102 ESR which is from 2022
66
// https://discourse.gnome.org/t/gnome-43-to-depend-on-spidermonkey-102/10658
77
"target": "ESNext",
8-
"module": "NodeNext", // Import attributes are only available when targeting ESNext
8+
"module": "ESNext", // Import attributes are only available when targeting ESNext
99
"lib": ["ESNext"],
1010

1111
"checkJs": true,
12-
"moduleResolution": "nodenext",
12+
"moduleResolution": "bundler",
1313
"resolveJsonModule": true,
1414
"typeRoots": ["./node_modules/@girs"]
1515
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@girs/adw-1": "1.3.4-3.2.3",
4+
"@girs/adw-1": "1.4.3-3.2.9",
55
"@girs/gjs": "^3.2.3",
66
"@girs/gtk-4.0": "4.10.5-3.2.3"
77
}

share/icons/hicolor/scalable/apps/surf.Tangent.Tangent.svg

-1
This file was deleted.
Loading

share/metainfo/surf.tangent.Tangent.metainfo.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<control>keyboard</control>
2323
<control>touch</control>
2424
</supports>
25-
<requires><internet>always</internet></require>
25+
<requires><internet>always</internet></requires>
2626
<developer_name>Etcetera Development</developer_name>
2727
<description>
2828
<p>

src/main.js

+51-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,51 @@
1-
console.log("The user agent.")
1+
/// <reference types="gjs/dom" />
2+
import GObject from "gi://GObject"
3+
import Gio from "gi://Gio"
4+
import Gtk from "gi://Gtk?version=4.0"
5+
import Adw from "gi://Adw?version=1"
6+
import GLib from "gi://GLib"
7+
import { programArgs, programInvocationName } from "system"
8+
import { build } from "troll"
9+
import "troll/globals.js"
10+
import Interface from "./window.blp" with { type: "uri" }
11+
import meta from "../share/metainfo/surf.tangent.Tangent.metainfo.xml" with {type: "uri"}
12+
13+
GLib.set_application_name("Tangent")
14+
15+
const Tangent = GObject.registerClass(
16+
{},
17+
class Tangent extends Adw.Application {
18+
constructor() {
19+
super({
20+
applicationId: "surf.tangent.Tangent",
21+
flags: Gio.ApplicationFlags.DEFAULT_FLAGS,
22+
})
23+
}
24+
25+
vfunc_startup() {
26+
super.vfunc_startup()
27+
}
28+
29+
vfunc_activate() {
30+
super.vfunc_activate()
31+
32+
/*** @type {{window: Gtk.ApplicationWindow, search: Gtk.SearchEntry}} */
33+
const { window } = build(Interface, {
34+
about: () => {
35+
const about = Adw.AboutWindow.new_from_appdata(
36+
meta.replace("resource://", ""),
37+
""
38+
)
39+
about.set_transient_for(window)
40+
about.present()
41+
},
42+
})
43+
window.set_application(this)
44+
window.set_icon_name("surf.tangent.Tangent")
45+
window.present()
46+
window.connect("close-request", win => win.run_dispose())
47+
}
48+
}
49+
)
50+
51+
new Tangent().run([programInvocationName].concat(programArgs))

src/window.blp

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Gtk 4.0;
2+
using Adw 1;
3+
4+
Adw.Window window {
5+
default-width: 800;
6+
default-height: 600;
7+
title: "Methodsave";
8+
Box {
9+
orientation: vertical;
10+
Adw.HeaderBar {
11+
styles ["flat"]
12+
[title]
13+
Adw.Clamp {
14+
tightening-threshold: 400;
15+
hexpand: true;
16+
Gtk.SearchEntry search {
17+
placeholder-text: "Wave smiley.";
18+
}
19+
}
20+
21+
[end]
22+
Gtk.Button {
23+
icon-name: "about-symbolic";
24+
clicked => $about();
25+
}
26+
}
27+
Adw.StatusPage {
28+
icon-name: "uk.cetera.Methodsave";
29+
title: "Method is coming.";
30+
vexpand: true;
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)