Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dima Gerasimov
Browser application
Commits
040b3aeb
Commit
040b3aeb
authored
4 years ago
by
_
Browse files
Options
Download
Email Patches
Plain Diff
tweak ui
parent
05fe2b87
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
demo-react.tsx
+34
-1
demo-react.tsx
memri/gui/swiftUI.tsx
+6
-6
memri/gui/swiftUI.tsx
with
40 additions
and
7 deletions
+40
-7
demo-react.tsx
+
34
-
1
View file @
040b3aeb
...
...
@@ -6,6 +6,39 @@ import {Application} from "./memri/gui/Application";
import
{
RootContext
}
from
"
./memri/context/MemriContext
"
;
import
{
debugHistory
}
from
"
./memri/cvu/views/ViewDebugger
"
;
import
{
makeStyles
}
from
'
@material-ui/core/styles
'
;
function
importCssString
(
cssText
,
id
)
{
cssText
+=
"
\n
/*# sourceURL=css:/
"
+
id
+
"
*/
"
;
var
style
=
document
.
createElement
(
"
style
"
);
style
.
appendChild
(
document
.
createTextNode
(
cssText
));
document
.
head
.
appendChild
(
style
);
};
importCssString
(
`
body {margin: 0}
.Application {
display: flex;
align-items: center;
justify-content: center;
}
.ScreenSizer {
outline: solid;
}
.HStack {
flex-direction: row;
display: flex;
}
.VStack {
flex-direction: column;
display: flex;
}
.ZStack {
position: relative;
}
`
,
"
main.css
"
)
let
context
=
new
RootContext
(
"
Memri GUI
"
);
context
.
installer
.
await
(
context
,()
=>
{
context
.
boot
(
false
,
(
error
)
=>
{
...
...
@@ -41,7 +74,7 @@ export var geom = {
}
function
updateSize
()
{
geom
.
size
.
height
=
window
.
innerHeight
;
geom
.
size
.
height
=
window
.
innerHeight
-
4
;
geom
.
size
.
width
=
Math
.
min
(
window
.
innerWidth
,
414
);
}
window
.
onresize
=
updateSize
...
...
This diff is collapsed.
Click to expand it.
memri/gui/swiftUI.tsx
+
6
-
6
View file @
040b3aeb
...
...
@@ -325,9 +325,9 @@ export class VStack extends MainUI {
render
()
{
let
{
font
,
padding
,
foregroundColor
,
spacing
,
frame
,
zIndex
,
centeredOverlayWithinBoundsPreferenceKey
,
...
other
}
=
this
.
props
;
return
(
<
Box
display
=
"flex"
{
...
this
.
setAlignment
()
}
flexDirection
=
"column"
style
=
{
this
.
setStyles
()
}
className
=
"VStack"
{
...
other
}
>
<
div
{
...
this
.
setAlignment
()
}
flexDirection
=
"column"
style
=
{
this
.
setStyles
()
}
className
=
"VStack"
{
...
other
}
>
{
this
.
props
.
children
}
</
Box
>
</
div
>
)
}
}
...
...
@@ -336,9 +336,9 @@ export class ZStack extends MainUI {
render
()
{
let
{
font
,
padding
,
foregroundColor
,
spacing
,
frame
,
zIndex
,
centeredOverlayWithinBoundsPreferenceKey
,
...
other
}
=
this
.
props
;
return
(
<
Box
{
...
this
.
setAlignment
()
}
style
=
{
this
.
setStyles
()
}
className
=
"ZStack"
{
...
other
}
>
<
div
{
...
this
.
setAlignment
()
}
style
=
{
this
.
setStyles
()
}
className
=
"ZStack"
{
...
other
}
>
{
this
.
props
.
children
}
</
Box
>
</
div
>
)
}
}
...
...
@@ -347,9 +347,9 @@ export class HStack extends MainUI {
render
()
{
let
{
font
,
padding
,
foregroundColor
,
spacing
,
frame
,
zIndex
,
centeredOverlayWithinBoundsPreferenceKey
,
...
other
}
=
this
.
props
;
return
(
<
Box
display
=
"flex"
flexDirection
=
"row"
{
...
this
.
setAlignment
()
}
style
=
{
this
.
setStyles
()
}
className
=
"HStack"
{
...
other
}
>
<
div
{
...
this
.
setAlignment
()
}
style
=
{
this
.
setStyles
()
}
className
=
"HStack"
{
...
other
}
>
{
this
.
props
.
children
}
</
Box
>
</
div
>
)
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment