From 2e5e85d9d8badbd2e2b621cbd0cf33f73175e6e7 Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Fri, 14 Dec 2018 00:19:46 +0100 Subject: [PATCH] Styled action table, fixed callback function not returning proper action index --- js/lib/libghettoui/settings/ActionItem.js | 40 +++++++----- res/settings/css/settings.css | 74 ++++++++++++++++++++++- res/settings/js/customization.js | 4 +- 3 files changed, 99 insertions(+), 19 deletions(-) diff --git a/js/lib/libghettoui/settings/ActionItem.js b/js/lib/libghettoui/settings/ActionItem.js index ed356f3..7414652 100644 --- a/js/lib/libghettoui/settings/ActionItem.js +++ b/js/lib/libghettoui/settings/ActionItem.js @@ -11,24 +11,34 @@ class ActionItem extends BaseElement { this.element.innerHTML = ` ${cmd} ${action.label ? action.label : ""} - ${action.parsedShortcut ? action.parsedShortcut : ""} - - + ${action.parsedShortcut ? action.parsedShortcut : ""} + +
+ +
- - + +
+ +
- - + +
+ +
+ + +
+ +
- - - - - + +
+ +
${action.ui_path ? action.ui_path : ""} `; diff --git a/res/settings/css/settings.css b/res/settings/css/settings.css index 9da1b1b..8e37a47 100644 --- a/res/settings/css/settings.css +++ b/res/settings/css/settings.css @@ -6,7 +6,7 @@ body { background-size: 75px; background-color: #000000; color: #ddd; - font-family: 'overpass', serif; + font-family: 'Overpass', sans-serif; font-size: 1.2em; width: 100%; border: 0px; @@ -163,6 +163,14 @@ input[type=text]{ height: 1.7em; } +.monospace { + font-family: 'Overpass Mono', monospace +} + +.center-text { + text-align: center; +} + /** site options css **/ .site_name { padding-left: 1em; @@ -199,4 +207,66 @@ input[type=text]{ } .inline_button:hover { color: #fff; -} \ No newline at end of file +} + +.checkbox-center { + text-align: center; +} + + +.checkbox-container { + display: inline-block; + position: relative; + padding-left: 35px; + margin-bottom: 12px; + /* cursor: pointer; */ + font-size: 22px; + /* -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; */ +} + +.checkbox { + position: absolute; + top: 0; + left: 0; + height: 25px; + width: 25px; +} + +.checkbox-checked { + position: absolute; + left: 9px; + top: 5px; + width: 5px; + height: 10px; + border: solid rgb(245, 145, 63); + border-width: 0 3px 3px 0; + transform: rotate(45deg); +} + +/* ACTION TABLE STYLES */ + +.action-item-category-label { + color: rgb(245, 145, 63); + font-size: 2em; + font-weight: 200; + margin-bottom: 0px; + padding-bottom: 0px; + padding-top: 1em; +} + +.action-item-table-header { + color: rgb(245, 145, 63); +} + +.action-item-table-header-small { + color: rgb(245, 145, 63); + font-size: 0.85em !important; + font-weight: 300 !important; +} + +.action-list-item:hover { + background-color: rgba(254, 146, 63, 0.15); +} diff --git a/res/settings/js/customization.js b/res/settings/js/customization.js index de2036b..349a88b 100644 --- a/res/settings/js/customization.js +++ b/res/settings/js/customization.js @@ -60,11 +60,11 @@ function loadSectionHeader(title) { } function loadActionSection(actions, container) { - for(action of actions) { + for(const action of actions) { if (action.shortcut && action.shortcut[0].key) { action.parsedShortcut = KeyboardShortcutParser.parseShortcut(action.shortcut[0]) } - var actionIndex = settings.active.actions.indexOf(action); + const actionIndex = settings.active.actions.indexOf(action); var newAction = new ActionItem( undefined, action,