New Core Icons in PixInsight 1.8.0.1071 Ripley

Juan Conejero

PixInsight Staff
Staff member
[December 15th 2013: Updated for version 1.8.0.1071 Ripley]

Hi all,

As you surely know, the new PixInsight Core 1.8 application comes with a completely redesigned set of icons, which you can use in your scripts and modules, as usual, using Qt resource paths. For example, in JavaScript:

Code:
var btn = new ToolButton( this );
btn.icon = ":/icons/mail.png";

Note that you no longer need to instantiate Bitmap to set the icon property of a control. In previous versions of PixInsight, the above code should be written as follows:

Code:
var btn = new ToolButton( this );
btn.icon = new Bitmap( ":/icons/mail.png" );

Now you can simply assign a string to the icon property. This works with core resources as well as external resources (disk files).

The old core icons, namely all icon paths starting with ":/images/", still work because I have included a compatibility resource module in all PixInsight distributions. However, I urge all PixInsight developers to update their scripts and modules to use the new core icons. This is important to achieve a coherent look and feel on all platforms.

Attached to this post you'll find a little utility script that allows you to browse all available core icons conveniently on a dialog. Please let me know if you find any errors, and don't hesitate to ask for more icons, if you find that the existing set does not fulfill your needs.

(EDIT: Please see the last post in this thread)
 
The script has an error. The line 1262 that currently is:
Code:
   this.browser.text = generate( 4 );

should be

Code:
   this.browser.text = this.generateHTML( 4 );
 
Hi all,

I have updated the script attached to the first post in this thread. It is now current for PixInsight Core 1.8.0.1071 Ripley, which we have released today.
 
Update for core version >= 1.8.4.1194: A new CoreIconsBrowser script is now part of the official PixInsight distribution. It provides access to an up-to-date set of icon resources in the latest version of PixInsight.

The new CoreIconsBrowser script is now available on the official PJSR GitHub repository:

https://github.com/PixInsight/PJSR/tree/master/src/scripts/CoreIconsBrowser

To prevent confusions, the file attached to the first post in this thread has been removed.
 
Hi Juan,

The new CoreIconsBrowser fails on iMac 1193. Deleting the line solves the problem.

With this change the script runs, but maybe 20 to 30+ of the icons are missing (i.e label text is present but no icon).

Thanks,
Mike

Code:
*** Error [000]: /Users/Home/Documents/Astronomy/PixInsight/GitHub/PJSR/src/scripts/CoreIconsBrowser/CoreIconsBrowser.js, line 1645: Error: Bitmap.Bitmap(): bitmap file load error: :/icons/2.0/clear-old.png
 
Hi Mike,

There were two wrong icon names in the list, thanks for discovering them. There were other screen scaling issues as well, which I have fixed, and a problem with the default white background used by TextBox, which renders some icons invisible or very hard to see. I have just uploaded a new version to GitHub with these bugs fixed and additional controls to change the dialog's background color.
 
Back
Top