Skip to content

Commit

Permalink
Add extra sizes to tray icons (for scaling 125%-300%)
Browse files Browse the repository at this point in the history
Fixes #559
  • Loading branch information
canton7 committed Jan 2, 2021
1 parent e4345b6 commit e44cdfc
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 50 deletions.
26 changes: 26 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,30 @@ namespace :tx do
response = tx_client.upload_source(source_resx)
puts "Added: #{response['strings_added']}. Updated: #{response['strings_updated']}. Deleted: #{response['strings_delete']}."
end
end

namespace :icons do
desc "Create a tray icon (pass 256x256 source)"
task :"tray-icon", [:source] do |t,args|
source = args[:source]
# See https://wiki.lazarus.freepascal.org/Windows_Icon
sizes = [
16, 32, # Normal 96 DPI
20, 40, # 120 DPI (125%)
24, 48, # 144 DPI (150%)
32, 64, # 192 DPI (200%)
36, 72, # 225%
40, 80, # 250%
44, 88, # 275%
48, 96, # 300%
].uniq.sort
raise "Need a source image" unless source
Dir.chdir(File.join('src', 'SyncTrayzor', 'Icons')) do
sizes.each do |size|
sh 'magick', 'convert', source, '-resize', "#{size}x#{size}", source.pathmap("%n-#{size}%x")
end
sh 'magick', 'convert', *sizes.map{ |x| source.pathmap("%n-#{x}%x") }, source.pathmap('%n.ico')
rm sizes.map{ |x| source.pathmap("%n-#{x}%x") }
end
end
end
Binary file modified src/SyncTrayzor/Icons/alert_tray.ico
Binary file not shown.
18 changes: 9 additions & 9 deletions src/SyncTrayzor/Icons/alert_tray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/SyncTrayzor/Icons/default_tray.ico
Binary file not shown.
Binary file modified src/SyncTrayzor/Icons/paused_tray.ico
Binary file not shown.
18 changes: 9 additions & 9 deletions src/SyncTrayzor/Icons/paused_tray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/SyncTrayzor/Icons/stopped.ico
Binary file not shown.
19 changes: 11 additions & 8 deletions src/SyncTrayzor/Icons/stopped.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/SyncTrayzor/Icons/syncing_2.ico
Binary file not shown.
19 changes: 11 additions & 8 deletions src/SyncTrayzor/Icons/syncing_2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/SyncTrayzor/Icons/syncing_3.ico
Binary file not shown.
19 changes: 11 additions & 8 deletions src/SyncTrayzor/Icons/syncing_3.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/SyncTrayzor/Icons/syncing_4.ico
Binary file not shown.
19 changes: 11 additions & 8 deletions src/SyncTrayzor/Icons/syncing_4.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e44cdfc

Please sign in to comment.