cocoawebview 0.3.5 → 0.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4f9d8b6d440dc3f049b85926ccbe488134f7fe4c2f574fba2f7cd65d43084600
4
- data.tar.gz: 7c4e4cae2a70fd0dfedd0c4f0632a66367e2e0b667190d4655ba0706a5111952
3
+ metadata.gz: 565509cd7519af65bf75223ae7b73a9df121d660f8f7b1ee6801d9d99aaa1941
4
+ data.tar.gz: e9d81c5b9c308c21a3df5ea8d3f51cc5c2a88999ec25611e2007ff2f085f72eb
5
5
  SHA512:
6
- metadata.gz: 7390369913cdf0173f685322679661007a72089384292d045afbf1d06da2c1620be31c103889a6425efa2b4c2e5252af83ec23c9986e972fb6b34b5d9ce20097
7
- data.tar.gz: c7f3bad9de5b031c0ab44e1867cb1f34913741511497c8f6c1f648e2c5072159e639f719d42474ddf1817393a26b8e3ce602bbebb96d71165cbe2c35c704329c
6
+ metadata.gz: e1a655389f33ae83b4007007bd8b63f549f55b0705a6a6b7671ec769c5f6a174107f00c130c78079ba50924bfc19d843b56f02a2d7ff3b32f1b10ec517c35211
7
+ data.tar.gz: 833fe660daa5fc18de836d4224b0a194c93e118018d0e3d9e013f027316fbc2e27d4bcaaebabdb4fdc6a2ea7a9eb5fd5514f76c87eb052c72f2b9426e8594fee
@@ -24,6 +24,7 @@ VALUE webview_set_title(VALUE self, VALUE title);
24
24
  VALUE webview_center(VALUE self);
25
25
  VALUE webview_is_visible(VALUE self);
26
26
  VALUE webview_set_topmost(VALUE self, VALUE topmost);
27
+ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a);
27
28
 
28
29
  @interface FileDropContainerView : NSView {
29
30
  VALUE rb_cocoawebview;
@@ -244,7 +245,6 @@ VALUE webview_set_topmost(VALUE self, VALUE topmost);
244
245
  */
245
246
 
246
247
  // Add to window's contentView
247
- //[[window contentView] addSubview:fileDropView];
248
248
  [[window contentView] addSubview: webView];
249
249
  [[window contentView] addSubview:fileDropView positioned:NSWindowAbove relativeTo:webView];
250
250
 
@@ -294,6 +294,7 @@ Init_cocoawebview(void)
294
294
  rb_define_method(rb_mCocoaWebviewClass, "center", webview_center, 0);
295
295
  rb_define_method(rb_mCocoaWebviewClass, "visible?", webview_is_visible, 0);
296
296
  rb_define_method(rb_mCocoaWebviewClass, "set_topmost", webview_set_topmost, 1);
297
+ rb_define_method(rb_mCocoaWebviewClass, "set_bg", webview_set_bg, 4);
297
298
 
298
299
  }
299
300
 
@@ -481,3 +482,20 @@ VALUE webview_set_topmost(VALUE self, VALUE topmost) {
481
482
  [webview setLevel:NSNormalWindowLevel];
482
483
  }
483
484
  }
485
+
486
+ VALUE webview_set_bg(VALUE self, VALUE r, VALUE g, VALUE b, VALUE a) {
487
+ VALUE wrapper = rb_ivar_get(self, rb_intern("@webview"));
488
+ CocoaWebview *webview;
489
+ TypedData_Get_Struct(wrapper, CocoaWebview, &cocoawebview_obj_type, webview);
490
+
491
+ double c_r = NUM2DBL(r);
492
+ double c_g = NUM2DBL(g);
493
+ double c_b = NUM2DBL(b);
494
+ double c_a = NUM2DBL(a);
495
+
496
+ NSColor *rgbColor = [NSColor colorWithSRGBRed:c_r
497
+ green:c_g
498
+ blue:c_b
499
+ alpha:c_a];
500
+ [webview setBackgroundColor:rgbColor];
501
+ }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocoawebview
4
- VERSION = "0.3.5"
4
+ VERSION = "0.3.6"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoawebview
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy Jeff
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-07-03 00:00:00.000000000 Z
10
+ date: 2025-07-04 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Webview ruby binding for macOS
13
13
  email: