Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
f643b2a1
Commit
f643b2a1
authored
3 years ago
by
Maxime Jacquemin
Committed by
Loïc Correnson
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[ivette] Calls to useThemeColors at the beginning of functions
Avoiding potential futur errors.
parent
6caa2551
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ivette/src/frama-c/kernel/ASTinfo.tsx
+2
-1
2 additions, 1 deletion
ivette/src/frama-c/kernel/ASTinfo.tsx
ivette/src/ivette/prefs.tsx
+2
-1
2 additions, 1 deletion
ivette/src/ivette/prefs.tsx
ivette/src/renderer/Controller.tsx
+2
-1
2 additions, 1 deletion
ivette/src/renderer/Controller.tsx
with
6 additions
and
3 deletions
ivette/src/frama-c/kernel/ASTinfo.tsx
+
2
−
1
View file @
f643b2a1
...
@@ -40,6 +40,7 @@ import { getInfo } from 'frama-c/kernel/api/ast';
...
@@ -40,6 +40,7 @@ import { getInfo } from 'frama-c/kernel/api/ast';
export
default
function
ASTinfo
():
JSX
.
Element
{
export
default
function
ASTinfo
():
JSX
.
Element
{
const
theme
=
Preferences
.
useThemeColors
();
const
buffer
=
React
.
useMemo
(()
=>
new
RichTextBuffer
(),
[]);
const
buffer
=
React
.
useMemo
(()
=>
new
RichTextBuffer
(),
[]);
const
[
selection
,
updateSelection
]
=
States
.
useSelection
();
const
[
selection
,
updateSelection
]
=
States
.
useSelection
();
const
marker
=
selection
?.
current
?.
marker
;
const
marker
=
selection
?.
current
?.
marker
;
...
@@ -65,7 +66,7 @@ export default function ASTinfo(): JSX.Element {
...
@@ -65,7 +66,7 @@ export default function ASTinfo(): JSX.Element {
<
Text
<
Text
buffer
=
{
buffer
}
buffer
=
{
buffer
}
mode
=
"text"
mode
=
"text"
theme
=
{
Preferences
.
useThemeColors
()
}
theme
=
{
theme
}
onSelection
=
{
onTextSelection
}
onSelection
=
{
onTextSelection
}
readOnly
readOnly
/>
/>
...
...
This diff is collapsed.
Click to expand it.
ivette/src/ivette/prefs.tsx
+
2
−
1
View file @
f643b2a1
...
@@ -95,12 +95,13 @@ export function useThemeColors() {
...
@@ -95,12 +95,13 @@ export function useThemeColors() {
export
function
useThemeButtons
(
props
:
ThemeProps
):
ThemeControls
{
export
function
useThemeButtons
(
props
:
ThemeProps
):
ThemeControls
{
const
[
fontSize
,
setFontSize
]
=
Settings
.
useGlobalSettings
(
props
.
fontSize
);
const
[
fontSize
,
setFontSize
]
=
Settings
.
useGlobalSettings
(
props
.
fontSize
);
const
[
wrapText
,
setWrapText
]
=
Settings
.
useGlobalSettings
(
props
.
wrapText
);
const
[
wrapText
,
setWrapText
]
=
Settings
.
useGlobalSettings
(
props
.
wrapText
);
const
theme
=
useThemeColors
();
const
zoomIn
=
()
=>
fontSize
<
48
&&
setFontSize
(
fontSize
+
2
);
const
zoomIn
=
()
=>
fontSize
<
48
&&
setFontSize
(
fontSize
+
2
);
const
zoomOut
=
()
=>
fontSize
>
4
&&
setFontSize
(
fontSize
-
2
);
const
zoomOut
=
()
=>
fontSize
>
4
&&
setFontSize
(
fontSize
-
2
);
const
flipWrapText
=
()
=>
setWrapText
(
!
wrapText
);
const
flipWrapText
=
()
=>
setWrapText
(
!
wrapText
);
const
{
disabled
=
false
}
=
props
;
const
{
disabled
=
false
}
=
props
;
return
{
return
{
theme
:
useThemeColors
()
,
theme
,
fontSize
,
fontSize
,
wrapText
,
wrapText
,
buttons
:
[
buttons
:
[
...
...
This diff is collapsed.
Click to expand it.
ivette/src/renderer/Controller.tsx
+
2
−
1
View file @
f643b2a1
...
@@ -197,6 +197,7 @@ export const Control = () => {
...
@@ -197,6 +197,7 @@ export const Control = () => {
const
editor
=
new
RichTextBuffer
();
const
editor
=
new
RichTextBuffer
();
const
RenderConsole
=
()
=>
{
const
RenderConsole
=
()
=>
{
const
theme
=
Preferences
.
useThemeColors
();
const
scratch
=
React
.
useRef
([]
as
string
[]);
const
scratch
=
React
.
useRef
([]
as
string
[]);
const
[
cursor
,
setCursor
]
=
React
.
useState
(
-
1
);
const
[
cursor
,
setCursor
]
=
React
.
useState
(
-
1
);
const
[
isEmpty
,
setEmpty
]
=
React
.
useState
(
true
);
const
[
isEmpty
,
setEmpty
]
=
React
.
useState
(
true
);
...
@@ -331,7 +332,7 @@ const RenderConsole = () => {
...
@@ -331,7 +332,7 @@ const RenderConsole = () => {
buffer
=
{
edited
?
editor
:
Server
.
buffer
}
buffer
=
{
edited
?
editor
:
Server
.
buffer
}
mode
=
"text"
mode
=
"text"
readOnly
=
{
!
edited
}
readOnly
=
{
!
edited
}
theme
=
{
Preferences
.
useThemeColors
()
}
theme
=
{
theme
}
/>
/>
</>
</>
);
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment