focus on your browsing
browser web-browser

add custom symbolic icons

+81 -9
+3
.gitignore
··· 8 8 9 9 # gtkbuilder ui files 10 10 *.ui 11 + 12 + # compiled gresources 13 + *.gresource
+13 -2
Justfile
··· 7 7 OuchBrowser/UI \ 8 8 OuchBrowser/UI \ 9 9 {{ BLUEPRINT_FILES }} 10 + glib-compile-resources \ 11 + --sourcedir OuchBrowser/Icons \ 12 + --target=OuchBrowser/OuchBrowser.app.gresource \ 13 + OuchBrowser/OuchBrowser.gresource.xml 10 14 dotnet run --project OuchBrowser 11 15 12 16 build: ··· 14 18 OuchBrowser/UI \ 15 19 OuchBrowser/UI \ 16 20 {{ BLUEPRINT_FILES }} 21 + glib-compile-resources \ 22 + --sourcedir OuchBrowser/Icons \ 23 + --target=OuchBrowser/OuchBrowser.app.gresource \ 24 + OuchBrowser/OuchBrowser.gresource.xml 17 25 dotnet build OuchBrowser 18 26 19 27 publish: ··· 21 29 OuchBrowser/UI \ 22 30 OuchBrowser/UI \ 23 31 {{ BLUEPRINT_FILES }} 24 - dotnet publish OuchBrowser 32 + glib-compile-resources \ 33 + --sourcedir OuchBrowser/Icons \ 34 + --target=OuchBrowser/OuchBrowser.app.gresource \ 35 + OuchBrowser/OuchBrowser.gresource.xml 36 + dotnet publish OuchBrowser 25 37 26 38 fmt: 27 39 blueprint-compiler format -f -t -s 4 {{ BLUEPRINT_FILES }} 28 40 dotnet format 29 -
+2
OuchBrowser/Icons/shoe-box-symbolic.svg
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <svg xmlns="http://www.w3.org/2000/svg" height="16px" viewBox="0 0 16 16" width="16px"><path d="m 2 1 c -1.109375 0 -2 0.890625 -2 2 v 2 c 0 0.75 0.40625 1.398438 1.015625 1.742188 c -0.011719 0.085937 -0.015625 0.171874 -0.015625 0.257812 v 7 c 0 1.109375 0.890625 2 2 2 h 10 c 1.109375 0 2 -0.890625 2 -2 v -7 c 0 -0.085938 -0.003906 -0.171875 -0.015625 -0.257812 c 0.609375 -0.34375 1.015625 -0.992188 1.015625 -1.742188 v -2 c 0 -1.109375 -0.890625 -2 -2 -2 z m 0 2 h 12 v 2 h -12 z m 1 4 h 10 v 7 h -10 z m 0 0" fill="#2e3436"/><path d="m 6 8 h 4 v 1 h -4 z m 0 0" fill="#222222"/></svg>
+16
OuchBrowser/Icons/site.srht.shrimple.ouch-symbolic.svg
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <svg width="16px" height="16px" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> 3 + <filter id="a" x="0" y="0" width="1" height="1"> 4 + <feColorMatrix color-interpolation-filters="sRGB" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"/> 5 + </filter> 6 + <mask id="b"> 7 + <g filter="url(#a)"> 8 + <rect x="-1.6" y="-1.6" width="19.2" height="19.2" fill-opacity=".3448"/> 9 + </g> 10 + </mask> 11 + <clipPath id="c"> 12 + <rect width="192" height="152"/> 13 + </clipPath> 14 + <path d="m13.494 0.91406c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938zm0 0c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938zm0 0c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938zm0 0c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938zm0.0059 0c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938zm0 0c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938zm0 0c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938zm0 0c-1.125-1.125-2.9727-1.125-4.0977 0l-8.4844 8.4844c-1.125 1.1211-1.125 2.9727 0 4.0938l1.5938 1.5938c1.125 1.125 2.9727 1.125 4.0977 0l8.4844-8.4844c1.125-1.1211 1.125-2.9727 0-4.0938z" fill="#241f31" stop-color="#000000" style="-inkscape-stroke:none;font-variation-settings:normal"/> 15 + <path d="m2.5117 0.91406c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938zm0 0c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938zm0 0c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938zm0 0c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938zm-0.00586 0c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938zm0 0c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938zm0 0c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938zm0 0c1.125-1.125 2.9727-1.125 4.0977 0l8.4844 8.4844c1.125 1.1211 1.125 2.9727 0 4.0938l-1.5938 1.5938c-1.125 1.125-2.9727 1.125-4.0977 0l-8.4844-8.4844c-1.125-1.1211-1.125-2.9727 0-4.0938z" fill="#241f31" fill-opacity=".6" stop-color="#000000" style="-inkscape-stroke:none;font-variation-settings:normal"/> 16 + </svg>
+14 -3
OuchBrowser/OuchBrowser.csproj
··· 20 20 </ItemGroup> 21 21 22 22 <ItemGroup> 23 - <EmbeddedResource Include="UI\Window.ui"> 24 - <LogicalName>UI\Window.ui</LogicalName> 25 - </EmbeddedResource> 23 + <EmbeddedResource 24 + Include="OuchBrowser.app.gresource" 25 + LogicalName="OuchBrowser.app.gresource" 26 + /> 27 + <EmbeddedResource 28 + Include="Icons\shoe-box-symbolic.svg" 29 + LogicalName="shoe-box-symbolic.svg" 30 + /> 31 + <EmbeddedResource 32 + Include="Icons\site.srht.shrimple.ouch-symbolic.svg" 33 + LogicalName="site.srht.shrimple.ouch-symbolic.svg" 34 + /> 35 + 36 + <EmbeddedResource Include="UI\Window.ui" LogicalName="UI\Window.ui" /> 26 37 </ItemGroup> 27 38 28 39 <ItemGroup>
+7
OuchBrowser/OuchBrowser.gresource.xml
··· 1 + <?xml version="1.0" encoding="UTF-8" ?> 2 + <gresources> 3 + <gresource prefix="/site/srht/shrimple/OuchBrowserNET/icons/scalable/actions/"> 4 + <file preprocess="xml-stripblanks">shoe-box-symbolic.svg</file> 5 + <file preprocess="xml-stripblanks">site.srht.shrimple.ouch-symbolic.svg</file> 6 + </gresource> 7 + </gresources>
+21 -1
OuchBrowser/Program.cs
··· 1 + using System.Reflection; 1 2 using Gio; 2 - using System; 3 + using GLib; 3 4 using Application = Adw.Application; 4 5 5 6 namespace OuchBrowser; ··· 12 13 ApplicationFlags.FlagsNone 13 14 ); 14 15 var window = new Window(); 16 + RegisterResources(); 15 17 16 18 app.OnStartup += Window.OnStartup; 17 19 app.OnActivate += Window.OnActivate; 18 20 19 21 return app.RunWithSynchronizationContext(null); 22 + } 23 + 24 + private static void RegisterResources() { 25 + using var stream = Assembly.GetExecutingAssembly() 26 + .GetManifestResourceStream("OuchBrowser.app.gresource"); 27 + 28 + var buffer = new byte[stream!.Length]; 29 + stream.ReadExactly(buffer); 30 + 31 + using var bytes = Bytes.New(buffer); 32 + using var resource = Resource.NewFromData(bytes); 33 + resource.Register(); 34 + 35 + var display = Gdk.Display.GetDefault(); 36 + if (display is null) return; 37 + 38 + var iconTheme = Gtk.IconTheme.GetForDisplay(display); 39 + iconTheme.AddResourcePath("/site/srht/shrimple/OuchBrowserNET/icons"); 20 40 } 21 41 }
+5 -3
OuchBrowser/UI/Window.blp
··· 11 11 Adw.HeaderBar { 12 12 [start] 13 13 Button { 14 - icon-name: "start-here-symbolic"; 14 + icon-name: "site.srht.shrimple.ouch-symbolic"; 15 15 } 16 16 17 17 [start] ··· 119 119 120 120 [bottom] 121 121 Adw.HeaderBar { 122 + show-title: false; 123 + 122 124 [start] 123 - Adw.TabButton { 124 - view: view; 125 + Button { 126 + icon-name: "shoe-box-symbolic"; 125 127 action-name: "overview.open"; 126 128 } 127 129 }