screenoverlay 0.6.3__tar.gz → 0.6.4__tar.gz
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-0.6.3 → screenoverlay-0.6.4}/PKG-INFO +1 -1
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/screenoverlay/__init__.py +1 -1
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/screenoverlay/overlay.py +100 -1
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/screenoverlay.egg-info/PKG-INFO +1 -1
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/setup.py +1 -1
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/LICENSE +0 -0
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/README.md +0 -0
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/screenoverlay.egg-info/SOURCES.txt +0 -0
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/screenoverlay.egg-info/dependency_links.txt +0 -0
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/screenoverlay.egg-info/requires.txt +0 -0
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/screenoverlay.egg-info/top_level.txt +0 -0
- {screenoverlay-0.6.3 → screenoverlay-0.6.4}/setup.cfg +0 -0
|
@@ -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()
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name="screenoverlay",
|
|
8
|
-
version="0.6.
|
|
8
|
+
version="0.6.4",
|
|
9
9
|
author="ScreenStop",
|
|
10
10
|
author_email="ppnicky@gmail.com",
|
|
11
11
|
description="Cross-platform screen overlay with blur, black, white, and custom modes",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|