Skip to content

Commit

Permalink
Revert "Use UI files directly"
Browse files Browse the repository at this point in the history
This reverts commit bd33be6.
  • Loading branch information
swsnr committed Sep 5, 2024
1 parent 8e2882f commit a375102
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 7 deletions.
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ HOME-DESTDIR = $(HOME)/.local/share/gnome-shell/extensions/$(UUID)
UUID = [email protected]

DIST-EXTRA-SRC = LICENSE-GPL2 LICENSE-MPL2
UIDEFS = $(wildcard ui/*.ui)
BLUEPRINTS = $(wildcard ui/*.blp)
UIDEFS = $(addsuffix .ui,$(basename $(BLUEPRINTS)))

.PHONY: dist
dist: compile
Expand Down Expand Up @@ -77,3 +78,6 @@ check: lint check-types
.PHONY: fix
fix: format
pnpm lint --fix

$(UIDEFS): %.ui: %.blp
blueprint-compiler compile --output $@ $<
72 changes: 72 additions & 0 deletions ui/AboutPage.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Gtk 4.0;
using Adw 1;

template $TypescriptTemplateAboutPage : Adw.PreferencesPage {
title: _("About");
icon-name: "dialog-information-symbolic";

Adw.PreferencesGroup {
valign: fill;
halign: fill;

Box {
orientation: vertical;
halign: center;
margin-bottom: 15;

Label extensionName {
label: "The name of this extension";
margin-bottom: 5;
styles ["title-1"]
}

Label extensionVersion {
label: "0.0.0";
styles ["caption"]
}
}

Box {
orientation: vertical;
halign: center;
margin-bottom: 5;

Label extensionDescription {
label: "Description of this extension";
justify: center;
}
}

Box {
halign: center;

LinkButton linkGithub {
label: C_("about link", "Github");

}

LinkButton linkIssues {
label: C_("about link", "Issue tracker");
}
}

Box {
orientation: vertical;
vexpand: true;
hexpand: true;

ScrolledWindow {
margin-top: 24;
vexpand: true;
hexpand: true;

TextView extensionLicense {
editable: false;
cursor-visible: false;
wrap-mode: word;
justification: center;
}
}
}
}
}
11 changes: 8 additions & 3 deletions ui/AboutPage.ui
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT EDIT!
This file was @generated by blueprint-compiler. Instead, edit the
corresponding .blp file and regenerate this file with blueprint-compiler.
-->
<interface>
<requires lib="gtk" version="4.0"/>
<template class="TypescriptTemplateAboutPage" parent="AdwPreferencesPage">
<property name="title" translatable="true">About</property>
<property name="title" translatable="yes">About</property>
<property name="icon-name">dialog-information-symbolic</property>
<child>
<object class="AdwPreferencesGroup">
Expand Down Expand Up @@ -50,12 +55,12 @@
<property name="halign">3</property>
<child>
<object class="GtkLinkButton" id="linkGithub">
<property name="label" translatable="true" context="about link">Github</property>
<property name="label" translatable="yes" context="about link">Github</property>
</object>
</child>
<child>
<object class="GtkLinkButton" id="linkIssues">
<property name="label" translatable="true" context="about link">Issue tracker</property>
<property name="label" translatable="yes" context="about link">Issue tracker</property>
</object>
</child>
</object>
Expand Down
14 changes: 14 additions & 0 deletions ui/GeneralPage.blp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Gtk 4.0;
using Adw 1;

template $TypescriptTemplateGeneralPage : Adw.PreferencesPage {
title: _("General");
icon_name: "dialog-information-symbolic";

Adw.PreferencesGroup {
Adw.SwitchRow sayHello {
title: _("Say hello");
subtitle: _("Whether to say hello");
}
}
}
11 changes: 8 additions & 3 deletions ui/GeneralPage.ui
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
DO NOT EDIT!
This file was @generated by blueprint-compiler. Instead, edit the
corresponding .blp file and regenerate this file with blueprint-compiler.
-->
<interface>
<requires lib="gtk" version="4.0"/>
<template class="TypescriptTemplateGeneralPage" parent="AdwPreferencesPage">
<property name="title" translatable="true">General</property>
<property name="title" translatable="yes">General</property>
<property name="icon_name">dialog-information-symbolic</property>
<child>
<object class="AdwPreferencesGroup">
<child>
<object class="AdwSwitchRow" id="sayHello">
<property name="title" translatable="true">Say hello</property>
<property name="subtitle" translatable="true">Whether to say hello</property>
<property name="title" translatable="yes">Say hello</property>
<property name="subtitle" translatable="yes">Whether to say hello</property>
</object>
</child>
</object>
Expand Down

0 comments on commit a375102

Please sign in to comment.