Author Topic: New Core Icons in PixInsight 1.8.0.1071 Ripley  (Read 5336 times)

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6644
    • View Profile
    • http://pixinsight.com/
New Core Icons in PixInsight 1.8.0.1071 Ripley
« on: 2013 April 02 04:44:18 »
[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:

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:

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)
« Last Edit: 2015 November 30 07:56:26 by Juan Conejero »
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Andres.Pozo

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 888
    • View Profile
Re: New Core Icons in PixInsight 1.8
« Reply #1 on: 2013 April 07 02:56:47 »
The script has an error. The line 1262 that currently is:
Code: [Select]
   this.browser.text = generate( 4 );

should be

Code: [Select]
   this.browser.text = this.generateHTML( 4 );

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6644
    • View Profile
    • http://pixinsight.com/
Re: New Core Icons in PixInsight 1.8
« Reply #2 on: 2013 April 07 04:04:35 »
Thanks Andrés. I have updated the original post with the fixed script.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6644
    • View Profile
    • http://pixinsight.com/
Re: New Core Icons in PixInsight 1.8.0.1071 Ripley
« Reply #3 on: 2013 December 16 04:04:43 »
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.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6644
    • View Profile
    • http://pixinsight.com/
Re: New Core Icons in PixInsight 1.8.4.1194 Ripley
« Reply #4 on: 2015 November 30 07:54:38 »
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.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/

Offline mschuster

  • PTeam Member
  • PixInsight Jedi
  • *****
  • Posts: 1010
    • View Profile
Re: New Core Icons in PixInsight 1.8.0.1071 Ripley
« Reply #5 on: 2015 November 30 16:08:33 »
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: [Select]
*** 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

Offline Juan Conejero

  • PTeam Member
  • PixInsight Jedi Grand Master
  • ********
  • Posts: 6644
    • View Profile
    • http://pixinsight.com/
Re: New Core Icons in PixInsight 1.8.0.1071 Ripley
« Reply #6 on: 2015 December 01 07:36:34 »
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.
Juan Conejero
PixInsight Development Team
http://pixinsight.com/