Skip to content

Commit

Permalink
gui2/logging: Improve dialog's aesthetics
Browse files Browse the repository at this point in the history
This makes it look less like programmer art by adding some headings and
a better list layout.
  • Loading branch information
irydacea committed Jul 7, 2020
1 parent e2c5b92 commit d186a8b
Showing 1 changed file with 85 additions and 14 deletions.
99 changes: 85 additions & 14 deletions data/gui/window/logging.cfg
Expand Up @@ -16,20 +16,60 @@
#define _NONE
"none"#enddef

#define _GUI_LOGGER_RADIOS GROUP TOOLTIP
#define _DEBUG_TOOLTIP
_ "Debug level logging: maximum information"#enddef
#define _INFO_TOOLTIP
_ "Info level logging: more information"#enddef
#define _WARN_TOOLTIP
_ "Warning level logging: less information"#enddef
#define _ERR_TOOLTIP
_ "Error level logging: minimum information"#enddef
#define _NONE_TOOLTIP
_ "Disable logging"#enddef

#define _GUI_LOGGER_RADIOS GROUP_MACRO_NAME
[column]
grow_factor = 0
grow_factor = 1
horizontal_alignment = "center"

border = "all"
border_size = 5

[toggle_button]
id = {GROUP}
definition = "radio"
linked_group = {GROUP}
tooltip = {TOOLTIP}
[/toggle_button]
# HACK: Inner grid to allow the radio button to get aligned to the
# center of the cell without growing horizontally (which results
# in the circle portion ending up left-aligned)
[grid]
linked_group = {{GROUP_MACRO_NAME}}
[row]
[column]
grow_factor = 0
horizontal_alignment = "center"
[toggle_button]
id = {{GROUP_MACRO_NAME}}
definition = "radio_no_label"
tooltip = {{GROUP_MACRO_NAME}_TOOLTIP}
[/toggle_button]
[/column]
[/row]
[/grid]
[/column]
#enddef

#define _GUI_LOGGER_HEADERS GROUP_MACRO_NAME MINI_LABEL
[column]
grow_factor = 1
horizontal_grow = true

border = "top,bottom"
border_size = 5

[label]
definition = "gold_small"
text_alignment = "center"
linked_group = {{GROUP_MACRO_NAME}}
label = {MINI_LABEL}
tooltip = {{GROUP_MACRO_NAME}_TOOLTIP}
[/label]
[/column]
#enddef

Expand All @@ -44,6 +84,8 @@
vertical_placement = "center"
horizontal_placement = "center"

{GUI_WINDOW_FIXED_SIZE_CENTERED 800 600}

[linked_group]
id = {_NAME}
fixed_width = true
Expand Down Expand Up @@ -109,6 +151,27 @@
definition = "default"
horizontal_scrollbar_mode = "never"

[header]
[row]
[column]
grow_factor = 1
horizontal_grow = true

[label]
definition = "gold_small"
linked_group = {_NAME}
label = _ "Log Domain"
[/label]
[/column]

{_GUI_LOGGER_HEADERS _DEBUG _"log_level^Debug"}
{_GUI_LOGGER_HEADERS _INFO _"log_level^Info"}
{_GUI_LOGGER_HEADERS _WARN _"log_level^Warning"}
{_GUI_LOGGER_HEADERS _ERR _"log_level^Error"}
{_GUI_LOGGER_HEADERS _NONE _"log_level^None"}
[/row]
[/header]

[list_definition]
[row]
[column]
Expand All @@ -120,7 +183,7 @@
[row]
[column]
grow_factor = 1
horizontal_alignment = "right"
horizontal_alignment = "left"

border = "all"
border_size = 5
Expand All @@ -133,11 +196,11 @@

[/column]

{_GUI_LOGGER_RADIOS {_DEBUG} ( _ "Debug level logging: maximum information")}
{_GUI_LOGGER_RADIOS {_INFO} ( _ "Info level logging: more information")}
{_GUI_LOGGER_RADIOS {_WARN} ( _ "Warning level logging: less information")}
{_GUI_LOGGER_RADIOS {_ERR} ( _ "Error level logging: minimum information")}
{_GUI_LOGGER_RADIOS {_NONE} ( _ "Disable logging")}
{_GUI_LOGGER_RADIOS _DEBUG}
{_GUI_LOGGER_RADIOS _INFO}
{_GUI_LOGGER_RADIOS _WARN}
{_GUI_LOGGER_RADIOS _ERR}
{_GUI_LOGGER_RADIOS _NONE}

[/row]
[/grid]
Expand Down Expand Up @@ -186,10 +249,18 @@
[/resolution]

[/window]

#undef _GUI_LOGGER_RADIOS
#undef _GUI_LOGGER_HEADERS

#undef _NAME
#undef _DEBUG
#undef _DEBUG_TOOLTIP
#undef _INFO
#undef _INFO_TOOLTIP
#undef _WARN
#undef _WARN_TOOLTIP
#undef _ERR
#undef _ERR_TOOLTIP
#undef _NONE
#undef _NONE_TOOLTIP

0 comments on commit d186a8b

Please sign in to comment.