From 16b4933305d14157048d160c2561511a919cde9e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20B=C3=BChler?= <david.buhler@cea.fr>
Date: Fri, 10 Jun 2022 17:49:04 +0200
Subject: [PATCH] [ivette] ASTview: new icons to fold/unfold all ACSL
 properties.

---
 ivette/src/dome/renderer/controls/gallery.json | 12 ++++++++++++
 ivette/src/frama-c/kernel/ASTview.tsx          | 11 +++++++----
 ivette/src/frama-c/kernel/style.css            |  5 +++++
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/ivette/src/dome/renderer/controls/gallery.json b/ivette/src/dome/renderer/controls/gallery.json
index 719e0b83804..efae6ebd993 100644
--- a/ivette/src/dome/renderer/controls/gallery.json
+++ b/ivette/src/dome/renderer/controls/gallery.json
@@ -325,6 +325,18 @@
     "viewBox": "0 0 16 16",
     "path": "M16 0h-6.5l2.5 2.5-3 3 1.5 1.5 3-3 2.5 2.5z M16 16v-6.5l-2.5 2.5-3-3-1.5 1.5 3 3-2.5 2.5z M0 16h6.5l-2.5-2.5 3-3-1.5-1.5-3 3-2.5-2.5z M0 0v6.5l2.5-2.5 3 3 1.5-1.5-3-3 2.5-2.5z"
   },
+  "CHEVRON.CONTRACT": {
+    "section": "Arrows",
+    "title": "Chevron.contract",
+    "viewBox": "0 0 16 16",
+    "path": "M3.646 13.854a.5.5 0 0 0 .708 0L8 10.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708zm0-11.708a.5.5 0 0 1 .708 0L8 5.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708z"
+  },
+  "CHEVRON.EXPAND": {
+    "section": "Arrows",
+    "title": "Chevron.expand",
+    "viewBox": "0 0 16 16",
+    "path": "M3.646 9.146a.5.5 0 0 1 .708 0L8 12.793l3.646-3.647a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 0-.708zm0-2.292a.5.5 0 0 0 .708 0L8 3.207l3.646 3.647a.5.5 0 0 0 .708-.708l-4-4a.5.5 0 0 0-.708 0l-4 4a.5.5 0 0 0 0 .708z"
+  },
   "MEDIA.PREV": {
     "section": "Media",
     "title": "Previous",
diff --git a/ivette/src/frama-c/kernel/ASTview.tsx b/ivette/src/frama-c/kernel/ASTview.tsx
index fa1c851a6f2..6b1dd2729ad 100644
--- a/ivette/src/frama-c/kernel/ASTview.tsx
+++ b/ivette/src/frama-c/kernel/ASTview.tsx
@@ -35,7 +35,7 @@ import { IconButton } from 'dome/controls/buttons';
 import type { key } from 'dome/data/json';
 import { RichTextBuffer } from 'dome/text/buffers';
 import { Text } from 'dome/text/editors';
-import { Hfill } from 'dome/layout/boxes';
+import { Filler, Inset } from 'dome/frame/toolbars';
 
 import * as Preferences from 'ivette/prefs';
 
@@ -336,19 +336,22 @@ export default function ASTview(): JSX.Element {
   return (
     <>
       <TitleBar>
-        <Hfill />
+        <Filler />
         <IconButton
-          icon='ANGLE.RIGHT'
+          icon='CHEVRON.CONTRACT'
           visible={true}
           onClick={foldAll}
           title='Collapse all multi-line ACSL properties'
+          className="titlebar-thin-icon"
         />
         <IconButton
-          icon='ANGLE.DOWN'
+          icon='CHEVRON.EXPAND'
           visible={true}
           onClick={unfoldAll}
           title='Expand all multi-line ACSL properties'
+          className="titlebar-thin-icon"
         />
+        <Inset />
       </TitleBar>
       <Text
         buffer={buffer}
diff --git a/ivette/src/frama-c/kernel/style.css b/ivette/src/frama-c/kernel/style.css
index 9b5d8f34ae9..2ef1b533826 100644
--- a/ivette/src/frama-c/kernel/style.css
+++ b/ivette/src/frama-c/kernel/style.css
@@ -47,6 +47,11 @@
     background: var(--code-bullet);
 }
 
+/* More contrasted color for thinner icons. */
+.titlebar-thin-icon {
+    fill: var(--text);
+}
+
 /* -------------------------------------------------------------------------- */
 /* --- Globals                                                            --- */
 /* -------------------------------------------------------------------------- */
-- 
GitLab