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
a250b5a2
Commit
a250b5a2
authored
3 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[dome] restore initial toolbar switch position
parent
9a9a307d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ivette/src/dome/renderer/frame/toolbars.tsx
+10
-16
10 additions, 16 deletions
ivette/src/dome/renderer/frame/toolbars.tsx
ivette/src/ivette/prefs.tsx
+2
-12
2 additions, 12 deletions
ivette/src/ivette/prefs.tsx
with
12 additions
and
28 deletions
ivette/src/dome/renderer/frame/toolbars.tsx
+
10
−
16
View file @
a250b5a2
...
@@ -160,31 +160,25 @@ export interface SwitchProps {
...
@@ -160,31 +160,25 @@ export interface SwitchProps {
enabled
?:
boolean
;
enabled
?:
boolean
;
/** Defaults to `false`. */
/** Defaults to `false`. */
disabled
?:
boolean
;
disabled
?:
boolean
;
/** Switch value.
/** Switch position. Defaults to 'left'. */
When checked, the slide is switched to « right » position.
position
?:
'
left
'
|
'
right
'
;
Defaults to false. */
checked
?:
boolean
;
/** Click callback. */
/** Click callback. */
onChange
?:
(
newValue
:
boolean
)
=>
void
;
onChange
?:
(
newPosition
:
'
left
'
|
'
right
'
)
=>
void
;
/** Right Click callback. */
onContextMenu
?:
()
=>
void
;
}
}
/** Toolbar Switch. */
/** Toolbar
Left/Right
Switch. */
export
function
Switch
(
props
:
SwitchProps
)
{
export
function
Switch
(
props
:
SwitchProps
)
{
const
{
checked
=
false
,
onChange
}
=
props
;
const
{
position
,
onChange
}
=
props
;
const
{
title
=
''
,
className
=
''
,
style
}
=
props
;
const
checked
=
position
===
'
right
'
;
const
{
title
,
className
,
style
}
=
props
;
const
{
enabled
=
true
,
disabled
=
false
}
=
props
;
const
{
enabled
=
true
,
disabled
=
false
}
=
props
;
const
callback
=
onChange
&&
(()
=>
onChange
(
!
checked
));
const
callback
=
onChange
&&
(()
=>
onChange
(
checked
?
'
left
'
:
'
right
'
));
if
(
disabled
||
!
enabled
)
return
null
;
if
(
disabled
||
!
enabled
)
return
null
;
return
(
return
(
<
label
<
label
className
=
{
classes
(
'
dome-xSwitch
'
,
className
)
}
style
=
{
style
}
>
className
=
{
'
dome-xSwitch
'
+
className
}
style
=
{
style
}
onContextMenu
=
{
props
.
onContextMenu
}
>
<
input
type
=
{
'
checkbox
'
}
checked
=
{
checked
}
onChange
=
{
callback
}
/>
<
input
type
=
{
'
checkbox
'
}
checked
=
{
checked
}
onChange
=
{
callback
}
/>
<
span
className
=
{
'
dome-xSwitch-slider
'
}
title
=
{
title
}
/>
<
span
className
=
{
'
dome-xSwitch-slider
'
}
title
=
{
title
}
/>
</
label
>
</
label
>
);
);
}
}
...
...
This diff is collapsed.
Click to expand it.
ivette/src/ivette/prefs.tsx
+
2
−
12
View file @
a250b5a2
...
@@ -50,28 +50,18 @@ export const SourceWrapText = new Settings.GFalse('SourceCode.wrapText');
...
@@ -50,28 +50,18 @@ export const SourceWrapText = new Settings.GFalse('SourceCode.wrapText');
/* --- Theme Switcher Button --- */
/* --- Theme Switcher Button --- */
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
const
themeEntries
:
Dome
.
PopupMenuItem
[]
=
[
{
id
:
'
light
'
,
label
:
'
Switch to Light Theme
'
},
{
id
:
'
dark
'
,
label
:
'
Switch to Dark Theme
'
},
{
id
:
'
system
'
,
label
:
'
Switch to System Default
'
},
];
export
function
ThemeSwitch
():
JSX
.
Element
{
export
function
ThemeSwitch
():
JSX
.
Element
{
const
[
theme
,
setTheme
]
=
Themes
.
useColorTheme
();
const
[
theme
,
setTheme
]
=
Themes
.
useColorTheme
();
const
other
=
theme
===
'
dark
'
?
'
light
'
:
'
dark
'
;
const
other
=
theme
===
'
dark
'
?
'
light
'
:
'
dark
'
;
const
position
=
theme
===
'
dark
'
?
'
left
'
:
'
right
'
;
const
title
=
`Switch to
${
other
}
theme (right-click for full choice)`
;
const
title
=
`Switch to
${
other
}
theme (right-click for full choice)`
;
const
onChange
=
():
void
=>
setTheme
(
other
);
const
onChange
=
():
void
=>
setTheme
(
other
);
const
onPopup
=
():
void
=>
Dome
.
popupMenu
(
themeEntries
,
(
th
)
=>
setTheme
(
Themes
.
jColorSettings
(
th
))
);
return
(
return
(
<
Toolbar
.
Switch
<
Toolbar
.
Switch
disabled
=
{
!
Dome
.
DEVEL
}
disabled
=
{
!
Dome
.
DEVEL
}
title
=
{
title
}
title
=
{
title
}
checked
=
{
theme
===
'
dark
'
}
position
=
{
position
}
onChange
=
{
onChange
}
onChange
=
{
onChange
}
onContextMenu
=
{
onPopup
}
/>
/>
);
);
}
}
...
...
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