Resizing icons in toolbar? #784
Replies: 7 comments 3 replies
-
|
Good idea. |
Beta Was this translation helpful? Give feedback.
-
|
It's like a treasure hunt :-) All UI actions are defined by the file <actions>
<action domain="FILE" section="10" class="org.audiveris.omr.sheet.ui.BookActions" menu="inputHistory" button="javax.swing.JButton"/>
<action domain="FILE" section="10" class="org.audiveris.omr.sheet.ui.BookActions" method="openImageFiles" button="javax.swing.JButton"/>
<action domain="FILE" section="70" class="org.audiveris.omr.ui.GuiActions" method="exit"/>FYI, this mechanism is implemented by the class For instance, the second line defines the action "openImageFiles", implemented in the Java class //----------------//
// openImageFiles //
//----------------//
/**
* Action that let the user select one or several image files interactively.
*
* @param e the event that triggered this action
* @return the asynchronous task, or null
*/
@Action
public LoadFilesTask openImageFiles (ActionEvent e)
{
final Path[] paths = selectImagePaths();
if (paths.length > 0) {
return new LoadFilesTask(Arrays.asList(paths));
}
return null;
}This Here is an excerpt of this file: openImageFiles.Action.text = &Input...
openImageFiles.Action.shortDescription = Open image files
openImageFiles.Action.icon = ${icons.root}/filesystems/folder_images.png
openImageFiles.Action.accelerator = control OAs we can see, the action details are described here, including the icon reference. # Reference to selected Crystal icons
icons.root = /crystal/22x22During the build process (driven by the file Now where do these icons come from? We could easily choose a icon size larger than the current 22x22. Now, this would be a static modification, the same for all users. And I suppose you would like the ability for any end user to choose the font size. I will leave this question open for now. |
Beta Was this translation helpful? Give feedback.
-
|
In case you wonder, all this machinery is the Swing Application Framework, described in https://www.oracle.com/technical-resources/articles/javase/swingappfr.html. |
Beta Was this translation helpful? Give feedback.
-
|
I just discovered by reading the source code of the ApplicationAction class in BSAF that we can define several icons for a given action. For instance, instead of: openImageFiles.Action.icon = ${icons.root}/filesystems/folder_images.pngwe could have: openImageFiles.Action.smallIcon = path/to/small/image.png
openImageFiles.Action.largeIcon = path/to/large/image.pngBy default, the larger icon is used for the buttons on the task bar and the smaller for the menu items. Would this fit your needs? |
Beta Was this translation helpful? Give feedback.
-
|
I will soon push a commit on development branch that addresses the small/large icons |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Done. See commit 4e85131 on the development branch. The changes are driven by the user changing the font size (in the Preferences dialog). Of course, you need to restart the application. Second point: "In theory", a change in system settings (or perhaps screen size) should be transparently processed, since all sizing values in the Preferences dialog are stated in "DLU", not in physical pixels. |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I was just wondering if there are any settings to resize the icons in the toolbar? It appears there are for e.g. font sizes, etc. but not for the icons?
Many thanks,
Adam
Beta Was this translation helpful? Give feedback.
All reactions