1
0
Fork 0

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

17
Cargo.lock generated
View file

@ -1088,6 +1088,7 @@ version = "0.3.0"
dependencies = [ dependencies = [
"nih_plug", "nih_plug",
"nih_plug_vizia", "nih_plug_vizia",
"open",
"realfft", "realfft",
"triple_buffer", "triple_buffer",
] ]
@ -2949,6 +2950,16 @@ version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1"
[[package]]
name = "open"
version = "3.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4a3100141f1733ea40b53381b0ae3117330735ef22309a190ac57b9576ea716"
dependencies = [
"pathdiff",
"windows-sys 0.36.1",
]
[[package]] [[package]]
name = "ordered-float" name = "ordered-float"
version = "3.3.0" version = "3.3.0"
@ -3083,6 +3094,12 @@ dependencies = [
"windows-sys 0.42.0", "windows-sys 0.42.0",
] ]
[[package]]
name = "pathdiff"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd"
[[package]] [[package]]
name = "pathfinder_geometry" name = "pathfinder_geometry"
version = "0.5.1" version = "0.5.1"

View file

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

View file

@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>. // 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::prelude::{Editor, Plugin};
use nih_plug_vizia::vizia::prelude::*; use nih_plug_vizia::vizia::prelude::*;
use nih_plug_vizia::widgets::*; use nih_plug_vizia::widgets::*;
@ -84,7 +85,15 @@ fn top_bar(cx: &mut Context) {
.font(assets::NOTO_SANS_THIN) .font(assets::NOTO_SANS_THIN)
.font_size(37.0) .font_size(37.0)
.top(Pixels(-2.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) Label::new(cx, Diopser::VERSION)
.color(DARKER_GRAY) .color(DARKER_GRAY)
.top(Stretch(1.0)) .top(Stretch(1.0))