Skip to content

Commit 580d275

Browse files
authored
Add devel build and refine some doodads
* Prepare for next release * Extend StatusCode and let it handle explanations * refresh codestyle for dropdown model * Display which item is already selected * nicer checked element * refine presentation and avoid double language * sensitive clear button * cancellable actions * add undo to toasts * introduce initial zooming support (very initial) * Use a different approach for editing the UI and shit * undo draggable dd * More zoom for your zoom * margins for the api level * Refine UI and fix zoom * do not use a stack for the spinner/refresh combo * allow having a devel version * allow having a devel version * nicer looking warning color * Set more for devel * fix a slight mistake and add a devel manifest * Allow building a devel version aside from the standard one * oops i forgot this one * heads up in manifest * avoid losing gettext * correct another miss * Include gschema for the windows build (oooops!) * include app name * proper gettext * make sure we do not lose PO files in the devel * Refine dev builds and add a dev icon * refine devel
1 parent 21dfccd commit 580d275

34 files changed

Lines changed: 1260 additions & 266 deletions

data/Application.css

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,11 @@
2020
/*
2121
Picked: #2c3944d9
2222
Base from wpkelso: #33434eff
23-
24-
@define-color accent_color #33434eff;
2523
*/
2624

25+
@define-color accent_color #33434e;
26+
27+
2728
/* Used in the OrientationsBox for the preview icon */
2829
.rotated * {
2930
-gtk-icon-transform: rotate(90deg);
@@ -50,4 +51,38 @@ Base from wpkelso: #33434eff
5051
/* Pretend the log textview is a console */
5152
.console {
5253
background-color: #002B36;
54+
}
55+
56+
/* Used for labels in the popover */
57+
.bold {
58+
font-weight: bold;
59+
}
60+
61+
/* Font zooms */
62+
.s20 {font-size: 20%;}
63+
.s40 {font-size: 40%;}
64+
.s60 {font-size: 60%;}
65+
.s80 {font-size: 80%;}
66+
.s100 {font-size: 100%;}
67+
.s120 {font-size: 120%;}
68+
.s140 {font-size: 140%;}
69+
.s160 {font-size: 160%;}
70+
.s180 {font-size: 180%;}
71+
.s200 {font-size: 200%;}
72+
.s220 {font-size: 220%;}
73+
.s240 {font-size: 240%;}
74+
.s260 {font-size: 260%;}
75+
.s280 {font-size: 280%;}
76+
.s300 {font-size: 300%;}
77+
.s320 {font-size: 320%;}
78+
.s340 {font-size: 340%;}
79+
.s360 {font-size: 360%;}
80+
.s380 {font-size: 380%;}
81+
.s400 {font-size: 400%;}
82+
83+
/* Devel builds get these. Libadwaita has that too, but we do not use it. */
84+
window.devel {
85+
border-style: solid;
86+
border-width: 3px;
87+
border-color: @warning_color;
5388
}

data/icons/dev.svg

Lines changed: 354 additions & 0 deletions
Loading
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
Version=1.0
33
Type=Application
44

5-
Name=Inscriptions
5+
Name=@APP_NAME@
66
GenericName=Text translator
77
Comment=Translate text elegantly
8-
Icon=io.github.elly_code.inscriptions
9-
Exec=io.github.elly_code.inscriptions %U
8+
Icon=@APP_ID@
9+
Exec=@APP_ID@ %U
1010

1111
Categories=Office;Education;GTK;
1212
Keywords=text;translate;translation;translator;deepl;NMT;lang;localize;l10n;i18n;localization;internationalization;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<schemalist>
3-
<enum id="io.github.elly_code.inscriptions.formality">
3+
<enum id="@APP_ID@.formality">
44
<value value='0' nick="more"/>
55
<value value='1' nick="prefer-more"/>
66
<value value='2' nick="default"/>
77
<value value='3' nick="prefer-less"/>
88
<value value='4' nick="less"/>
99
</enum>
1010

11-
<schema path="/io/github/elly_code/inscriptions/" id="io.github.elly_code.inscriptions">
11+
<schema path="/io/github/elly_code/inscriptions/" id="@APP_ID@">
1212
<key name="window-height" type="i">
1313
<default>320</default>
1414
<summary>Most recent window height</summary>
@@ -49,7 +49,7 @@
4949
<summary>context for translations</summary>
5050
<description>Passed as context parameter to the DeepL API</description>
5151
</key>
52-
<key enum="io.github.elly_code.inscriptions.formality" name="formality">
52+
<key enum="@APP_ID@.formality" name="formality">
5353
<default>'default'</default>
5454
<summary>Level of formality</summary>
5555
<description>For supported languages, how format the output should be</description>
Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<component type="desktop-application">
3-
<id>io.github.elly_code.inscriptions</id>
4-
<launchable type="desktop-id">io.github.elly_code.inscriptions.desktop</launchable>
5-
<translation type="gettext">io.github.elly_code.inscriptions</translation>
3+
<id>@APP_ID@</id>
4+
<launchable type="desktop-id">@APP_ID@.desktop</launchable>
5+
<translation type="gettext">@GETTEXT_PACKAGE@</translation>
66
<metadata_license>CC-BY-4.0</metadata_license>
77
<project_license>GPL-3.0-or-later</project_license>
88
<provides>
99
<binary>io.github.elly_code.inscriptions</binary>
1010
</provides>
1111

12-
<name>Inscriptions</name>
12+
<name>@APP_NAME@</name>
1313
<summary>Translate text elegantly</summary>
1414
<description>
1515
<p>A fast, pretty, and ready translation app using DeepL free and paid API</p>
@@ -49,8 +49,8 @@
4949
<url type="vcs-browser">https://github.com/elly-code/inscriptions</url>
5050

5151
<branding>
52-
<color type="primary" scheme_preference="light">#95a3ab</color>
53-
<color type="primary" scheme_preference="dark">#0e141f</color>
52+
<color type="primary" scheme_preference="light">#3557082</color>
53+
<color type="primary" scheme_preference="dark">#33434e</color>
5454
</branding>
5555

5656
<keywords>
@@ -79,6 +79,16 @@
7979
</recommends>
8080

8181
<releases>
82+
<release version="1.0.1" date="2026-03-16" urgency="medium">
83+
<description>
84+
<p>Touchups and enhancements</p>
85+
<ul>
86+
<li>Minor design changes. Lets do refined shit.</li>
87+
<li>Updated and extended screenshots</li>
88+
<li>Some work into cleaner code</li>
89+
</ul>
90+
</description>
91+
</release>
8292
<release version="1.0.0" date="2026-02-16" urgency="medium">
8393
<description>
8494
<p>🚀 1.0.0 Initial release!</p>

data/meson.build

Lines changed: 83 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,104 @@
11

2+
3+
gschema_conf = configuration_data()
4+
gschema_conf.set('APP_ID', app_id)
5+
gschema_file = configure_file(
6+
input: 'inscriptions.gschema.xml.in',
7+
output: '@0@.gschema.xml'.format(app_id),
8+
configuration: gschema_conf,
9+
)
10+
211
install_data(
3-
'inscriptions.gschema.xml',
12+
gschema_file,
413
install_dir: get_option('datadir') / 'glib-2.0' / 'schemas',
5-
rename: meson.project_name() + '.gschema.xml'
14+
)
15+
16+
compile_schemas = find_program('glib-compile-schemas', required: false, disabler: true)
17+
test('Validate schema file',
18+
compile_schemas,
19+
args: ['--strict', '--dry-run', meson.current_source_dir()],
620
)
721

822
# metainfo confuses windows, and icons are
923
if not windows_build
1024

11-
icon_sizes = ['16', '32', '48', '64', '128']
25+
# Install the standard icons in standard build
26+
if not get_option('development')
27+
28+
icon_sizes = ['16', '32', '48', '64', '128']
29+
30+
foreach i : icon_sizes
31+
install_data(
32+
'icons' / 'hicolor' / i + '.png',
33+
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
34+
rename: app_id + '.png'
35+
)
36+
install_data(
37+
'icons' / 'hicolor@2' / i + '@2.png',
38+
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
39+
rename: app_id + '.png'
40+
)
41+
endforeach
1242

13-
foreach i : icon_sizes
14-
install_data(
15-
'icons' / 'hicolor' / i + '.png',
16-
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i / 'apps',
17-
rename: meson.project_name() + '.png'
43+
# Install the dev icon in development builds
44+
else
45+
install_data(
46+
'icons' / 'dev.svg',
47+
install_dir: get_option('datadir') / 'icons' / 'hicolor' / 'scalable' / 'apps',
48+
rename: app_id + '.svg'
49+
)
50+
endif
51+
52+
53+
# Inject some variables into the desktop file before merging in the translations
54+
desktop_conf = configuration_data()
55+
desktop_conf.set('APP_NAME', app_name)
56+
desktop_conf.set('APP_ID', app_id)
57+
desktop_file_in = configure_file(
58+
input: 'inscriptions.desktop.in.in',
59+
output: '@0@.desktop.in'.format(app_id),
60+
configuration: desktop_conf,
1861
)
19-
install_data(
20-
'icons' / 'hicolor@2' / i + '@2.png',
21-
install_dir: get_option('datadir') / 'icons' / 'hicolor' / i + 'x' + i + '@2' / 'apps',
22-
rename: meson.project_name() + '.png'
62+
63+
desktop_file = i18n.merge_file(
64+
input: desktop_file_in,
65+
output: '@0@.desktop'.format(app_id),
66+
po_dir: meson.project_source_root() / 'po',
67+
type: 'desktop',
68+
install: true,
69+
install_dir: get_option('datadir') / 'applications',
2370
)
24-
endforeach
2571

2672

73+
# Inject some variables into the metainfo file before merging in the translations
74+
appstream_conf = configuration_data()
75+
appstream_conf.set('APP_ID', app_id)
76+
appstream_conf.set('GETTEXT_PACKAGE', meson.project_name())
77+
appstream_file_in = configure_file(
78+
input: 'inscriptions.metainfo.xml.in.in',
79+
output: '@0@.metainfo.xml.in'.format(app_id),
80+
configuration: appstream_conf,
81+
)
2782

28-
i18n.merge_file(
29-
input: 'inscriptions.desktop.in',
30-
output: meson.project_name() + '.desktop',
83+
appstream_file = i18n.merge_file(
84+
input: appstream_file_in,
85+
output: '@0@.metainfo.xml'.format(app_id),
3186
po_dir: meson.project_source_root() / 'po',
32-
type: 'desktop',
3387
install: true,
34-
install_dir: get_option('datadir') / 'applications'
88+
install_dir: get_option('datadir') / 'metainfo',
3589
)
3690

37-
i18n.merge_file(
38-
input: 'inscriptions.metainfo.xml.in',
39-
output: meson.project_name() + '.metainfo.xml',
40-
po_dir: meson.project_source_root() / 'po',
41-
install: true,
42-
install_dir: get_option('datadir') / 'metainfo'
91+
# Test definitions
92+
desktop_utils = find_program('desktop-file-validate', required: false)
93+
if desktop_utils.found()
94+
test('Validate desktop file', desktop_utils, args: [desktop_file])
95+
endif
96+
97+
appstreamcli = find_program('appstreamcli', required: false, disabler: true)
98+
test('Validate appstream file',
99+
appstreamcli,
100+
args: ['validate', '--no-net', '--explain', appstream_file],
43101
)
44102

103+
45104
endif
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#
2+
# This is danger
3+
#
4+
id: io.github.elly_code.inscriptions.devel
5+
# elementary SDK is not available on Flathub, so use the elementary BaseApp instead
6+
base: io.elementary.BaseApp
7+
base-version: 'circe-25.08'
8+
runtime: org.gnome.Platform
9+
runtime-version: '49'
10+
sdk: org.gnome.Sdk
11+
command: io.github.elly_code.inscriptions.devel
12+
13+
tags: ['devel']
14+
desktop-file-name-suffix: ' (Development)'
15+
16+
finish-args:
17+
- '--share=ipc'
18+
- '--device=dri'
19+
- '--socket=fallback-x11'
20+
- '--socket=wayland'
21+
# Required for communication with DeepL API
22+
- '--share=network'
23+
24+
cleanup:
25+
- '/include'
26+
- '/lib/pkgconfig'
27+
- '/man'
28+
- '/share/doc'
29+
- '/share/gtk-doc'
30+
- '/share/man'
31+
- '/share/pkgconfig'
32+
- '/share/installed-tests'
33+
- '*.la'
34+
- '*.a'
35+
36+
modules:
37+
- name: inscriptions
38+
buildsystem: meson
39+
config-opts:
40+
- -Ddevelopment=true
41+
sources:
42+
- type: dir
43+
path: .

meson.build

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,33 @@
22
project(
33
'io.github.elly_code.inscriptions',
44
'vala', 'c',
5-
version: '1.0.0'
5+
version: '1.1.0'
66
)
77

8+
app_name = 'Inscriptions'
9+
app_id = meson.project_name()
10+
app_version = meson.project_version()
11+
812
#================================
913
# Include Gnome and the translations module
1014
gnome = import('gnome')
1115
i18n = import('i18n')
1216

13-
# Set our translation domain
14-
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')
15-
windows_build = build_machine.system() == 'windows'
1617

1718
vala_flags = []
19+
if get_option('development')
20+
app_id += '.devel'
21+
vcs_tag = run_command('git', 'rev-parse', '--short', 'HEAD').stdout().strip()
22+
app_version += '-@0@'.format (vcs_tag)
23+
vala_flags += ['--define', 'DEVEL']
24+
25+
endif
26+
27+
# Set our translation domain
28+
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (app_id), language:'c')
29+
1830
# Windows needs icons, special arguments, and skip libportal
31+
windows_build = build_machine.system() == 'windows'
1932
if windows_build
2033
vala_flags += ['--define', 'WINDOWS']
2134
endif
@@ -27,7 +40,11 @@ add_project_arguments(vala_flags, language: 'vala')
2740
config_data = configuration_data()
2841
config_data.set('version', meson.project_version())
2942
config_data.set_quoted('LOCALEDIR', get_option('prefix') / get_option('localedir'))
30-
config_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
43+
config_data.set_quoted('GETTEXT_PACKAGE', app_id)
44+
config_data.set_quoted('APP_NAME', app_name)
45+
config_data.set_quoted('APP_ID', app_id)
46+
config_data.set_quoted('APP_VERSION', app_version)
47+
3148
config_file = configure_file(
3249
input: 'src/Config.vala.in',
3350
output: '@BASENAME@',

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
option('development', type: 'boolean', value: false, description: 'If this is a development build')

po/POTFILES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ src/Windows/MainWindow.vala
22
src/Views/TranslationView.vala
33
src/Widgets/HeaderBar.vala
44
src/Views/ErrorView.vala
5+
src/Enums/StatusCode.vala
56
src/Widgets/ErrorBonusBox.vala
67
src/Views/LogView.vala
78
src/Widgets/PopoverWidgets/ApiEntry.vala

0 commit comments

Comments
 (0)