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

View file

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

View file

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

View file

@ -179,7 +179,7 @@ void SaveTool::drawMainMenu() {
#endif #endif
if(ImGui::BeginMenu("Help")) { 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("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("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
ImGui::BulletText("While inputing text:\n"); ImGui::BulletText("While inputing text:\n");