Skip to main content
dublove
Legend
Nov 9, 2026 2:24 PM UTC
Answered

How to set the background color or colored icon for the title bar at the top of the dialog box?

This is not that beautiful, it doesn't seem like what I want.
I hope the title bar above is colored.

 

var win = new Window("dialog", undefined, undefined, { resize: false });
win.orientation = "column";
win.alignChildren = "fill";

// Self drawn color title bar
var titleBar = win.add("panel", undefined, "TITLE");
titleBar.align = "fill";
// RGB 0~1
titleBar.graphics.backgroundColor = titleBar.graphics.newBrush(titleBar.graphics.BrushType.SOLID_COLOR, [0.2, 0.4, 0.8]);

// White text
titleBar.graphics.foregroundColor = titleBar.graphics.newPen(titleBar.graphics.PenType.SOLID_COLOR, [1, 1, 1], 1);
// Content area
var content = win.add("group");
content.add("statictext", undefined, "Here is the content");

// button
var btnGroup = win.add("group");
btnGroup.alignment = "center";
btnGroup.add("button", undefined, "OK");
btnGroup.add("button", undefined, "Cancel");

win.show();

 

    rob day
    rob dayCorrect answer
    Community Expert
    Nov 9, 2026 4:05 PM UTC

    You might look at this dialog builder helper app:

     

    https://scriptui.joonas.me/

    4 replies

    rob day
    Community Expert
    rob dayCommunity ExpertCorrect answer
    Community Expert
    Nov 9, 2026 4:05 PM UTC

    You might look at this dialog builder helper app:

     

    https://scriptui.joonas.me/

    Translate
    dublove
    dubloveAuthor
    Legend
    Nov 9, 2026 4:15 PM UTC

    Hi rob day.

    Thank you very much.
    pleasantly surprised.
    Surprisingly, there are still such excellent resources.

    Translate
    rob day
    Community Expert
    Community Expert
    Nov 9, 2026 3:27 PM UTC

    I don’t think you can change the title bar color—you can hide it:

     

    var win = new Window("dialog", undefined, undefined, { resize: false, borderless: true });

     

    The ScriptUI API is large and complex, so there might be a way—the indesignjs.de API for ScriptUI is a separate page:

     

    https://www.indesignjs.de/indesignapi/scriptui/Window.html

     

     

    Translate
    dublove
    dubloveAuthor
    Legend
    Nov 9, 2026 3:49 PM UTC

    Too complicated, I gave up.
    In the example I posted above, after changing 'dialogue' to 'palette', the background color of the title disappeared.
    Boring. Give up.

    Translate