-
Notifications
You must be signed in to change notification settings - Fork 34
Page DropDown with icons #527
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: master
Are you sure you want to change the base?
Changes from 1 commit
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -109,29 +109,35 @@ private void BuildContents(ImGui gui) { | |||||
| private void PageRightClickDropdown(ImGui gui, ProjectPage page) { | ||||||
| bool isSecondary = screen.secondaryPage == page; | ||||||
| bool isActive = screen.activePage == page; | ||||||
| if (gui.BuildContextMenuButton(LSs.EditPageProperties)) { | ||||||
| if (gui.BuildContextMenuButton(LSs.EditPageProperties, icon:Icon.Edit)) { | ||||||
|
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.
Suggested change
Our code style calls for spaces here, and missing spaces will cause problems for those of us who are using the recommended pre-push hook. |
||||||
| _ = gui.CloseDropdown(); | ||||||
| ProjectPageSettingsPanel.Show(page); | ||||||
| } | ||||||
| if (!isSecondary && !isActive) { | ||||||
| if (gui.BuildContextMenuButton(LSs.OpenSecondaryPage, LSs.ShortcutCtrlClick)) { | ||||||
| if (gui.BuildContextMenuButton(LSs.OpenSecondaryPage, LSs.ShortcutCtrlClick, Icon.Secondary)) { | ||||||
| _ = gui.CloseDropdown(); | ||||||
| screen.SetSecondaryPage(page); | ||||||
| } | ||||||
| } | ||||||
| else if (isSecondary) { | ||||||
| if (gui.BuildContextMenuButton(LSs.CloseSecondaryPage, LSs.ShortcutCtrlClick)) { | ||||||
| if (gui.BuildContextMenuButton(LSs.CloseSecondaryPage, LSs.ShortcutCtrlClick, Icon.Close)) { | ||||||
| _ = gui.CloseDropdown(); | ||||||
| screen.SetSecondaryPage(null); | ||||||
| } | ||||||
| } | ||||||
| if (gui.BuildContextMenuButton(LSs.DuplicatePage)) { | ||||||
| if (gui.BuildContextMenuButton(LSs.DuplicatePage, icon:Icon.Copy)) { | ||||||
| _ = gui.CloseDropdown(); | ||||||
| if (ProjectPageSettingsPanel.ClonePage(page) is { } copy) { | ||||||
| screen.project.RecordUndo().pages.Add(copy); | ||||||
| MainScreen.Instance.SetActivePage(copy); | ||||||
| } | ||||||
| } | ||||||
| if (gui.BuildContextMenuButton(LSs.RemovePage, icon:Icon.Delete, disabled: !page.canDelete)) { | ||||||
|
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.
Suggested change
For consistency with ProjectPageSettingsPanel, this should probably use the same string. |
||||||
| _ = gui.CloseDropdown(); | ||||||
| if (page.canDelete) { | ||||||
| screen.project.RemovePage(page); | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| public void Build(ImGui gui) { | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if we do want separate strings (Factorio has four "Cancel"s and three "Back"s in English), they should probably have the same content, to avoid questions about the differences between 'remove' and 'delete'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. We can reuse the
delete-pageinstead.