Skip to content

Commit 3614028

Browse files
committed
some styling
1 parent 5652000 commit 3614028

File tree

2 files changed

+18
-9
lines changed

2 files changed

+18
-9
lines changed

controls.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def Text(id, default):
2222
dbc Input component with text inputs.
2323
"""
2424
return [ dbc.Input(id=id, type="text",
25-
size="sm", className="m-1 d-inline-block w-auto",debounce=True, value=default) ]
25+
size="sm", className="m-1 d-inline-block w-auto", debounce=True, value=default) ]
2626

2727

2828
def Number(id, default, min=None, max=None, html_size=None):
@@ -158,7 +158,7 @@ def Sentence(*elems):
158158

159159
return dbc.Form(groups)
160160

161-
def Block(title, *body, is_on=True, width="100%"): #width of the block in its container
161+
def Block(title, *body, is_on=True, width="100%", border_color="grey"): #width of the block in its container
162162
"""Separates out components in individual Cards
163163
164164
Auto-generates a formatted block with a card header and body.
@@ -185,10 +185,14 @@ def Block(title, *body, is_on=True, width="100%"): #width of the block in its co
185185
the_display = "inline-block"
186186
else:
187187
the_display = "none"
188-
return dbc.Card([
189-
dbc.CardHeader(title),
190-
dbc.CardBody(body),
191-
], className="mb-4 ml-4 mr-4", style={"display": the_display, "width": width})
188+
return dbc.Card(
189+
[
190+
dbc.CardHeader(title),
191+
dbc.CardBody(body),
192+
],
193+
className="mb-4 ml-4 mr-4",
194+
style={"display": the_display, "width": width, "border-color": border_color, "line-height": 1},
195+
)
192196

193197
def Options(options,labels=None):
194198
""" Creates options for definition of different Dash components.

enacts/wat_bal/layout_monit.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def controls_layout(
280280
min=lat_min,
281281
max=lat_max,
282282
type="number",
283+
style={"height": "auto", "padding-bottom": "0px"},
283284
),
284285
dbc.Label("Latitude", style={"font-size": "80%"}),
285286
dbc.Tooltip(
@@ -296,6 +297,7 @@ def controls_layout(
296297
min=lon_min,
297298
max=lon_max,
298299
type="number",
300+
style={"height": "auto", "padding-bottom": "0px"},
299301
),
300302
dbc.Label("Longitude", style={"font-size": "80%"}),
301303
dbc.Tooltip(
@@ -305,7 +307,7 @@ def controls_layout(
305307
)
306308
]),
307309
),
308-
dbc.Button(id="submit_lat_lng", children='Submit'),
310+
dbc.Button(id="submit_lat_lng", children='Submit', color="secondary"),
309311
],
310312
),
311313
),
@@ -317,6 +319,7 @@ def controls_layout(
317319
{"label": val["menu_label"], "value": key}
318320
for key, val in CONFIG["map_text"].items()
319321
],
322+
style={"padding-top": "0px", "padding-bottom": "0px"},
320323
),
321324
),
322325
Block(
@@ -355,7 +358,8 @@ def controls_layout(
355358
Sentence(
356359
Number("kc_end", CONFIG["kc_v"][4], min=0, max=2, html_size=4),
357360
),
358-
dbc.Button(id="submit_kc", children='Submit'),
361+
dbc.Button(id="submit_kc", children='Submit', color="success"),
362+
border_color="green",
359363
),
360364
Block(
361365
"Compare to...",
@@ -403,7 +407,8 @@ def controls_layout(
403407
Sentence(
404408
Number("kc2_end", CONFIG["kc_v"][4], min=0, max=2, html_size=4),
405409
),
406-
dbc.Button(id="submit_kc2", children='Submit'),
410+
dbc.Button(id="submit_kc2", children='Submit', color="primary"),
411+
border_color="blue",
407412
),
408413
],
409414
style={"position":"relative","height":"60%", "overflow":"scroll"},

0 commit comments

Comments
 (0)