Application: adapt to ImGui changes.

This commit is contained in:
Guillaume Jacquemin 2023-11-29 13:12:18 +01:00
parent df9e6bcd17
commit bf7f6d24f3
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A
7 changed files with 15 additions and 12 deletions

View file

@ -58,7 +58,7 @@ Application::drawManager() {
if(ImGui::BeginChild("##ProfileInfo", if(ImGui::BeginChild("##ProfileInfo",
{ImGui::GetContentRegionAvail().x * 0.60f, 0.0f}, {ImGui::GetContentRegionAvail().x * 0.60f, 0.0f},
true, ImGuiWindowFlags_MenuBar)) ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{ {
if(ImGui::BeginMenuBar()) { if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("Profile information"); ImGui::TextUnformatted("Profile information");
@ -85,7 +85,7 @@ Application::drawManager() {
ImGui::SameLine(); ImGui::SameLine();
if(ImGui::BeginChild("##MASSManager", {0.0f, 0.0f}, if(ImGui::BeginChild("##MASSManager", {0.0f, 0.0f},
true, ImGuiWindowFlags_MenuBar)) ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{ {
if(ImGui::BeginMenuBar()) { if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("M.A.S.S. management"); ImGui::TextUnformatted("M.A.S.S. management");

View file

@ -52,7 +52,7 @@ Application::drawMassViewer() {
if(ImGui::BeginChild("##MassInfo", if(ImGui::BeginChild("##MassInfo",
{0.0f, 0.0f}, {0.0f, 0.0f},
true, ImGuiWindowFlags_MenuBar)) ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{ {
if(ImGui::BeginMenuBar()) { if(ImGui::BeginMenuBar()) {
if(ImGui::BeginTable("##MassViewerMenuTable", 4)) { if(ImGui::BeginTable("##MassViewerMenuTable", 4)) {
@ -303,7 +303,9 @@ Application::drawCustomStyle(GameObjects::CustomStyle& style) {
DCSResult return_value = DCS_Fail; DCSResult return_value = DCS_Fail;
if(!ImGui::BeginChild("##CustomStyle", {0.0f, 244.0f}, true, ImGuiWindowFlags_MenuBar)) { if(!ImGui::BeginChild("##CustomStyle", {}, ImGuiChildFlags_Border|ImGuiChildFlags_AutoResizeY,
ImGuiWindowFlags_MenuBar))
{
ImGui::EndChild(); ImGui::EndChild();
return DCS_Fail; return DCS_Fail;
} }

View file

@ -34,7 +34,7 @@ Application::drawArmour() {
_currentMass->getBulletLauncherAttachments(); _currentMass->getBulletLauncherAttachments();
} }
if(!ImGui::BeginChild("##ArmourParts", {0.0f, 0.0f}, true)) { if(!ImGui::BeginChild("##ArmourParts", {}, ImGuiChildFlags_Border)) {
ImGui::EndChild(); ImGui::EndChild();
return; return;
} }

View file

@ -36,8 +36,8 @@ Application::drawFrameInfo() {
if(ImGui::BeginChild("##JointSliders", if(ImGui::BeginChild("##JointSliders",
{(ImGui::GetContentRegionAvail().x / 2.0f) - (ImGui::GetStyle().WindowPadding.x / 2.0f), {(ImGui::GetContentRegionAvail().x / 2.0f) - (ImGui::GetStyle().WindowPadding.x / 2.0f),
(ImGui::GetContentRegionAvail().y / 1.75f) - (ImGui::GetStyle().WindowPadding.y / 2.0f)}, 0.0f},
true, ImGuiWindowFlags_MenuBar)) ImGuiChildFlags_Border|ImGuiChildFlags_AutoResizeY, ImGuiWindowFlags_MenuBar))
{ {
if(ImGui::BeginMenuBar()) { if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("Joint sliders"); ImGui::TextUnformatted("Joint sliders");
@ -51,7 +51,7 @@ Application::drawFrameInfo() {
if(ImGui::BeginChild("##FrameStyles", if(ImGui::BeginChild("##FrameStyles",
{(ImGui::GetContentRegionAvail().x / 2.0f) - (ImGui::GetStyle().WindowPadding.x / 2.0f), 0.0f}, {(ImGui::GetContentRegionAvail().x / 2.0f) - (ImGui::GetStyle().WindowPadding.x / 2.0f), 0.0f},
true, ImGuiWindowFlags_MenuBar)) ImGuiChildFlags_Border, ImGuiWindowFlags_MenuBar))
{ {
if(ImGui::BeginMenuBar()) { if(ImGui::BeginMenuBar()) {
ImGui::TextUnformatted("Frame styles"); ImGui::TextUnformatted("Frame styles");

View file

@ -506,7 +506,7 @@ Application::drawWeaponEditor(GameObjects::Weapon& weapon) {
} }
} }
if(ImGui::BeginChild("##PartDetails", {0.0f, 0.0f}, true)) { if(ImGui::BeginChild("##PartDetails", {}, ImGuiChildFlags_Border)) {
ImGui::TextUnformatted("Styles:"); ImGui::TextUnformatted("Styles:");
for(std::int32_t i = 0; i < 4; i++) { for(std::int32_t i = 0; i < 4; i++) {

View file

@ -305,7 +305,7 @@ Application::drawBackupListPopup() {
ImGui::EndTable(); ImGui::EndTable();
} }
ImGui::PushTextWrapPos(ImGui::GetWindowContentRegionWidth()); ImGui::PushTextWrapPos(ImGui::GetContentRegionAvail().x);
ImGui::TextUnformatted("Hover over a company name to see which files are included in the backup."); ImGui::TextUnformatted("Hover over a company name to see which files are included in the backup.");
ImGui::PopTextWrapPos(); ImGui::PopTextWrapPos();

View file

@ -86,9 +86,10 @@ Application::drawAbout() {
ImGui::Separator(); ImGui::Separator();
if(ImGui::CollapsingHeader("Licence")) { if(ImGui::CollapsingHeader("Licence")) {
ImGui::TextWrapped("This application is made available under the terms of the GNU General Public License, version 3, the full text of which is available below:"); ImGui::TextWrapped("This application is made available under the terms of the GNU General Public License,"
"version 3, the full text of which is available below:");
if(ImGui::BeginChild("##GPL", {0.0f, float(windowSize().y()) * 0.3f}, true)) { if(ImGui::BeginChild("##GPL", {0.0f, float(windowSize().y()) * 0.3f}, ImGuiChildFlags_Border)) {
static auto licence = _rs.getRaw("COPYING"); static auto licence = _rs.getRaw("COPYING");
ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[1]); ImGui::PushFont(ImGui::GetIO().Fonts->Fonts[1]);
ImGui::TextUnformatted(licence.begin(), licence.end()); ImGui::TextUnformatted(licence.begin(), licence.end());