Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon for debugger in the toolbar #16661

Open
wants to merge 1 commit into
base: Pharo13
Choose a base branch
from

Conversation

badetitou
Copy link
Member

@badetitou badetitou commented May 15, 2024

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)
image

But, in Pharo12. we lose this icon (see second screenshot)
image

This PR aims to add it back as presented in the last screenshot
image

Fix detail

To fix the issue. I first discovered that TaskbarItemMorph is created from a TaskbarTask, but the model of TaskbarItemMorph is the actual window morph and not the TaskbarTask object. However, the window might not have all the correct information such as the correct icon. However, the TaskbarTask has a reference to the window morph, the label of the TaskbarItemMorph, the correct label, and the state of the window morph.
So, I concluded that TaskbarTask is the perfect object for being the model of the TaskbarItemMorph. I thus modify the code to make TaskbarTask the model of TaskbarItemMorph.
Then, I fixed the methods of TaskbarTask and TaskbarItemMorph 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

@Rinzwind
Copy link
Contributor

The icons seem to have gone missing due to the changes in commit b25824e010604f57 and Spec commit 1e0ba07e672b77af: #initializeFor: on TaskbarItemMorph was changed to send #taskbarIconName instead of #taskbarIcon, and the implementation of #taskbarIcon on SystemWindow was replaced by an implementation of #taskbarIconName that sends the same message, but the implementation of #taskbarIcon on SpWindowPresenter was not replaced by an implementation of #taskbarIconName. Implementing #taskbarIconName on SpWindowPresenter as follows restores the icon for a debugger (it’s only a partial fix as it ignores the send of #windowIcon in #taskbarIcon for which there is no equivalent #windowIconName yet):

taskbarIconName

	^ self presenter
		ifNil: [ super taskbarIconName ]
		ifNotNil: #taskbarIconName

Note that the change to #initializeFor: on TaskbarItemMorph in this pull request reverses the use of the FormSet for the icon introduced in pull request #16316.

@badetitou
Copy link
Member Author

Thanks for the explanation.

Do you think TaskbarTask should not be the model of the TaskbarItemMorph?
Maybe we could modify TaskbarTask by changing the icon attribute by iconName, and so keeping the usage of FormSet?

@Rinzwind
Copy link
Contributor

I would suggest to maybe first fix the missing #taskbarIconName on SpWindowPresenter and to then check whether it would still make sense to change the model passed to the TaskbarItemMorph.

A change in commit 09f40b6 that is not so clear to me is the removal of the send of #taskbarButtonFor: from #taskbarButtonFor: on TaskbarTask which seems to not take into account that there are other implementations of #taskbarButtonFor: besides the one on SystemWindow. The implementation of #performAction: on TaskbarItemMorph seems to be a copy of the one inherited from PluggableButtonMorph with model replaced by model morph, that may need to be abstracted better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icon for debugger in the toolbar
2 participants