-
Notifications
You must be signed in to change notification settings - Fork 870
feat: 添加实例列表右键编辑功能 (#6000) #6038
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
base: main
Are you sure you want to change the base?
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * Hello Minecraft! Launcher | ||
| * Copyright (C) 2020 huangyuhui <huanghongxun2008@126.com> and contributors | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU General Public License as published by | ||
| * the Free Software Foundation, either version 3 of the License, or | ||
| * (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU General Public License | ||
| * along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
| */ | ||
| package org.jackhuang.hmcl.ui.profile; | ||
|
|
||
| import com.jfoenix.controls.JFXPopup; | ||
| import javafx.scene.Node; | ||
| import javafx.scene.layout.StackPane; | ||
| import org.jackhuang.hmcl.setting.Profile; | ||
| import org.jackhuang.hmcl.ui.Controllers; | ||
| import org.jackhuang.hmcl.ui.construct.IconedMenuItem; | ||
| import org.jackhuang.hmcl.ui.construct.PopupMenu; | ||
|
|
||
| import static org.jackhuang.hmcl.util.i18n.I18n.i18n; | ||
|
|
||
| /// Popup menu for ProfileListItem. | ||
| public final class ProfileListPopupMenu extends StackPane { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 我完全没理解这个 |
||
|
|
||
| /// Shows the popup menu for the given profile item. | ||
| public static void show(Node owner, Profile profile) { | ||
| PopupMenu menu = new PopupMenu(); | ||
| JFXPopup popup = new JFXPopup(menu); | ||
| menu.getContent().add(new IconedMenuItem( | ||
| org.jackhuang.hmcl.ui.SVG.EDIT, | ||
| i18n("button.edit"), | ||
| () -> Controllers.navigate(new ProfilePage(profile)), | ||
| popup)); | ||
| popup.show(owner, JFXPopup.PopupVPosition.BOTTOM, JFXPopup.PopupHPosition.LEFT, 0, 0); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| } | ||
|
|
||
| public ProfileListPopupMenu() { | ||
| getStyleClass().add("popup-menu-content"); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.