Jscript Panel 3 konfigurieren

Begonnen von mexx, 09. Januar 2023, 16:40:18

Vorheriges Thema - Nächstes Thema

mexx

Ich habe mir in meine CUI Konfiguration (v2 Beta21 32bit) ein Jscript Panel3 eingebaut und lasse mir damit meine Artist-Infos aus txt-Dateien anzeigen (s.Anhang).

Nun möchte ich gerne die Farbe der Band (Überschrift) ändern. Geht das im Script und wenn ja, wie?

Vielleicht kann mir jemand helfen.

Anbei das Script:

// ==PREPROCESSOR==
// @name "Text Reader"
// @author "marc2003"
// @import "%fb2k_component_path%helpers.txt"
// @import "%fb2k_component_path%samples\js\lodash.min.js"
// @import "%fb2k_component_path%samples\js\common.js"
// @import "%fb2k_component_path%samples\js\panel.js"
// @import "%fb2k_component_path%samples\js\text.js"
// ==/PREPROCESSOR==

// https://marc2k3.github.io/jscript-panel/gallery/text-reader/

var panel = new _panel()

panel.draw_header = function (gr, text) {
    gr.WriteText(text, this.fonts.title, this.colours.highlight, LM, 0, this.w - (LM * 2), TM, DWRITE_TEXT_ALIGNMENT_CENTER, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER);
    gr.DrawLine(LM, TM + 0.5, this.w - LM, TM + 0.5, 1, this.colours.highlight);
   
}

var text = new _text('text_reader2', LM, TM, 0, 0);

panel.item_focus_change();

function on_colours_changed() {
    panel.colours_changed();
    window.Repaint();
}

function on_font_changed() {
    panel.font_changed();
    window.Repaint();
}

function on_item_focus_change() {
    panel.item_focus_change();
}

function on_key_down(k) {
    text.key_down(k);
}

function on_metadb_changed() {
    text.metadb_changed();
}

function on_mouse_lbtn_up(x, y) {
    text.lbtn_up(x, y);
}

function on_mouse_move(x, y) {
    text.move(x, y);
}

function on_mouse_rbtn_up(x, y) {
    return panel.rbtn_up(x, y, text);
}

function on_mouse_wheel(s) {
    text.wheel(s);
}

function on_paint(gr) {
    panel.paint(gr);
    panel.draw_header(gr, text.header_text());
    text.paint(gr);
}

function on_playback_dynamic_info_track() {
    panel.item_focus_change();
}

function on_playback_new_track() {
    panel.item_focus_change();
}

function on_playback_stop(reason) {
    if (reason != 2) {
        panel.item_focus_change();
    }
}

function on_playlist_switch() {
    panel.item_focus_change();
}

function on_size() {
    panel.size();
    text.w = panel.w - (LM * 2);
    text.h = panel.h - TM;
    text.size();
}



grimes

Ersetze this.colours.highlight mit RGB(255, 255, 0).

mexx