cocoawebview 1.0.1 → 1.0.2

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: 1f7e2c2321811e76b897163649af68cfe612b4fbb983573e2022af73f5a5aa68
4
- data.tar.gz: 0a62a450993d8e3c30f3248d5762828cf7c31c1670f942ef062901cc7989857d
3
+ metadata.gz: 25e667a669abd1fcbfec7bf7cf833129551cd737f0af6f5dd6cee8242760bdd8
4
+ data.tar.gz: 315afe221445ddeb86de3e696e3e3b6351845bcde0f192345b2a4e06a57554d8
5
5
  SHA512:
6
- metadata.gz: c3466fe4d4d6de9fcb6c9e57522ee244f9253d3ab36059244046e60096a64e1486ca814cec295f63a50370478f8f0d1ab6be2d3313162c701572de84f98f8cab
7
- data.tar.gz: 64e8c7763867cb6642d754103fc04d4628f3b4bd34085ee45ae675906cec8f5b5e9fc03c2ca79d807581a984c8e2a14c1117373c3cb08b2283e37bf01f180a84
6
+ metadata.gz: ac77f7ca9de87a6cb555e51d5cac3b4125dcbc4b65def7d259e5e2e2419c46c4b91b433d7a41a8ffe4dcba1b7f8d25882ba77ebbcce899f23a27548491b7c10d
7
+ data.tar.gz: e3aefe0cad56e874e31353b893d4ffb51e0cafdda9955e91dd73a806539d42a379c7f0ae7c807b5ec8c09ca11b910a68cbd9cc9fd737fce7112efdabb7c956fc
@@ -10,6 +10,7 @@ NSApplication *application = nil;
10
10
 
11
11
  VALUE nsapp_initialize(VALUE self);
12
12
  VALUE nsapp_run(VALUE self);
13
+ VALUE nsapp_get_theme(VALUE self);
13
14
  VALUE nsapp_exit(VALUE self);
14
15
 
15
16
  VALUE nsmenu_initialize(VALUE self);
@@ -361,6 +362,7 @@ Init_cocoawebview(void)
361
362
  rb_mNSAppClass = rb_define_class_under(rb_mCocoawebview, "NSApp", rb_cObject);
362
363
  rb_define_method(rb_mNSAppClass, "initialize", nsapp_initialize, 0);
363
364
  rb_define_method(rb_mNSAppClass, "run", nsapp_run, 0);
365
+ rb_define_method(rb_mNSAppClass, "get_theme", nsapp_get_theme, 0);
364
366
  rb_define_method(rb_mNSAppClass, "exit", nsapp_exit, 0);
365
367
 
366
368
  /* Menu */
@@ -410,6 +412,19 @@ VALUE nsapp_run(VALUE self) {
410
412
  [application run];
411
413
  }
412
414
 
415
+ VALUE nsapp_get_theme(VALUE self) {
416
+ NSString *theme = [[NSUserDefaults standardUserDefaults]
417
+ stringForKey:@"AppleInterfaceStyle"];
418
+
419
+ if (!theme) {
420
+ // Light mode
421
+ return rb_utf8_str_new_cstr("Light");
422
+ }
423
+
424
+ const char *utf8 = [theme UTF8String];
425
+ return rb_utf8_str_new_cstr(utf8);
426
+ }
427
+
413
428
  VALUE nsapp_exit(VALUE self) {
414
429
  [[NSApplication sharedApplication] terminate:nil];
415
430
  }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cocoawebview
4
- VERSION = "1.0.1"
4
+ VERSION = "1.0.2"
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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tommy Jeff
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2026-02-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Webview ruby binding for macOS
13
13
  email:
@@ -46,7 +46,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  requirements: []
49
- rubygems_version: 3.6.5
49
+ rubygems_version: 3.6.9
50
50
  specification_version: 4
51
51
  summary: Webview ruby binding for macOS
52
52
  test_files: []