Open Diopser GH page when clicking on the title

This commit is contained in:
Robbert van der Helm
2022-11-11 18:14:01 +01:00
parent aa7d5195ce
commit d280c2d767
3 changed files with 28 additions and 1 deletions

View File

@@ -21,4 +21,5 @@ nih_plug_vizia = { path = "../../nih_plug_vizia" }
# For the GUI
realfft = "3.0"
open = "3.0"
triple_buffer = "6.0"

View File

@@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
use nih_plug::nih_debug_assert_failure;
use nih_plug::prelude::{Editor, Plugin};
use nih_plug_vizia::vizia::prelude::*;
use nih_plug_vizia::widgets::*;
@@ -84,7 +85,15 @@ fn top_bar(cx: &mut Context) {
.font(assets::NOTO_SANS_THIN)
.font_size(37.0)
.top(Pixels(-2.0))
.left(Pixels(8.0));
.left(Pixels(8.0))
.on_mouse_down(|_, _| {
// Try to open the Diopser plugin's page when clicking on the title. If this fails
// then that's not a problem
let result = open::that(Diopser::URL);
if cfg!(debug) && result.is_err() {
nih_debug_assert_failure!("Failed to open web browser: {:?}", result);
}
});
Label::new(cx, Diopser::VERSION)
.color(DARKER_GRAY)
.top(Stretch(1.0))