Skip to content
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

Add utility function void ChangeWindowFullMonitorWorkArea() like void… #130

Merged
merged 2 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/hello_imgui/hello_imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ std::string GetBackendDescription();
// (useful if you want to change the window size during execution)
void ChangeWindowSize(const ScreenSize &windowSize);


// `UseWindowFullMonitorWorkArea()`: sets the window size to the monitor work area
// (useful if you want to change the window size during execution)
void UseWindowFullMonitorWorkArea();

// @@md


Expand Down
8 changes: 8 additions & 0 deletions src/hello_imgui/impl/hello_imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,14 @@ void ChangeWindowSize(const ScreenSize &windowSize)
gLastRunner->ChangeWindowSize(windowSize);
}


void UseWindowFullMonitorWorkArea()
{

gLastRunner->UseWindowFullMonitorWorkArea();
}


bool ShouldRemoteDisplay()
{
return gLastRunner->ShouldRemoteDisplay();
Expand Down
7 changes: 7 additions & 0 deletions src/hello_imgui/internal/backend_impls/abstract_runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,13 @@ void AbstractRunner::ChangeWindowSize(HelloImGui::ScreenSize windowSize)
mBackendWindowHelper->SetWindowBounds(mWindow, bounds);
}

void AbstractRunner::UseWindowFullMonitorWorkArea()
{
auto screenBounds = mGeometryHelper->GetCurrentMonitorWorkArea(mBackendWindowHelper.get(),mWindow);
this->setWasWindowResizedByCodeDuringThisFrame();
mBackendWindowHelper->SetWindowBounds(mWindow, screenBounds);
}

bool AbstractRunner::ShallSizeWindowRelativeTo96Ppi()
{
bool shallSizeRelativeTo96Ppi;
Expand Down
1 change: 1 addition & 0 deletions src/hello_imgui/internal/backend_impls/abstract_runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class AbstractRunner
ImageBuffer ScreenshotRgb() { return mRenderingBackendCallbacks->Impl_ScreenshotRgb_3D(); }

void ChangeWindowSize(ScreenSize windowSize);
void UseWindowFullMonitorWorkArea();

void LayoutSettings_SwitchLayout(const std::string& layoutName);
bool ShouldRemoteDisplay();
Expand Down
Loading