Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions column_letters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
def index_to_column_letters(index: int) -> str:
"""Convert a 0-based column index to Excel-style letters (A, B, ..., Z, AA, AB, ...).

Args:
index: Zero-based column index (0 => 'A').

Returns:
The Excel-style column label as a string.

Raises:
ValueError: If index is negative.
"""
if not isinstance(index, int):
raise TypeError("index must be an int")
if index < 0:
raise ValueError("index must be non-negative")

# Excel-like base-26 with no zero digit: 0->A, 25->Z, 26->AA
result = []
n = index
while True:
n, rem = divmod(n, 26)
result.append(chr(ord('A') + rem))
if n == 0:
break
n -= 1 # Carry handling due to lack of zero digit in Excel columns
return ''.join(reversed(result))

13 changes: 12 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@
"workspace_files": [
"F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainWorking.txt",
"F:\\ProjectsNew\\Diablo2TextEditor\\CubeMainNotWorking.txt"
]
],
"enable_column_colors": true,
"column_color_overrides": {
"ladder": {
"bg": "#FFE0B2",
"fg": "#000000"
}
},
"custom_column_color_palette": [],
"show_column_letters_enabled": true,
"header_min_section_size": 130,
"high_contrast_column_text_enabled": true
}
}
4 changes: 4 additions & 0 deletions config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ def _load_config_unlocked(self):
settings.setdefault("crosshair_enabled", True)
settings.setdefault("crosshair_thickness", 1)
settings.setdefault("crosshair_hover_enabled", True)
# Column color feature configuration
settings.setdefault("enable_column_colors", True)
settings.setdefault("column_color_overrides", {})
settings.setdefault("custom_column_color_palette", [])
# Add the new setting for freezing the first row
#settings.setdefault("freeze_first_row_enabled", False)
config["settings"] = settings
Expand Down
Loading
Loading