Minor request - make getBorderSize virtual?

Hi Jules!

Can I please ask you to make this a virtual method:

  DocumentWindow:: ...
  int getBorderSize() const

The reason is that for my browser plug-ins, I need to be able to display without a Juce-supplied border (which otherwise appears as a side-effect of my using a built-in Juce menu within the plug-in!). The only way for me to make it look right is to override the above method by making it virtual (and in which case, my override simply returns a value of 0). I’ve hacked my local copy of Juce to achieve this (a real 1-liner!), and it’d be neat if you could change that in your base Juce code.

Best wishes,

Pete

Shouldn’t you just be overriding getBorderThickness()? Or does that not work for some reason?

Hi Jules!

Sorry, had to double-check the code before getting back to you!

The problem is here:

int DocumentWindow::getBorderSize() const
{
    return (isFullScreen() || isUsingNativeTitleBar()) ? 0 : (resizableBorder != 0 ? 4 : 1);
}

As you can see, it returns hard-coded values…! :slight_smile: Hence either this method needs to be virtual, or I guess an alternative virtual method used to override the 4 and/or 1 values.

Best wishes,

Pete

Ok, forget about getBorderSize - it shouldn’t exist and I’m going to delete it. You need to be using getBorderThickness instead, but there are a couple of bits of Document window that need tweaking to use getBorderThickness instead.

OK Jules, I’ll keep an eye on changes you make in this area! :slight_smile:

Best wishes,

Pete

Already checked in a fix, let me know if it doesn’t do what you need…

Cheers Jules - shall check it out! :slight_smile: