mirror of
https://github.com/gryf/wmdocklib.git
synced 2025-12-18 12:00:20 +01:00
Fixed couple minor findings.
This commit is contained in:
@@ -117,14 +117,14 @@ def redraw_xy(x, y):
|
|||||||
pywmgeneral.redraw_window_xy(x, y)
|
pywmgeneral.redraw_window_xy(x, y)
|
||||||
|
|
||||||
|
|
||||||
def copy_xpm_area(sourceX, sourceY, width, height, targetX, targetY):
|
def copy_xpm_area(source_x, source_y, width, height, target_x, target_y):
|
||||||
"""Copy an area of the global XPM."""
|
"""Copy an area of the global XPM."""
|
||||||
(sourceX, sourceY, width, height, targetX,
|
(source_x, source_y, width, height, target_x,
|
||||||
targetY) = (int(sourceX), int(sourceY), int(width), int(height),
|
target_y) = (int(source_x), int(source_y), int(width), int(height),
|
||||||
int(targetX), int(targetY))
|
int(target_x), int(target_y))
|
||||||
if width > 0 or height > 0:
|
if width > 0 or height > 0:
|
||||||
pywmgeneral.copy_xpm_area(sourceX, sourceY, width, height,
|
pywmgeneral.copy_xpm_area(source_x, source_y, width, height,
|
||||||
targetX, targetY)
|
target_x, target_y)
|
||||||
|
|
||||||
|
|
||||||
def add_mouse_region(index, left, top, right=None, bottom=None, width=None,
|
def add_mouse_region(index, left, top, right=None, bottom=None, width=None,
|
||||||
@@ -167,16 +167,17 @@ def get_color_code(color_name):
|
|||||||
|
|
||||||
def get_unique_key(dict_to_check):
|
def get_unique_key(dict_to_check):
|
||||||
for char in range(40, 126):
|
for char in range(40, 126):
|
||||||
char = chr(char)
|
_char = chr(char)
|
||||||
if char not in dict_to_check:
|
if _char not in dict_to_check:
|
||||||
return char
|
return _char
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def normalize_color(color):
|
def normalize_color(color):
|
||||||
if color.startswith('#'):
|
if color.startswith('#'):
|
||||||
return color
|
return color
|
||||||
else:
|
|
||||||
return get_color_code(color)
|
return get_color_code(color)
|
||||||
|
|
||||||
|
|
||||||
def merge_palettes(pal1, pal2, bitmap_list):
|
def merge_palettes(pal1, pal2, bitmap_list):
|
||||||
@@ -226,10 +227,7 @@ def merge_palettes(pal1, pal2, bitmap_list):
|
|||||||
rerun = True
|
rerun = True
|
||||||
else:
|
else:
|
||||||
# color not found, add new replacement
|
# color not found, add new replacement
|
||||||
temp = []
|
bitmap_list = [x.replace(char, new_char) for x in bitmap_list]
|
||||||
for line in bitmap_list:
|
|
||||||
temp.append(line.replace(char, new_char))
|
|
||||||
bitmap_list = temp
|
|
||||||
elif char in pal1:
|
elif char in pal1:
|
||||||
# color not found, check if the char already exists in first
|
# color not found, check if the char already exists in first
|
||||||
# palette
|
# palette
|
||||||
|
|||||||
Reference in New Issue
Block a user