SaveTool: various UI tweaks.

This commit is contained in:
Guillaume Jacquemin 2022-03-20 09:14:46 +01:00
parent e91c015c00
commit ce0ca07afc
4 changed files with 11 additions and 3 deletions

View file

@ -404,6 +404,7 @@ void SaveTool::drawMaterialRow(Containers::StringView name, Int tier, Getter get
(var) = getter();
ImGui::OpenPopup("int_edit");
}
drawTooltip("Edit");
if(drawIntEditPopup(&(var), 9999)) {
if(!setter(var)) {
_queue.addToast(Toast::Type::Error, _currentProfile->lastError());
@ -532,17 +533,19 @@ void SaveTool::drawMassManager() {
_currentMass = &_massManager->hangar(i);
_uiState = UiState::MassViewer;
}
ImGui::SameLine(0.0f, 2.0f);
drawTooltip("Open in M.A.S.S. editor");
}
else{
ImGui::PushStyleVar(ImGuiStyleVar_Alpha, 0.0f);
ImGui::SmallButton(ICON_FA_SEARCH);
ImGui::PopStyleVar();
}
ImGui::SameLine(0.0f, 2.0f);
if(drawUnsafeWidget(ImGui::SmallButton, ICON_FA_TRASH_ALT)) {
mass_to_delete = i;
ImGui::OpenPopup(mass_deletion_popup_ID);
}
drawTooltip("Delete");
ImGui::PopID();
}
}
@ -594,6 +597,7 @@ void SaveTool::drawMassManager() {
staged_mass_to_delete = pair.first;
ImGui::OpenPopup(staged_mass_deletion_popup_ID);
}
drawTooltip("Delete");
ImGui::PopID();
}

View file

@ -30,7 +30,7 @@ void SaveTool::drawArmour() {
_currentMass->getArmourParts();
}
if(!ImGui::BeginChild("##ArmourParts")) {
if(!ImGui::BeginChild("##ArmourParts", {0.0f, 0.0f}, true)) {
ImGui::EndChild();
return;
}

View file

@ -101,11 +101,13 @@ void SaveTool::drawProfileManager() {
profile_index = i;
ImGui::OpenPopup(backup_popup_id);
}
drawTooltip("Backup");
ImGui::SameLine(0.0f, 2.0f);
if(drawUnsafeWidget(ImGui::SmallButton, ICON_FA_TRASH_ALT)) {
profile_index = i;
ImGui::OpenPopup(delete_popup_id);
}
drawTooltip("Delete");
ImGui::PopID();
}
ImGui::EndTable();
@ -283,11 +285,13 @@ auto SaveTool::drawBackupListPopup() -> ImGuiID {
backup_index = i;
ImGui::OpenPopup(restore_backup_popup_id);
}
drawTooltip("Restore");
ImGui::SameLine(0.0f, 2.0f);
if(ImGui::SmallButton(ICON_FA_TRASH_ALT)) {
backup_index = i;
ImGui::OpenPopup(delete_backup_popup_id);
}
drawTooltip("Delete");
ImGui::PopID();
}
ImGui::EndTable();

View file

@ -179,7 +179,7 @@ void SaveTool::drawMainMenu() {
#endif
if(ImGui::BeginMenu("Help")) {
if(ImGui::BeginMenu(ICON_FA_BOOK " ImGui user guide")) {
if(ImGui::BeginMenu(ICON_FA_KEYBOARD " Keyboard shortcuts")) {
ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
ImGui::BulletText("While inputing text:\n");