Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
1a74611c
"git@developer.sourcefind.cn:chenpangpang/ComfyUI.git" did not exist on "c6b7a157ed30eb2dd59891ba465b7b5be97a687a"
Commit
1a74611c
authored
Apr 05, 2023
by
missionfloyd
Browse files
Style modals to match rest of UI
parent
30f274bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
48 deletions
+55
-48
web/scripts/ui.js
web/scripts/ui.js
+21
-11
web/style.css
web/style.css
+34
-37
No files found.
web/scripts/ui.js
View file @
1a74611c
...
...
@@ -115,14 +115,6 @@ function dragElement(dragEl, settings) {
savePos
=
value
;
},
});
settings
.
addSetting
({
id
:
"
Comfy.ConfirmClear
"
,
name
:
"
Require confirmation when clearing workflow
"
,
type
:
"
boolean
"
,
defaultValue
:
true
,
});
function
dragMouseDown
(
e
)
{
e
=
e
||
window
.
event
;
e
.
preventDefault
();
...
...
@@ -170,7 +162,7 @@ class ComfyDialog {
$el
(
"
p
"
,
{
$
:
(
p
)
=>
(
this
.
textElement
=
p
)
}),
$el
(
"
button
"
,
{
type
:
"
button
"
,
textContent
:
"
C
LOSE
"
,
textContent
:
"
C
lose
"
,
onclick
:
()
=>
this
.
close
(),
}),
]),
...
...
@@ -233,6 +225,7 @@ class ComfySettingsDialog extends ComfyDialog {
};
let
element
;
value
=
this
.
getSettingValue
(
id
,
defaultValue
);
if
(
typeof
type
===
"
function
"
)
{
element
=
type
(
name
,
setter
,
value
,
attrs
);
...
...
@@ -289,6 +282,16 @@ class ComfySettingsDialog extends ComfyDialog {
return
element
;
},
});
const
self
=
this
;
return
{
get
value
()
{
return
self
.
getSettingValue
(
id
,
defaultValue
);
},
set
value
(
v
)
{
self
.
setSettingValue
(
id
,
v
);
},
};
}
show
()
{
...
...
@@ -410,6 +413,13 @@ export class ComfyUI {
this
.
history
.
update
();
});
const
confirmClear
=
this
.
settings
.
addSetting
({
id
:
"
Comfy.ConfirmClear
"
,
name
:
"
Require confirmation when clearing workflow
"
,
type
:
"
boolean
"
,
defaultValue
:
true
,
});
const
fileInput
=
$el
(
"
input
"
,
{
type
:
"
file
"
,
accept
:
"
.json,image/png
"
,
...
...
@@ -517,13 +527,13 @@ export class ComfyUI {
$el
(
"
button
"
,
{
textContent
:
"
Load
"
,
onclick
:
()
=>
fileInput
.
click
()
}),
$el
(
"
button
"
,
{
textContent
:
"
Refresh
"
,
onclick
:
()
=>
app
.
refreshComboInNodes
()
}),
$el
(
"
button
"
,
{
textContent
:
"
Clear
"
,
onclick
:
()
=>
{
if
(
localStorage
.
getItem
(
"
Comfy.Settings.Comfy.ConfirmClear
"
)
==
"
false
"
||
confirm
(
"
Clear workflow?
"
))
{
if
(
!
confirmClear
.
value
||
confirm
(
"
Clear workflow?
"
))
{
app
.
clean
();
app
.
graph
.
clear
();
}
}}),
$el
(
"
button
"
,
{
textContent
:
"
Load Default
"
,
onclick
:
()
=>
{
if
(
localStorage
.
getItem
(
"
Comfy.Settings.Comfy.ConfirmClear
"
)
==
"
false
"
||
confirm
(
"
Load default workflow?
"
))
{
if
(
!
confirmClear
.
value
||
confirm
(
"
Load default workflow?
"
))
{
app
.
loadGraphData
()
}
}}),
...
...
web/style.css
View file @
1a74611c
...
...
@@ -39,18 +39,19 @@ body {
position
:
fixed
;
/* Stay in place */
z-index
:
100
;
/* Sit on top */
padding
:
30px
30px
10px
30px
;
background-color
:
#ff0000
;
/* Modal background */
background-color
:
#353535
;
/* Modal background */
color
:
#ff4444
;
box-shadow
:
0px
0px
20px
#888888
;
border-radius
:
10px
;
text-align
:
center
;
top
:
50%
;
left
:
50%
;
max-width
:
80vw
;
max-height
:
80vh
;
transform
:
translate
(
-50%
,
-50%
);
overflow
:
hidden
;
min-width
:
60%
;
justify-content
:
center
;
font-family
:
monospace
;
font-size
:
15px
;
}
.comfy-modal-content
{
...
...
@@ -70,23 +71,6 @@ body {
margin
:
3px
3px
3px
4px
;
}
.comfy-modal
button
{
cursor
:
pointer
;
color
:
#aaaaaa
;
border
:
none
;
background-color
:
transparent
;
font-size
:
24px
;
font-weight
:
bold
;
width
:
100%
;
}
.comfy-modal
button
:hover
,
.comfy-modal
button
:focus
{
color
:
#000
;
text-decoration
:
none
;
cursor
:
pointer
;
}
.comfy-menu
{
width
:
200px
;
font-size
:
15px
;
...
...
@@ -109,7 +93,8 @@ body {
box-shadow
:
3px
3px
8px
rgba
(
0
,
0
,
0
,
0.4
);
}
.comfy-menu
button
{
.comfy-menu
button
,
.comfy-modal
button
{
font-size
:
20px
;
}
...
...
@@ -130,7 +115,8 @@ body {
.comfy-menu
>
button
,
.comfy-menu-btns
button
,
.comfy-menu
.comfy-list
button
{
.comfy-menu
.comfy-list
button
,
.comfy-modal
button
{
color
:
#ddd
;
background-color
:
#222
;
border-radius
:
8px
;
...
...
@@ -220,11 +206,22 @@ button.comfy-queue-btn {
}
.comfy-modal.comfy-settings
{
background-color
:
var
(
--bg-color
);
color
:
var
(
--fg-color
);
text-align
:
center
;
font-family
:
sans-serif
;
color
:
#999
;
z-index
:
99
;
}
.comfy-modal
input
,
.comfy-modal
select
{
color
:
#ddd
;
background-color
:
#222
;
border-radius
:
8px
;
border-color
:
#4e4e4e
;
border-style
:
solid
;
font-size
:
inherit
;
}
@media
only
screen
and
(
max-height
:
850px
)
{
.comfy-menu
{
top
:
0
!important
;
...
...
@@ -239,26 +236,26 @@ button.comfy-queue-btn {
}
.graphdialog
{
min-height
:
1em
;
min-height
:
1em
;
}
.graphdialog
.name
{
font-size
:
14px
;
font-family
:
sans-serif
;
color
:
#999999
;
font-size
:
14px
;
font-family
:
sans-serif
;
color
:
#999999
;
}
.graphdialog
button
{
margin-top
:
unset
;
vertical-align
:
unset
;
height
:
1.6em
;
padding-right
:
8px
;
margin-top
:
unset
;
vertical-align
:
unset
;
height
:
1.6em
;
padding-right
:
8px
;
}
.graphdialog
input
,
.graphdialog
textarea
,
.graphdialog
select
{
background-color
:
#222
;
border
:
2px
solid
;
border-color
:
#444444
;
color
:
#ddd
;
border-radius
:
12px
0
0
12px
;
background-color
:
#222
;
border
:
2px
solid
;
border-color
:
#444444
;
color
:
#ddd
;
border-radius
:
12px
0
0
12px
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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