Thanks for the replies,
yes latest code is not yet available on the Georgia-ReBORN repo ( last commit was on Aug 28, 2022 )
but here "LATEST WORK IN PROGRESS VERSION: Georgia-ReBORN v2.3.0 Beta 11b":
https://github.com/TT-ReBORN/Georgia-ReBORN/discussions/74#discussion-4190799
So I have quite modified your Material code to my needs, full code is in gr-menu-custom.js
Basically class BaseControl constructor only has one declared font "this.font = ft.popup" that has been created via gdi.Font ( font helper in gr-setup.js ) on theme init startup:
class BaseControl {
constructor(x, y, label) {
/** @protected */ this.x = x;
/** @protected */ this.y = y;
/** @protected */ this.label = label;
this.state = {};
this.doubleClickTime = 300;
this.lastClickTime = null;
this.focus = false;
this.disabled = false;
this._hovered = false;
this.font = ft.popup;
this.popupFontSize = pref.layout === 'artwork' ? pref.popupFontSize_artwork : pref.popupFontSize_default;
this.closeBtn = this.label === '\u2715';
/** @protected @private */ this.i = gdi.CreateImage(1, 1);
/** @protected */ this.g = this.i.GetGraphics(); // GdiBitmap used for MeasureString and other functions
}
then all other child classes ( DropDownMenu, StringInput, ColorPicker and Info ) are using this.font.
When the custom theme menu will be opened by the user via top menu Options > Theme > Custom > Edit custom theme, or
when a custom theme slot was selected from top menu Options > Theme > Custom, via the quick navigation right click context menu > Edit custom theme :
function initCustomThemeMenu(playlist_section, main_section, library_section, biography_section, info) {
if (pref.libraryLayout === 'full') pref.libraryLayout = 'normal'; setLibrarySize();
if (pref.biographyLayout === 'full') pref.biographyLayout = 'normal'; setBiographySize();
if (pref.lyricsLayout === 'full') pref.lyricsLayout = 'normal'; resizeArtwork(true);
controlList = [];
const margin = scaleForDisplay(40);
const baseX = displayBiography || pref.displayLyrics ? ww * 0.5 + margin : !displayPlaylist && !displayLibrary && !displayBiography ? noAlbumArtStub ? ww * 0.3 : albumArtSize.x + margin : margin;
let x = baseX;
let y = geo.topMenuHeight + margin * 0.75;
const mainSection = ['main_bg', 'main_bar', 'main_text', 'main_btns', 'main_btns2', 'main_style'].includes(main_section);
const playlistSection = ['pl_bg', 'pl_text1', 'pl_text2', 'pl_misc', 'pl_btns'].includes(playlist_section);
const librarySection = ['lib_bg', 'lib_text', 'lib_node', 'lib_btns'].includes(library_section);
const biographySection = ['bio_bg', 'bio_text', 'bio_misc', 'bio_btns'].includes(biography_section);
const menu = new DropDownMenu(x, y, 'Main', ['Bg', 'Bar', 'Text', 'Btns', 'Btns 2', 'Style'], 0);
controlList.push(menu);
x += controlList[controlList.length - 1].w + 1; controlList.push(new DropDownMenu(x, y, 'Playlist', ['Bg', 'Text', 'Text 2', 'Misc', 'Btns'], 0));
x += controlList[controlList.length - 1].w + 1; controlList.push(new DropDownMenu(x, y, 'Library', ['Bg', 'Text', 'Node', 'Btns'], 0));
x += controlList[controlList.length - 1].w + 1; controlList.push(new DropDownMenu(x, y, 'Biography', ['Bg', 'Text', 'Misc', 'Btns'], 0));
x += controlList[controlList.length - 1].w + 1; controlList.push(new DropDownMenu(x, y, 'Options', ['Info', '', 'Theme 01', 'Theme 02', 'Theme 03', 'Theme 04', 'Theme 05', 'Theme 06', 'Theme 07', 'Theme 08', 'Theme 09', 'Theme 10', '', 'Reset'], 0));
x += controlList[controlList.length - 1].w + 1; controlList.push(new DropDownMenu(x, y, '\u2715', ['']));
x = baseX;
y += menu.h + margin * 0.75;
switch (true) {
case playlistSection: customPlaylistColors(x, y, ww * 0.5, wh - geo.topMenuHeight - geo.lowerBarHeight, playlist_section); break;
case mainSection: customMainColors(x, y, ww * 0.5, wh - geo.topMenuHeight - geo.lowerBarHeight, main_section); break;
case librarySection: customLibraryColors(x, y, ww * 0.5, wh - geo.topMenuHeight - geo.lowerBarHeight, library_section); break;
case biographySection: customBiographyColors(x, y, ww * 0.5, wh - geo.topMenuHeight - geo.lowerBarHeight, biography_section); break;
case info: customThemeInfo(x, y, ww * 0.5, wh - geo.topMenuHeight - geo.lowerBarHeight); break;
}
}
Thanks for the tips @regor, I'll see what I can do with it.
-TT