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
09202737
Commit
09202737
authored
2 years ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[dome] updated tabs styling
parent
763e1262
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/style.css
+24
-26
24 additions, 26 deletions
ivette/src/dome/renderer/frame/style.css
ivette/src/dome/renderer/frame/tabs.tsx
+58
-29
58 additions, 29 deletions
ivette/src/dome/renderer/frame/tabs.tsx
with
82 additions
and
55 deletions
ivette/src/dome/renderer/frame/style.css
+
24
−
26
View file @
09202737
...
@@ -6,11 +6,11 @@
...
@@ -6,11 +6,11 @@
.dome-xTabsBar
{
.dome-xTabsBar
{
flex
:
0
1
auto
;
flex
:
0
1
auto
;
flex-flow
:
row
wrap
;
position
:
relative
;
position
:
relative
;
height
:
20px
;
height
:
20px
;
width
:
calc
(
100%
+
1px
);
/* hides last border */
width
:
calc
(
100%
+
1px
);
/* hides last border */
display
:
flex
;
display
:
flex
;
flex
:
row
wrap
;
border-width
:
1px
;
border-width
:
1px
;
border-bottom-style
:
solid
;
border-bottom-style
:
solid
;
}
}
...
@@ -25,59 +25,57 @@
...
@@ -25,59 +25,57 @@
/* Tab Item */
/* Tab Item */
.dome-xTab
{
.dome-xTab
{
flex
:
1
1
150px
;
display
:
flex
;
position
:
relative
;
position
:
relative
;
font-size
:
10px
;
font-size
:
10px
;
text-align
:
center
;
text-align
:
center
;
padding
:
4px
20px
4px
20px
;
padding
:
4px
;
border-color
:
inherit
;
border-color
:
inherit
;
border-width
:
1px
;
border-width
:
1px
;
border-top-style
:
none
;
border-top-style
:
none
;
border-bottom-style
:
none
;
border-bottom-style
:
none
;
border-left-style
:
none
;
border-left-style
:
none
;
border-right-style
:
solid
;
border-right-style
:
solid
;
height
:
100%
;
}
}
.dome-xTab.dome-inactive
:hover
{
.dome-xTab.dome-active
{
background
:
var
(
--background-disabled-hover
)
;
flex
:
1
1
auto
;
background
:
var
(
--background-intense
);
}
}
.dome-xTab.dome-inactive
{
.dome-xTab.dome-inactive
{
flex
:
0
1
150px
;
color
:
var
(
--text-discrete
)
;
color
:
var
(
--text-discrete
)
;
border-color
:
var
(
--border
)
;
border-color
:
var
(
--border
)
;
background
:
var
(
--background-
disable
d
)
;
background
:
var
(
--background-
profoun
d
);
}
}
/* Closing Tab button */
.dome-xTab.dome-inactive
:hover
{
background
:
var
(
--background-profound-hover
);
}
.dome-xTab-
closing
{
.dome-xTab-
icon
{
display
:
inline
;
flex
:
0
0
12px
;
border-radius
:
4px
;
border-radius
:
4px
;
position
:
absolute
;
width
:
12px
;
height
:
12px
;
padding
:
2px
;
top
:
2px
;
opacity
:
0
;
transition
:
opacity
.1s
linear
0.1s
,
background
.1s
linear
0.1s
;
}
}
.dome-platform-darwin
.dome-xTab-closing
{
.dome-xTab-icon
:hover
{
right
:
initial
;
background
:
var
(
--background-button-hover
);
left
:
5px
;
}
}
.dome-xTab-closing
{
.dome-xTab-icon.dome-inactive
{
right
:
5px
;
fill
:
var
()
left
:
initial
;
}
}
.dome-xTab-closing
:hover
{
.dome-xTab-label
{
background
:
var
(
--background-button-hover
);
flex
:
0
1
auto
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
}
}
.dome-xTab
:hover
.dome-xTab-closing
{
.dome-xTab
-filler
{
opacity
:
1
;
flex
:
1
1
0px
;
}
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
...
...
This diff is collapsed.
Click to expand it.
ivette/src/dome/renderer/frame/tabs.tsx
+
58
−
29
View file @
09202737
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
{
Icon
}
from
'
dome/controls/icons
'
;
import
{
Icon
}
from
'
dome/controls/icons
'
;
import
{
classes
}
from
'
dome/misc/utils
'
;
import
'
./style.css
'
;
import
'
./style.css
'
;
...
@@ -55,48 +56,76 @@ export function TabsBar(props: TabsBarProps): JSX.Element {
...
@@ -55,48 +56,76 @@ export function TabsBar(props: TabsBarProps): JSX.Element {
// --- Single Tab
// --- Single Tab
// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
export
interface
TabProps
<
A
>
{
export
interface
TabIcon
{
/** Tab's identifier. */
icon
:
string
;
value
:
A
;
title
?:
string
;
display
?:
boolean
;
enabled
?:
boolean
;
onClick
?:
()
=>
void
;
}
export
interface
TabProps
{
/** Tab's label icon. */
icon
?:
string
;
/** Tab's label. */
/** Tab's label. */
label
?:
string
;
label
?:
string
;
/** Tab's tooltip text. */
/** Tab's tooltip text. */
title
?:
string
;
title
?:
string
;
/** Close tab's tooltip text. */
closing
?:
string
;
/** Currently selected tab. */
/** Currently selected tab. */
selection
?:
A
;
selected
:
boolean
;
headIcons
?:
TabIcon
[];
tailIcons
?:
TabIcon
[];
/** Selection callback. */
/** Selection callback. */
onSelection
?:
(
value
:
A
)
=>
void
;
onSelection
:
()
=>
void
;
/** Closing callback. */
onClose
?:
(
value
:
A
)
=>
void
;
}
}
/** Tab Selector. */
/** Tab Selector. */
export
function
Tab
<
A
>
(
props
:
TabProps
<
A
>
):
JSX
.
Element
{
export
function
Tab
(
props
:
TabProps
):
JSX
.
Element
{
const
{
value
,
selection
,
onSelection
,
onClose
}
=
props
;
const
{
icon
,
selected
,
onSelection
}
=
props
;
const
selected
=
value
===
selection
;
// --- Tab Rendering
// --- Tab Rendering
const
onSelect
=
onSelection
&&
(()
=>
onSelection
(
value
));
const
{
headIcons
=
[],
tailIcons
=
[]
}
=
props
;
const
onClosed
=
onClose
&&
(()
=>
onClose
(
value
));
const
makeIcon
=
(
icn
:
TabIcon
):
JSX
.
Element
|
null
=>
{
const
closing
=
onClose
?
(
const
{
icon
,
title
,
display
=
true
,
enabled
=
true
}
=
icn
;
<
Icon
if
(
!
display
)
return
null
;
className
=
"dome-xTab-closing"
const
className
=
classes
(
title
=
{
props
.
closing
||
'
Close Tab
'
}
'
dome-xTab-icon
'
,
id
=
"CROSS"
!
enabled
&&
'
dome-control-disabled
'
onClick
=
{
onClosed
}
);
/>
return
(
)
:
undefined
;
<
Icon
key
=
{
icon
}
const
classes
=
`dome-xTab
${
selected
?
'
dome-active
'
:
'
dome-inactive
'
}
`
;
className
=
{
className
}
title
=
{
title
}
id
=
{
icon
}
size
=
{
10
}
offset
=
{
1
}
onClick
=
{
enabled
?
icn
.
onClick
:
undefined
}
/>
);
};
const
labelIcon
=
icon
?
(
<
Icon
key
=
'icon'
className
=
'dome-xTab-icon'
id
=
{
icon
}
size
=
{
10
}
offset
=
{
1
}
/>
)
:
null
;
const
header
=
selected
?
headIcons
.
map
(
makeIcon
)
:
null
;
const
trailer
=
selected
?
tailIcons
.
map
(
makeIcon
)
:
null
;
const
classNames
=
classes
(
'
dome-xTab
'
,
selected
?
'
dome-active
'
:
'
dome-inactive
'
);
return
(
return
(
<
label
<
div
className
=
{
classes
}
className
=
{
class
Nam
es
}
title
=
{
props
.
title
}
title
=
{
props
.
title
}
onClick
=
{
onSelect
}
onClick
=
{
onSelect
ion
}
>
>
{
props
.
label
}
{
header
}
{
closing
}
<
div
className
=
'dome-xTab-filler'
/>
</
label
>
{
labelIcon
}
<
label
key
=
'name'
className
=
'dome-xTab-label'
>
{
props
.
label
}
</
label
>
<
div
className
=
'dome-xTab-filler'
/>
{
trailer
}
</
div
>
);
);
}
}
...
...
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