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

Open locator popup with shortcut #1951

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

meretp
Copy link
Contributor

@meretp meretp commented Sep 11, 2023

Summary of changes

With this PR the previously introduced popup to locate signals can be openend via the shortcut Ctrl+L or Cmd+L or via the Top bar. I also added a new icon for this functionality.

Context and reason for change

We want to imlement a new feature to be able to locate signals based on criticality and certain licenses.

How can the changes be tested

Run the unittests.
Check out the PR and start OpossumUI. If you don't open a file the shortcut Ctrl+L or Cmd+L and will do nothing. But you will see the option "Locate Signals" in the top bar menu as in the screenshot below.
image

Next, open a file and use Ctrl+L or Cmd+L and observe that the popup shows up as in the screenshot below.
image

Solves #1947.

@meretp meretp linked an issue Sep 11, 2023 that may be closed by this pull request
Comment on lines 247 to 255
icon: nativeTheme?.shouldUseDarkColors
? path.join(
getBasePathOfAssets(),
'icons/location-searching-white.png',
)
: path.join(
getBasePathOfAssets(),
'icons/location-searching-black.png',
),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this code is repeated a lot. Might be nice to rafactor it such that it takes two file names and returns the icon that fits the theme.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I extracted a method for this.

@benedikt-richter
Copy link
Member

The commit message should contain the issue number and a description what was done. Would be nice if you could add that.

The popup to locate signals can now be opened via shortcut Ctrl+L/Cmd+L or via the top bar if an Opossum file is opened.
This commit also includes a small refactoring which extracts a method to choose the correct icon based on the theme (dark or light) used.

Issue: opossum-tool#1947
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
@meretp meretp force-pushed the open-popup-with-shortcut branch from d749fd1 to ddee116 Compare September 11, 2023 08:01
Copy link
Member

@benedikt-richter benedikt-richter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@benedikt-richter benedikt-richter self-assigned this Sep 11, 2023
@benedikt-richter benedikt-richter merged commit 17d671f into opossum-tool:main Sep 11, 2023
@meretp meretp deleted the open-popup-with-shortcut branch September 11, 2023 08:45
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.

[1935] Allow to open popup using Ctrl+L
2 participants