From 3a8f4e58606697447cd0a1f57292b1c7834f9d69 Mon Sep 17 00:00:00 2001 From: Cyberarm Date: Mon, 30 Jan 2023 08:38:26 -0600 Subject: [PATCH] Added used software section to home page --- lib/pages/home.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/lib/pages/home.rb b/lib/pages/home.rb index 6540766..06daad4 100644 --- a/lib/pages/home.rb +++ b/lib/pages/home.rb @@ -34,9 +34,43 @@ module TAC label "Total actions: #{actions.size}" label "Total variables: #{variables.size}" end + + stack(width: 1.0, fill: true, scroll: true, margin_top: 32) do + heading, items = Gosu::LICENSES.split("\n\n") + + title heading + + items.split("\n").each do |item| + name, website, license, license_website = item.split(",").map(&:strip) + flow(width: 1.0, height: 28) do + tagline "#{name} - " + button "Website", height: 1.0, tip: website do + open_url(website) + end + end + + flow(width: 1.0, height: 22, margin_bottom: 20) do + para "#{license} - " + button "License Website", height: 1.0, text_size: 16, tip: license_website do + open_url(license_website) + end + end + end + end end end end + + def open_url(url) + case RUBY_PLATFORM + when /mingw/ # windows + system("start #{url}") + when /linux/ + system("xdg-open #{url}") + when /darwin/ # macos + system("open #{url}") + end + end end end end \ No newline at end of file