Skip to content

Commit

Permalink
full window macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
MeijisIrlnd committed Aug 18, 2024
1 parent 28d28ae commit 9585d73
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions cmake/serialise.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <cassert>
#include <fstream>
#include <cstdint>
#include <sstream>
#include <fmt/core.h>

constexpr static auto headerStart =
Expand Down
6 changes: 3 additions & 3 deletions examples/gain/gain-gui/src/App.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#root {
min-width: 400px;
max-width: 1280px;
min-width: 500px;
min-height: 500px;
margin: 0 auto;
padding: 2rem;
padding: 0;
text-align: center;
align-content: center;
justify-content: center;
Expand Down
3 changes: 2 additions & 1 deletion source/gui/mostlyharmless_WebviewEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ namespace mostly_harmless::gui {
}

void destroy() {
helpers::macos::removeFromParentView(m_webview->getViewHandle());
// helpers::macos::removeFromParentView(m_webview->getViewHandle());
m_webview.reset();
}

void getSize(std::uint32_t* width, std::uint32_t* height) {
Expand Down
3 changes: 2 additions & 1 deletion source/gui/platform/mostlyharmless_GuiHelpersMacOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ void reparentView(void* parentViewHandle, void* childViewHandle) {
auto* child = static_cast<NSView*>(childViewHandle);
child.frame = parent.bounds;
[parent addSubview:child];
[[maybe_unused]] const auto converted = [parent.window.contentView convertRect:child.frame fromView:child];
}

void showView(void* viewHandle) {
Expand All @@ -35,4 +36,4 @@ void hideView(void* viewHandle) {
auto* asView = static_cast<NSView*>(viewHandle);
asView.hidden = true;
}
} // namespace mostly_harmless::gui::helpers
} // namespace mostly_harmless::gui::helpers::macos
4 changes: 2 additions & 2 deletions source/mostlyharmless_Plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,12 @@ namespace mostly_harmless {

template <marvin::FloatType SampleType>
bool Plugin<SampleType>::guiCanResize() const noexcept {
return false; // TODO
return true; // TODO
}

template <marvin::FloatType SampleType>
bool Plugin<SampleType>::guiAdjustSize(std::uint32_t* /*width*/, std::uint32_t* /*height*/) noexcept {
return false; // TODO
return true; // TODO
}

template <marvin::FloatType SampleType>
Expand Down

0 comments on commit 9585d73

Please sign in to comment.