screenoverlay 0.6.3__py3-none-any.whl → 0.6.4__py3-none-any.whl

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.
screenoverlay/__init__.py CHANGED
@@ -5,7 +5,7 @@ Provides blur, black, white, and custom color overlays with minimal latency
5
5
 
6
6
  from .overlay import NativeBlurOverlay as Overlay
7
7
 
8
- __version__ = '0.6.3'
8
+ __version__ = '0.6.4'
9
9
  __author__ = 'ScreenStop'
10
10
  __all__ = ['Overlay']
11
11
 
screenoverlay/overlay.py CHANGED
@@ -20,7 +20,11 @@ except ImportError:
20
20
 
21
21
 
22
22
  class NativeBlurOverlay:
23
- def __init__(self, mode='blur', blur_strength=3, opacity=0.85, color_tint=(136, 136, 136), all_screens=True):
23
+ def __init__(self, mode='blur', blur_strength=3, opacity=0.85, color_tint=(136, 136, 136), all_screens=True,
24
+ watermark_enabled=False, watermark_text="", watermark_position="bottom_right",
25
+ watermark_font_family="Segoe UI", watermark_font_size=16, watermark_padding=24,
26
+ watermark_color="#FFFFFF", watermark_shadow=True, watermark_shadow_color="#000000",
27
+ watermark_shadow_offset=(1, 1)):
24
28
  """
25
29
  Initialize native overlay
26
30
 
@@ -34,11 +38,34 @@ class NativeBlurOverlay:
34
38
  - opacity (float): Window opacity (0.0 to 1.0)
35
39
  - color_tint (tuple): RGB color tint (0-255)
36
40
  - all_screens (bool): If True, blur all monitors. If False, only blur primary monitor (default: True)
41
+ - watermark_enabled (bool): Enable watermark text overlay (default: False)
42
+ - watermark_text (str): Text to display in watermark (default: "")
43
+ - watermark_position (str): Position of watermark - 'bottom_right', 'bottom_left', 'top_right', 'top_left' (default: 'bottom_right')
44
+ - watermark_font_family (str): Font family for watermark (default: 'Segoe UI')
45
+ - watermark_font_size (int): Font size for watermark (default: 16)
46
+ - watermark_padding (int): Padding from edge in pixels (default: 24)
47
+ - watermark_color (str): Text color in hex format (default: '#FFFFFF')
48
+ - watermark_shadow (bool): Enable text shadow (default: True)
49
+ - watermark_shadow_color (str): Shadow color in hex format (default: '#000000')
50
+ - watermark_shadow_offset (tuple): Shadow offset (x, y) in pixels (default: (1, 1))
37
51
  """
38
52
  self.mode = mode.lower()
39
53
  self.blur_strength = max(1, min(5, blur_strength))
40
54
  self.all_screens = all_screens
41
55
 
56
+ # Watermark settings
57
+ self.watermark_enabled = watermark_enabled
58
+ self.watermark_text = watermark_text
59
+ self.watermark_position = watermark_position
60
+ self.watermark_font_family = watermark_font_family
61
+ self.watermark_font_size = watermark_font_size
62
+ self.watermark_padding = watermark_padding
63
+ self.watermark_color = watermark_color
64
+ self.watermark_shadow = watermark_shadow
65
+ self.watermark_shadow_color = watermark_shadow_color
66
+ self.watermark_shadow_offset = watermark_shadow_offset
67
+ self._watermark_widgets = [] # Store references to prevent garbage collection
68
+
42
69
  # Apply mode-specific settings
43
70
  if self.mode == 'black':
44
71
  self.opacity = opacity if opacity != 0.85 else 1.0 # Default full opacity for black
@@ -263,10 +290,82 @@ class NativeBlurOverlay:
263
290
  if self.apply_blur:
264
291
  self._apply_native_blur_to_window(window)
265
292
 
293
+ # Add watermark if enabled
294
+ self._add_watermark(window)
295
+
266
296
  # Bind escape key to hide (only on primary window)
267
297
  if window == self.root:
268
298
  window.bind('<Escape>', lambda e: self.hide())
269
299
 
300
+ def _add_watermark(self, window):
301
+ """Add watermark text overlay to a window"""
302
+ if not self.watermark_enabled or not self.watermark_text:
303
+ return
304
+
305
+ # Font configuration
306
+ font = (self.watermark_font_family, self.watermark_font_size, "bold")
307
+
308
+ # Determine placement based on position
309
+ pos = self.watermark_position.lower()
310
+ xpad = self.watermark_padding
311
+ ypad = self.watermark_padding
312
+
313
+ if pos == "bottom_right":
314
+ relx, rely, anchor = 1.0, 1.0, "se"
315
+ x_offset = -xpad
316
+ y_offset = -ypad
317
+ elif pos == "bottom_left":
318
+ relx, rely, anchor = 0.0, 1.0, "sw"
319
+ x_offset = xpad
320
+ y_offset = -ypad
321
+ elif pos == "top_right":
322
+ relx, rely, anchor = 1.0, 0.0, "ne"
323
+ x_offset = -xpad
324
+ y_offset = ypad
325
+ else: # "top_left"
326
+ relx, rely, anchor = 0.0, 0.0, "nw"
327
+ x_offset = xpad
328
+ y_offset = ypad
329
+
330
+ # Get window background color for transparent label background
331
+ bg_color = window.cget("bg")
332
+
333
+ # Add shadow if enabled
334
+ if self.watermark_shadow:
335
+ sx, sy = self.watermark_shadow_offset
336
+ shadow = tk.Label(
337
+ window,
338
+ text=self.watermark_text,
339
+ fg=self.watermark_shadow_color,
340
+ bg=bg_color,
341
+ font=font
342
+ )
343
+ shadow.place(
344
+ relx=relx,
345
+ rely=rely,
346
+ x=x_offset + sx,
347
+ y=y_offset + sy,
348
+ anchor=anchor
349
+ )
350
+ self._watermark_widgets.append(shadow)
351
+
352
+ # Add main text
353
+ main = tk.Label(
354
+ window,
355
+ text=self.watermark_text,
356
+ fg=self.watermark_color,
357
+ bg=bg_color,
358
+ font=font
359
+ )
360
+ main.place(
361
+ relx=relx,
362
+ rely=rely,
363
+ x=x_offset,
364
+ y=y_offset,
365
+ anchor=anchor
366
+ )
367
+ self._watermark_widgets.append(main)
368
+
270
369
  def _apply_native_blur_to_window(self, window):
271
370
  """Apply OS-native backdrop blur effect to a specific window"""
272
371
  system = platform.system()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: screenoverlay
3
- Version: 0.6.3
3
+ Version: 0.6.4
4
4
  Summary: Cross-platform screen overlay with blur, black, white, and custom modes
5
5
  Home-page: https://github.com/pekay-ai/screenoverlay
6
6
  Author: ScreenStop
@@ -0,0 +1,7 @@
1
+ screenoverlay/__init__.py,sha256=GTalwUWdmfwwRKFOW-C1mNwmplaNi_fYkxsgW_JIMGs,261
2
+ screenoverlay/overlay.py,sha256=nJj0WDUOK-mSgf0EA8Wencir2LdF3PuER0bjr_lNl6s,21781
3
+ screenoverlay-0.6.4.dist-info/licenses/LICENSE,sha256=QlEjK4tuMjNEYVlvzaIhxfsCeU8hcGZyuT85cm1YChE,1084
4
+ screenoverlay-0.6.4.dist-info/METADATA,sha256=1AOLeynUVMtVN8JQZKzs3Kd79MNqUkrlGoLceTE53lM,17137
5
+ screenoverlay-0.6.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
+ screenoverlay-0.6.4.dist-info/top_level.txt,sha256=kfPL07o_kJ-mlb14Ps2zp_tIYnD8GfsSXlbDxDF6Eic,14
7
+ screenoverlay-0.6.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,7 +0,0 @@
1
- screenoverlay/__init__.py,sha256=eZSj1byFqiubxH88wAOZP2kPh8heDNs7kXv7sjpAvjg,261
2
- screenoverlay/overlay.py,sha256=OhzDHrbt2Lt4Zb9gii5DZW80SmhLG_2vB7nRt6GcI-g,17695
3
- screenoverlay-0.6.3.dist-info/licenses/LICENSE,sha256=QlEjK4tuMjNEYVlvzaIhxfsCeU8hcGZyuT85cm1YChE,1084
4
- screenoverlay-0.6.3.dist-info/METADATA,sha256=lbqdzCAcyZm58-Hv6hLN6uPlP8jlbbk5qLOue1EkPo4,17137
5
- screenoverlay-0.6.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- screenoverlay-0.6.3.dist-info/top_level.txt,sha256=kfPL07o_kJ-mlb14Ps2zp_tIYnD8GfsSXlbDxDF6Eic,14
7
- screenoverlay-0.6.3.dist-info/RECORD,,