Icon for debugger in the toolbar #16661
Open
+39
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the past, we were use to have the icon of the window in the toolbar.
Issue summary
For instance, in Pharo 10, we had the icon for the debugger (see screenshot)
But, in Pharo12. we lose this icon (see second screenshot)
This PR aims to add it back as presented in the last screenshot
Fix detail
To fix the issue. I first discovered that
TaskbarItemMorph
is created from aTaskbarTask
, but the model ofTaskbarItemMorph
is the actual window morph and not theTaskbarTask
object. However, the window might not have all the correct information such as the correct icon. However, theTaskbarTask
has a reference to the window morph, the label of theTaskbarItemMorph
, the correct label, and the state of the window morph.So, I concluded that
TaskbarTask
is the perfect object for being the model of theTaskbarItemMorph
. I thus modify the code to makeTaskbarTask
the model ofTaskbarItemMorph
.Then, I fixed the methods of
TaskbarTask
andTaskbarItemMorph
in a way that they call the correct method and tada.On my computer, I have the correct icon, I have pre-visualisation of windows, and I can open/close windows. I also have the correct label color with minimized and maximized windows in the taskbar.
I do not know where to had tests for this kind of feature, but I can have a look if someone has idea (I dunno if it was tested)
fix #16594