Browse Source

Do not show resize handle on standalone

Signed-off-by: falkTX <falktx@falktx.com>
tags/22.04
falkTX 3 years ago
parent
commit
1628f29a98
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
4 changed files with 15 additions and 3 deletions
  1. +1
    -1
      dpf
  2. +6
    -0
      src/CardinalCommon.cpp
  3. +2
    -0
      src/CardinalCommon.hpp
  4. +6
    -2
      src/override/Scene.cpp

+ 1
- 1
dpf

@@ -1 +1 @@
Subproject commit e512b25281af5887033dae4bfb1c10c40c18fde7
Subproject commit 1bab2267628ec5c58e8b41d9df4f346bbde3545a

+ 6
- 0
src/CardinalCommon.cpp View File

@@ -29,6 +29,7 @@


#include "AsyncDialog.hpp" #include "AsyncDialog.hpp"
#include "PluginContext.hpp" #include "PluginContext.hpp"
#include "DistrhoPluginUtils.hpp"


#include <asset.hpp> #include <asset.hpp>
#include <context.hpp> #include <context.hpp>
@@ -58,6 +59,11 @@ namespace settings {
int rateLimit = 0; int rateLimit = 0;
} }


bool isStandalone()
{
return std::strstr(getPluginFormatName(), "JACK") != nullptr;
}

#ifdef ARCH_WIN #ifdef ARCH_WIN
std::string getSpecialPath(const SpecialPath type) std::string getSpecialPath(const SpecialPath type)
{ {


+ 2
- 0
src/CardinalCommon.hpp View File

@@ -41,6 +41,8 @@ namespace window {
void generateScreenshot(); void generateScreenshot();
} }


bool isStandalone();

#ifdef ARCH_WIN #ifdef ARCH_WIN
enum SpecialPath { enum SpecialPath {
kSpecialPathUserProfile, kSpecialPathUserProfile,


+ 6
- 2
src/override/Scene.cpp View File

@@ -127,7 +127,7 @@ struct ResizeHandle : widget::OpaqueWidget {




struct Scene::Internal { struct Scene::Internal {
ResizeHandle* resizeHandle;
ResizeHandle* resizeHandle = nullptr;


bool heldArrowKeys[4] = {}; bool heldArrowKeys[4] = {};


@@ -173,6 +173,9 @@ Scene::Scene() {
browser->hide(); browser->hide();
addChild(browser); addChild(browser);


if (isStandalone())
return;

internal->resizeHandle = new ResizeHandle; internal->resizeHandle = new ResizeHandle;
internal->resizeHandle->box.size = math::Vec(16, 16); internal->resizeHandle->box.size = math::Vec(16, 16);
addChild(internal->resizeHandle); addChild(internal->resizeHandle);
@@ -200,7 +203,8 @@ void Scene::step() {
rackScroll->box.pos.y = menuBar->box.size.y; rackScroll->box.pos.y = menuBar->box.size.y;
} }


internal->resizeHandle->box.pos = box.size.minus(internal->resizeHandle->box.size);
if (internal->resizeHandle != nullptr)
internal->resizeHandle->box.pos = box.size.minus(internal->resizeHandle->box.size);


// Resize owned descendants // Resize owned descendants
menuBar->box.size.x = box.size.x; menuBar->box.size.x = box.size.x;


Loading…
Cancel
Save