diff --git a/CHANGELOG.md b/CHANGELOG.md index 61ee08dd..b97d7c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,10 @@ heading, and (b) bumping `project.yaml` `version:` in the same commit. and context panel sizes, active sections, and editor split ratio saved to `.clide/settings.yaml` (D-053, T-032). +- Phosphor Icons font (v2.0.8, MIT) — regular, bold, and fill + weights. Replaces hand-painted CustomPaint icons in sidebar and + context panel icon rails. + ### Changed - Workspace renders Claude as the always-visible primary surface diff --git a/app/assets/fonts/phosphor/LICENSE b/app/assets/fonts/phosphor/LICENSE new file mode 100644 index 00000000..78c98108 --- /dev/null +++ b/app/assets/fonts/phosphor/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Phosphor Icons + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/app/assets/fonts/phosphor/Phosphor-Bold.ttf b/app/assets/fonts/phosphor/Phosphor-Bold.ttf new file mode 100644 index 00000000..17792346 Binary files /dev/null and b/app/assets/fonts/phosphor/Phosphor-Bold.ttf differ diff --git a/app/assets/fonts/phosphor/Phosphor-Fill.ttf b/app/assets/fonts/phosphor/Phosphor-Fill.ttf new file mode 100644 index 00000000..b02c4cb2 Binary files /dev/null and b/app/assets/fonts/phosphor/Phosphor-Fill.ttf differ diff --git a/app/assets/fonts/phosphor/Phosphor.ttf b/app/assets/fonts/phosphor/Phosphor.ttf new file mode 100644 index 00000000..7c1b8a7a Binary files /dev/null and b/app/assets/fonts/phosphor/Phosphor.ttf differ diff --git a/app/assets/licenses.yaml b/app/assets/licenses.yaml index d0dda3fe..d4fd781c 100644 --- a/app/assets/licenses.yaml +++ b/app/assets/licenses.yaml @@ -66,6 +66,18 @@ dependencies: range available via the variable-font weight axis. weights_bundled: [VariableFont, Italic-VariableFont] + - name: Phosphor Icons + kind: font + version: "2.0.8" + homepage: https://phosphoricons.com + license: MIT + license_file: assets/fonts/phosphor/LICENSE + purpose: >- + Icon font for UI glyphs throughout the IDE — sidebar sections, + context panel, toolbar, and editor chrome. Regular, Bold, and + Fill weights bundled. + weights_bundled: [Regular, Bold, Fill] + - name: yaml kind: dart-package version: "3.1.3" diff --git a/app/lib/app.dart b/app/lib/app.dart index b0656a15..fce561d0 100644 --- a/app/lib/app.dart +++ b/app/lib/app.dart @@ -305,11 +305,13 @@ class _SidebarSlot extends StatelessWidget { static ClideIconPainter _iconFor(TabContribution t) { if (t.icon is ClideIconPainter) return t.icon as ClideIconPainter; return switch (t.id) { - 'files.tree' => const FolderIcon(), - 'git.panel' => const GitBranchIcon(), - 'pql.panel' => const SearchIcon(), - 'problems.panel' => const WarningIcon(), - _ => const DotIcon(), + 'files.tree' => PhosphorIcons.folder, + 'git.panel' => PhosphorIcons.gitBranch, + 'pql.panel' => PhosphorIcons.magnifyingGlass, + 'problems.panel' => PhosphorIcons.warningCircle, + 'decisions.panel' => PhosphorIcons.lightbulb, + 'tickets.panel' => PhosphorIcons.ticket, + _ => PhosphorIcons.circlesFour, }; } } @@ -445,9 +447,10 @@ class _ContextSlot extends StatelessWidget { static ClideIconPainter _iconFor(TabContribution t) { if (t.icon is ClideIconPainter) return t.icon as ClideIconPainter; return switch (t.id) { - 'markdown.viewer' => const DotIcon(), - 'graph.view' => const SearchIcon(), - _ => const DotIcon(), + 'markdown.viewer' => PhosphorIcons.eye, + 'graph.view' => PhosphorIcons.graph, + 'pql.backlinks' => PhosphorIcons.link, + _ => PhosphorIcons.circlesFour, }; } } diff --git a/app/lib/widgets/src/icons/phosphor.dart b/app/lib/widgets/src/icons/phosphor.dart new file mode 100644 index 00000000..0ce830c1 --- /dev/null +++ b/app/lib/widgets/src/icons/phosphor.dart @@ -0,0 +1,71 @@ +import 'dart:ui' as ui; + +import 'package:clide_app/widgets/src/clide_icon.dart'; + +class PhosphorIconPainter extends ClideIconPainter { + const PhosphorIconPainter(this.codePoint, {this.family = 'Phosphor'}); + + final int codePoint; + final String family; + + @override + void paint(ui.Canvas canvas, ui.Color color) { + final builder = ui.ParagraphBuilder(ui.ParagraphStyle(fontFamily: family, fontSize: 0.88, height: 1.0)) + ..pushStyle(ui.TextStyle(color: color, fontFamily: family)) + ..addText(String.fromCharCode(codePoint)); + final paragraph = builder.build()..layout(const ui.ParagraphConstraints(width: 1.0)); + final dx = (1.0 - paragraph.maxIntrinsicWidth) / 2; + final dy = (1.0 - paragraph.height) / 2; + canvas.drawParagraph(paragraph, ui.Offset(dx, dy)); + } + + @override + bool operator ==(Object other) => other is PhosphorIconPainter && other.codePoint == codePoint && other.family == family; + + @override + int get hashCode => Object.hash(codePoint, family); +} + +abstract class PhosphorIcons { + static const folder = PhosphorIconPainter(0xe24a); + static const fileText = PhosphorIconPainter(0xe23a); + static const gitBranch = PhosphorIconPainter(0xe278); + static const gitCommit = PhosphorIconPainter(0xe27a); + static const gitDiff = PhosphorIconPainter(0xe27c); + static const gitPullRequest = PhosphorIconPainter(0xe282); + static const magnifyingGlass = PhosphorIconPainter(0xe30c); + static const terminal = PhosphorIconPainter(0xe47e); + static const terminalWindow = PhosphorIconPainter(0xeae8); + static const code = PhosphorIconPainter(0xe1bc); + static const codeBlock = PhosphorIconPainter(0xeafe); + static const pencilSimple = PhosphorIconPainter(0xe3b4); + static const eye = PhosphorIconPainter(0xe220); + static const eyeSlash = PhosphorIconPainter(0xe224); + static const arrowsOutSimple = PhosphorIconPainter(0xe0a6); + static const arrowsInSimple = PhosphorIconPainter(0xe09e); + static const list = PhosphorIconPainter(0xe2f0); + static const listChecks = PhosphorIconPainter(0xeadc); + static const gear = PhosphorIconPainter(0xe270); + static const puzzlePiece = PhosphorIconPainter(0xe596); + static const keyboard = PhosphorIconPainter(0xe2d8); + static const palette = PhosphorIconPainter(0xe6c8); + static const warning = PhosphorIconPainter(0xe4e0); + static const warningCircle = PhosphorIconPainter(0xe4e2); + static const check = PhosphorIconPainter(0xe182); + static const checkCircle = PhosphorIconPainter(0xe184); + static const caretLeft = PhosphorIconPainter(0xe138); + static const caretRight = PhosphorIconPainter(0xe13a); + static const caretDown = PhosphorIconPainter(0xe136); + static const caretUp = PhosphorIconPainter(0xe13c); + static const graph = PhosphorIconPainter(0xeb58); + static const treeStructure = PhosphorIconPainter(0xe67c); + static const image = PhosphorIconPainter(0xe2ca); + static const link = PhosphorIconPainter(0xe2e2); + static const chatCircle = PhosphorIconPainter(0xe168); + static const robot = PhosphorIconPainter(0xe762); + static const ticket = PhosphorIconPainter(0xe490); + static const lightbulb = PhosphorIconPainter(0xe2dc); + static const notepad = PhosphorIconPainter(0xe63e); + static const bookOpen = PhosphorIconPainter(0xe0e6); + static const circlesFour = PhosphorIconPainter(0xe190); +} diff --git a/app/lib/widgets/widgets.dart b/app/lib/widgets/widgets.dart index cd1c5e61..7145928a 100644 --- a/app/lib/widgets/widgets.dart +++ b/app/lib/widgets/widgets.dart @@ -30,3 +30,4 @@ export 'src/icons/search.dart'; export 'src/icons/terminal_icon.dart'; export 'src/icons/warning.dart'; export 'src/icons/x.dart'; +export 'src/icons/phosphor.dart'; diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 3e3eda9f..100e7f88 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -70,6 +70,7 @@ flutter: - assets/LICENSE - assets/fonts/jetbrains_mono/OFL.txt - assets/fonts/josefin_sans/OFL.txt + - assets/fonts/phosphor/LICENSE - assets/logo/clide-logo.svg - assets/logo/clide-logo-16.png - assets/logo/clide-logo-32.png @@ -97,6 +98,13 @@ flutter: - asset: assets/fonts/josefin_sans/JosefinSans-Italic-VariableFont.ttf style: italic + - family: Phosphor + fonts: + - asset: assets/fonts/phosphor/Phosphor.ttf + - asset: assets/fonts/phosphor/Phosphor-Bold.ttf + weight: 700 + - asset: assets/fonts/phosphor/Phosphor-Fill.ttf + - family: JetBrainsMono fonts: - asset: assets/fonts/jetbrains_mono/JetBrainsMono-Regular.ttf