Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ project (
i18n = import('i18n')
fs = import('fs')

#subprojects
subproj_inkscape = subproject('inkscape')

icon_dir = join_paths(get_option('datadir'), 'icons', 'elementary')

scale_factors = get_option('scale_factors')
Expand Down
Empty file added subprojects/.wraplock
Empty file.
674 changes: 674 additions & 0 deletions subprojects/inkscape/LICENSE

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions subprojects/inkscape/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CURRENTLY ONLY FOR TESTING PURPOSES
110 changes: 110 additions & 0 deletions subprojects/inkscape/actions/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
fs = import('fs')
icon_sizes = ['16', '24', 'symbolic']

# Fd.o icons Inkscape uses
icon_names = [
'align-horizontal-baseline',
'align-horizontal-center',
'align-horizontal-left',
'align-horizontal-left-to-anchor',
'align-horizontal-right',
'align-horizontal-right-to-anchor',
'align-vertical-baseline',
'align-vertical-bottom',
'align-vertical-bottom-to-anchor',
'align-vertical-center',
'align-vertical-top',
'align-vertical-top-to-anchor',
'application-exit',
'close',
'distribute-horizontal-center',
'distribute-horizontal-gaps',
'distribute-horizontal-left',
'distribute-horizontal-right',
'distribute-vertical-bottom',
'distribute-vertical-center',
'distribute-vertical-gaps',
'distribute-vertical-top',
'document-export',
'document-import',
'document-new',
'document-open',
'document-print',
'document-properties',
'document-revert',
'document-save-as',
'document-save',
'edit-clear',
'edit-copy',
'edit-cut',
'edit-delete',
'edit-find',
'edit-paste',
'edit-redo',
'edit-select-all',
'edit',
'edit-undo',
'format-indent-less',
'format-indent-more',
'format-justify-center',
'format-justify-fill',
'format-justify-left',
'format-justify-right',
'go-down',
'go-up',
'help-contents',
'list-add',
'list-remove',
'object-flip-horizontal',
'object-flip-vertical',
'object-group',
'object-rotate-left',
'object-rotate-right',
'object-select',
'object-ungroup',
'open-menu',
'pan-down',
'panel-left',
'pan-end',
'pan-start',
'pan-up',
'path-break-apart',
'path-combine',
'path-cut',
'path-difference',
'path-division',
'path-exclusion',
'path-flatten',
'path-fracture',
'path-intersection',
'path-split',
'path-union',
'selection-bottom',
'selection-lower',
'selection-raise',
'selection-top',
'tools-check-spelling',
'view-fullscreen',
'view-refresh',
'view-restore',
'window-close',
'window-new',
'zoom-in',
'zoom-original',
'zoom-out'
]

foreach name : icon_names
foreach size : icon_sizes
if size == 'symbolic'
name = name + '-symbolic'
endif

if fs.exists(meson.project_source_root () / size / name + '.svg')
install_data(
name + '.svg',
install_dir: icon_dir / ' actions' / size,
)
endif
endforeach
endforeach
36 changes: 36 additions & 0 deletions subprojects/inkscape/highlights.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Change only colors, do not add more class, order or remove
* also dont change selectors definition
*/

.base {
fill: #000000;
}

.success {
fill: #17BB80;
}

.warning {
fill: #0A8BFF;
}

.error {
fill: #F73664;
}

.dark .base {
fill: #ffffff;
}

.dark .success {
fill: #17BB80;
}

.dark .warning {
fill: #0A8BFF;
}

.dark .error {
fill: #F73664;
}
5 changes: 5 additions & 0 deletions subprojects/inkscape/index.theme.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[Icon Theme]
Name=elementary

Directories=@DIRECTORY_LIST@
@DIRECTORY_DETAILS@
126 changes: 126 additions & 0 deletions subprojects/inkscape/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
project (
'io.elementary.icons-inkscape',
version: '0.1.0',
license: 'GPL3+',
meson_version: '>=0.61',
)

fs = import('fs')

# This assumes an elementary OS system
icon_dir = fs.expanduser('~/.var/app/org.inkscape.Inkscape/config/inkscape/icons/elementary')

scale_factors = get_option('scale_factors')

directories = [
['actions', 'Actions'],
]

sizes = ['16', '24', 'symbolic']
max_size_symbolic = '512'
min_size_ever='8'

foreach directory : directories
install_subdir(
directory[0],
install_dir: icon_dir
)
endforeach

template = '''
[@0@]
Size=@1@@2@
Context=@3@
MinSize=@4@
MaxSize=@5@
Type=Scalable'''

directory_path_list = []
directory_details = []

foreach directory_entry : directories
directory = directory_entry[0]
directory_context = directory_entry[1]
foreach size: sizes
if (fs.exists(meson.project_source_root () / directory / size))
foreach scale_factor : scale_factors
# The Scale=1 attribute is useless, don't add it
if (scale_factor.to_int() > 1)
scale_entry = '\nScale=@0@'.format (scale_factor)
directory_name = join_paths('@0@@@1@x'.format (directory, scale_factor), size)
else
scale_entry = ''
directory_name = join_paths(directory, size)
endif

# Append it to add it to the final Directories= line
directory_path_list += directory_name

if (size == 'symbolic')
size_entry = '16'
# symbolic covers the whole size panel by definition
max_size = max_size_symbolic
else
size_entry = size
# Get the next size on the list
size_found = false
foreach lookup_size: sizes
if (size == lookup_size)
size_found = true
# if the next size if 'symbolic', that means that this is the biggest size.
elif (size_found == true)
if (lookup_size == 'symbolic')
max_size = max_size_symbolic
else
# the maximal icon size of an entry is the next available size minus 1
max_size = (lookup_size.to_int() - 1).to_string()
endif
size_found = false
endif
endforeach
endif

directory_details += template.format(
directory_name,
size_entry,
scale_entry,
directory_context,
min_size_ever,
max_size
)
endforeach
else
message ('Directory "@0@/@1@" doesn\'t exist and won\'t be listed in the theme file.'.format (directory, size))
endif
endforeach
endforeach

configuration_data_object = configuration_data()
configuration_data_object.set('DIRECTORY_LIST', ','.join (directory_path_list))
configuration_data_object.set('DIRECTORY_DETAILS', '\n'.join (directory_details))

# Create the symlinks
configure_file(
input: 'index.theme.in',
output: '@BASENAME@',
configuration: configuration_data_object,
install_dir: icon_dir
)

# Create the symlinks
foreach directoy_entry : directories
foreach scale_factor : scale_factors
# We only create a symlink to the @1 directory, it's all the point of using SVG assets...
if (scale_factor.to_int() > 1)
directory = directory_entry[0]
install_symlink(
'@0@@@1@x'.format(directory, scale_factor),
install_dir: icon_dir,
pointing_to: directory,
)
endif
endforeach
endforeach

subdir('actions')

3 changes: 3 additions & 0 deletions subprojects/inkscape/meson_options.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
option('scale_factors', type : 'array', value : ['1', '2', '3'], description : 'Available scale factors, add or remove to enable so HiDPI features')
option('volume_icons', type : 'boolean', value : true, description : 'Install the volume icons into the root directory')
option('palettes', type : 'boolean', value : true, description : 'Install the palette file into Gimp and Inkscape directories')