Browse Source

fix tests, install theme.css externally, make zrythm user-themable

cairo_optimizations
Alexandros Theodotou 3 years ago
parent
commit
7c7fbd6717
Signed by: alex
GPG Key ID: 022EAE42313D70F3
  1. 6
      data/meson.build
  2. 0
      data/theme.css
  3. 5
      inc/audio/port_identifier.h
  4. 2
      meson.build
  5. 3
      resources/gen-gtk-resources-xml.scm
  6. 15
      src/audio/channel_send.c
  7. 6
      src/audio/engine.c
  8. 2
      src/project.c
  9. 36
      src/zrythm.c

6
data/meson.build

@ -98,4 +98,10 @@ if get_option ('enable_guile') @@ -98,4 +98,10 @@ if get_option ('enable_guile')
rename: 'monokai-extended-zrythm.xml')
endif
# theme
install_data (
'theme.css',
install_dir: themesdir,
rename: 'zrythm-theme.css')
subdir('windows')

0
resources/theme.css → data/theme.css

5
inc/audio/port_identifier.h

@ -273,9 +273,8 @@ port_type_strings[] = @@ -273,9 +273,8 @@ port_type_strings[] =
static const cyaml_schema_field_t
port_identifier_fields_schema[] =
{
CYAML_FIELD_STRING_PTR (
"label", CYAML_FLAG_POINTER,
PortIdentifier, label, 0, CYAML_UNLIMITED),
YAML_FIELD_STRING_PTR_OPTIONAL (
PortIdentifier, label),
YAML_FIELD_ENUM (
PortIdentifier, owner_type,
port_owner_type_strings),

2
meson.build

@ -40,6 +40,7 @@ mandir = join_paths (datadir, 'man', 'man1') @@ -40,6 +40,7 @@ mandir = join_paths (datadir, 'man', 'man1')
schemasdir = join_paths (datadir, 'glib-2.0/schemas')
fontsdir = join_paths (datadir, 'fonts', 'zrythm')
zrythmdatadir = join_paths (datadir, 'zrythm')
themesdir = join_paths (zrythmdatadir, 'themes')
samplesdir = join_paths (zrythmdatadir, 'samples')
docdir = join_paths (datadir, 'doc', 'zrythm')
sourceviewstylesdir = join_paths (datadir, 'sourceview-styles')
@ -86,6 +87,7 @@ cdata.set_quoted ('CONFIGURE_DATADIR', datadir) @@ -86,6 +87,7 @@ cdata.set_quoted ('CONFIGURE_DATADIR', datadir)
cdata.set_quoted (
'CONFIGURE_SOURCEVIEW_STYLES_DIR',
sourceviewstylesdir)
cdata.set_quoted ('CONFIGURE_THEMES_DIR', themesdir)
cdata.set_quoted (
'LIBDIR_NAME', get_option ('libdir'))
cdata.set_quoted ('CONFIGURE_LIBDIR', libdir)

3
resources/gen-gtk-resources-xml.scm

@ -303,8 +303,7 @@ Args: @@ -303,8 +303,7 @@ Args:
;; add theme and close
(display
" <file>theme.css</file>
</gresource>
" </gresource>
</gresources>"))))))
(apply main (program-arguments))

15
src/audio/channel_send.c

@ -45,19 +45,8 @@ channel_send_init ( @@ -45,19 +45,8 @@ channel_send_init (
self->track_pos = track_pos;
self->slot = slot;
self->is_empty = true;
PortType type = get_signal_type (self);
switch (type)
{
case TYPE_AUDIO:
self->amount = 1.f;
break;
case TYPE_EVENT:
self->on = true;
break;
default:
break;
}
self->amount = 1.f;
self->on = true;
}
Track *

6
src/audio/engine.c

@ -593,7 +593,7 @@ engine_realloc_port_buffers ( @@ -593,7 +593,7 @@ engine_realloc_port_buffers (
else if (j == STRIP_SIZE)
pl = ch->instrument;
else
pl = ch->inserts[j];
pl = ch->inserts[j - (STRIP_SIZE + 1)];
if (pl)
{
@ -1378,7 +1378,9 @@ engine_tear_down ( @@ -1378,7 +1378,9 @@ engine_tear_down (
else if (j == STRIP_SIZE)
pl = ch->instrument;
else
pl = ch->inserts[j];
pl =
ch->inserts[
j - (STRIP_SIZE + 1)];
if (!pl)
continue;

2
src/project.c

@ -959,7 +959,7 @@ project_save ( @@ -959,7 +959,7 @@ project_save (
else if (j == STRIP_SIZE)
pl = ch->instrument;
else
pl = ch->inserts[j];
pl = ch->inserts[j - (STRIP_SIZE + 1)];
if (!pl)
continue;

36
src/zrythm.c

@ -861,18 +861,38 @@ zrythm_app_startup ( @@ -861,18 +861,38 @@ zrythm_app_startup (
/*1);*/
g_message ("set resource paths");
// set default css provider
/* set default css provider */
GtkCssProvider * css_provider =
gtk_css_provider_new();
gtk_css_provider_load_from_resource (
css_provider,
"/org/zrythm/Zrythm/app/theme.css");
char * css_theme_path =
g_build_filename (
g_get_home_dir (), ".config", "zrythm",
"theme.css", NULL);
if (!g_file_test (
css_theme_path, G_FILE_TEST_EXISTS))
{
g_free (css_theme_path);
css_theme_path =
g_build_filename (
CONFIGURE_THEMES_DIR, "zrythm-theme.css",
NULL);
}
GError * err = NULL;
gtk_css_provider_load_from_path (
css_provider, css_theme_path, &err);
if (err)
{
g_warning (
"Failed to load CSS from path %s: %s",
css_theme_path, err->message);
}
gtk_style_context_add_provider_for_screen (
gdk_screen_get_default (),
GTK_STYLE_PROVIDER (css_provider),
800);
gdk_screen_get_default (),
GTK_STYLE_PROVIDER (css_provider), 800);
g_object_unref (css_provider);
g_message ("set default css provider");
g_message (
"set default css provider from path: %s",
css_theme_path);
/* set default window icon */
gtk_window_set_default_icon_name ("zrythm");

Loading…
Cancel
Save