Skip to content

Commit

Permalink
Move to Blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
lainsce committed Mar 14, 2024
1 parent a91c206 commit 672e115
Show file tree
Hide file tree
Showing 15 changed files with 909 additions and 929 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
_build
.flatpak
builddir
builddir

subprojects/blueprint-compiler
File renamed without changes.
File renamed without changes.
File renamed without changes
10 changes: 10 additions & 0 deletions data/icons/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# This is where your app's icons will be installed from.

# app.svg is the primary visible icon for your application, displayed in the dock, for instance.
# devel.svg is the primary visible icon for your application as a development build, displayed in the dock, for instance.

install_data(
'app.svg',
rename: '@0@.svg'.format(meson.project_name()),
install_dir: get_option('datadir') / 'icons/hicolor/scalable/apps',
)
24 changes: 0 additions & 24 deletions data/icons/symbolic.svg

This file was deleted.

74 changes: 52 additions & 22 deletions data/meson.build
Original file line number Diff line number Diff line change
@@ -1,28 +1,58 @@
icons_dir = join_paths(get_option('datadir'), 'icons', 'hicolor')
scalable_dir = join_paths(icons_dir, 'scalable', 'apps')
symbolic_dir = join_paths(icons_dir, 'symbolic', 'apps')
# Non-code data for your application is handled here.
# Think icons, UI files, settings schemas, and other assets.
# For your convenience, we included the essentials. Make sure to rename them (and modify the contents) to use your actual app id.

install_data(
join_paths('icons', 'color.svg'),
install_dir: scalable_dir,
rename: meson.project_name() + '.svg'
)
install_data(
join_paths('icons', 'color.svg'),
install_dir: scalable_dir,
rename: meson.project_name() + '.Devel.svg'
)
install_data(
join_paths('icons', 'symbolic.svg'),
install_dir: symbolic_dir,
rename: meson.project_name() + '-symbolic.svg'
)
subdir('icons')
subdir('ui')

i18n.merge_file(
input: 'app.desktop.in',
# A desktop file provides basic information about the application to the shell.
# This allows the shell to display your application's name, icon, and other metadata.
# It's also required for visual launchers, such as the app drawer, to discover and launch your application.
# For more information about desktop files, see https://wiki.archlinux.org/title/desktop_entries and https://specifications.freedesktop.org/desktop-entry-spec/latest/

desktop_file = i18n.merge_file(
input: configure_file(
input: 'app.desktop.in.in',
output: meson.project_name() + '.desktop.in',
configuration: {
'ICON_NAME': meson.project_name(),
'COMMAND': meson.project_name(),
},
),
output: meson.project_name() + '.desktop',
po_dir: join_paths(meson.source_root(), 'po'),
po_dir: meson.source_root() / 'po',
type: 'desktop',
install: true,
install_dir: join_paths(get_option('datadir'), 'applications')
install_dir: get_option('datadir') / 'applications',
)

desktop_file_validate = find_program('desktop-file-validate', required: false)
if desktop_file_validate.found()
test('validate-desktop', desktop_file_validate, args: [desktop_file])
endif

# GResources allow you to bundle and reference assets within your application.
# Resources are specified using a gresource file.
# For more information about GResources, see: https://docs.gtk.org/gio/struct.Resource.html

gresources = gnome.compile_resources(
'resources',
configure_file(
input: 'gresource.xml.in',
output: meson.project_name() + '.gresource.xml',
configuration: {
'APP_ID': meson.project_name(),
'APP_PATH': path_identifier,
},
),
source_dir: meson.current_build_dir(),
dependencies: blueprints,
c_name: 'resources',
install_dir: get_option('datadir') / meson.project_name(),
)

add_project_arguments(
'--gresourcesdir',
meson.current_build_dir(),
language: ['vala'],
)
14 changes: 9 additions & 5 deletions data/style.css
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.calc-button {
background: linear-gradient(0deg, alpha(@accent_bg_color, 0.05), alpha(@accent_bg_color, 0.05)), image(@view_bg_color);
color: @accent_color;
border-radius: 999px;
font-size: 18px;
font-weight: 600;
min-width: 24px;
min-width: 30px;
min-height: 30px;
padding: 16px;
}

Expand Down Expand Up @@ -42,13 +42,17 @@
background: linear-gradient(0deg, alpha(@success_bg_color, 0.12), alpha(@success_bg_color, 0.12)), image(alpha(@success_bg_color, 0.11));
}

.calc-entry {
border-radius: 2px;
.calc-entry .text-field {
background: none;
padding: 8px 12px;
box-shadow: none;
outline-color: transparent;
}
.calc-entry text {
padding: 8px 0;
font-size: 40px;
font-weight: 300;
font-feature-settings: "tnum";
}

.calc-label {
background: none;
Expand Down
20 changes: 20 additions & 0 deletions data/ui/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Blueprint is a modern markup language for GTK. It is the recommended way to develop Helium applications.
# For more information on Blueprint, see https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/

# This file is where you'll specify Blueprint files to compile.
# You'll also need to add them to your gresources.xml file, in order to reference them from Vala.

blueprint_sources = ['window.blp']

blueprints = custom_target('blueprints',
input: files(blueprint_sources),
output: '.',
command: [find_program('blueprint-compiler'), 'batch-compile', '@OUTDIR@', '@CURRENT_SOURCE_DIR@', '@INPUT@'],
)

# This is a temporary workaround to fix a bug with the Vala compiler
blueprints_workaround = custom_target('blueprints_workaround',
input: blueprints,
output: 'blueprints_workaround.vala',
command: [find_program('touch'), '@OUTPUT@'],
)
Loading

0 comments on commit 672e115

Please sign in to comment.