From a3ba9b025294756414ae0a6d7f0030b775669e7f Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Tue, 6 Oct 2015 21:21:13 -0600 Subject: [PATCH] * More work on theming --- core/menu_util.js | 14 ++- mods/menu.hjson | 109 +++++++------------ mods/themes/luciano_blocktronics/theme.hjson | 44 +++++++- 3 files changed, 92 insertions(+), 75 deletions(-) diff --git a/core/menu_util.js b/core/menu_util.js index 46a3c814..239922d2 100644 --- a/core/menu_util.js +++ b/core/menu_util.js @@ -296,15 +296,23 @@ function applyThemeCustomization(options) { } if(themeConfig.mci) { - console.log('>>>>>>>>>>>>>>>>>>>>>>> ' + options.name) Object.keys(themeConfig.mci).forEach(function mciEntry(mci) { - _.defaults(options.mci[mci], themeConfig.mci[mci]); + // :TODO: a better way to do this? + if(options.mci[mci]) { + _.defaults(options.mci[mci], themeConfig.mci[mci]); + } else { + options.mci[mci] = themeConfig.mci[mci]; + } }); } if(themeConfig.config) { Object.keys(themeConfig.config).forEach(function confEntry(conf) { - _.defaultsDeep(options.config[conf], themeConfig.config[conf]); + if(options.config[conf]) { + _.defaultsDeep(options.config[conf], themeConfig.config[conf]); + } else { + options.config[conf] = themeConfig.config[conf]; + } }); } } diff --git a/mods/menu.hjson b/mods/menu.hjson index b6377cd0..7f5bfedf 100644 --- a/mods/menu.hjson +++ b/mods/menu.hjson @@ -582,38 +582,22 @@ editorMode: view editorType: area }, - "form" : { - "0" : { - "mci" : { - "TL1" : { - // "width" : 27 - }, - "TL2" : { - // "width" : 27 - }, - "TL3" : { - //"width" : 27, - //"textOverflow" : "..." - }, - "TL5" : { - // "width" : 27 - }, - "MA5" : { - "width" : 27, - "textOverflow" : "..." + form: { + 0: { + mci: { + // :TODO: ensure this block isn't even req. for theme to apply... + } + } + 1: { + mci: { + MT1: { + width: 79 + //"height" : 14, + mode: preview } } - }, - "1" : { - "mci" : { - "MT1" : { - "width" : 79, - "height" : 14, - "mode" : "preview" - } - }, - "submit" : { - "*" : [ + submit: { + *: [ { "value" : "message", "action" : "@method:editModeEscPressed" @@ -645,15 +629,15 @@ // :TODO: (#)Jump/(L)Index (msg list)/Last items: [ // (P)revious - Prev + prev // (N)ext - Next + next // (R)reply - Reply + reply // (Q)uit (ESC) - Quit + quit // (?)Help - Help + help ] } }, @@ -795,7 +779,7 @@ HM: { mci: { HM1: { - items: [ "Save", "Discard", "Quote", "Help" ] + items: [ "save", "discard", "quote", "help" ] } } @@ -895,30 +879,23 @@ editorMode: edit editorType: area }, - "form" : { - "0" : { + form: { + 0: { mci: { TL1: { - //width: 27 - argName: from + argName: from } ET2: { - //width: 27 - argName: to - focus: true + argName: to + focus: true text: All } - "ET3" : { - //"width" : 27, - "argName" : "subject", - "maxLength" : 72, - "submit" : true - }, - "MA5" : { - //"width" : 27, - //"textOverflow" : "..." + ET3: { + argName: subject + maxLength: 72 + submit: true } - }, + } "submit" : { "3" : [ { @@ -927,21 +904,21 @@ } ] } - }, - "1" : { + } + + 1: { "mci" : { MT1: { - width: 79 - height: 14 - argName: message - mode: edit + width: 79 + argName: message + mode: edit } } submit: { *: [ { "value": "message", "action": "@method:editModeEscPressed" } ] }, - "actionKeys" : [ + actionKeys: [ { "keys" : [ "escape" ], "viewId" : 1 @@ -964,8 +941,8 @@ "HM" : { "mci" : { "HM1" : { - // :TODO: Continue, Save, Discard, Clear, Quote, Help - "items" : [ "Save", "Discard", "Quote", "Help" ] + // :TODO: clear + "items" : [ "save", "discard", "help" ] } }, "submit" : { @@ -977,13 +954,9 @@ { "value" : { "1" : 1 }, "action" : "@menu:messageArea" - }, + } { - value: { 1: 2 }, - action: @method:editModeQuote - }, - { - "value" : { "1" : 3 }, + "value" : { "1" : 2 }, "action" : "@method:editModeMenuHelp" } ] diff --git a/mods/themes/luciano_blocktronics/theme.hjson b/mods/themes/luciano_blocktronics/theme.hjson index caa6101e..47f20d05 100644 --- a/mods/themes/luciano_blocktronics/theme.hjson +++ b/mods/themes/luciano_blocktronics/theme.hjson @@ -72,10 +72,34 @@ messageAreaViewPost: { 0: { mci: { - TL1: { width: 19, textOverflow: "..." } - TL2: { width: 19, textOverflow: "..." } - TL3: { width: 19, textOverflow: "..." } - TL5: { width: 19, textOverflow: "..." } + TL1: { + width: 19 + textOverflow: ... + } + TL2: { + width: 19 + textOverflow: ... + } + TL3: { + width: 19 + textOverflow: ... + } + TL5: { + width: 19 + textOverflow: ... + } + } + } + 1: { + mci: { + MT1: { height: 14 } + } + } + 4: { + mci: { + HM1: { + focusTextStyle: first upper + } } } } @@ -89,6 +113,11 @@ //TL4: { width: 25 } } } + 1: { + mci: { + MT1: { height: 14 } + } + } } messageAreaReplyPost: { @@ -100,6 +129,13 @@ TL4: { width: 25, textOverflow: "..." } } } + 1: { + mci: { + HM1: { + focusTextStyle: first lower + } + } + } } } }