Skip to content

Commit 832d502

Browse files
committed
Stop showing color mode if startupscreen is disabled. Stop cropping left column in ansi export. Show theme as "default" if notheme is set.
1 parent e628edd commit 832d502

File tree

5 files changed

+18
-13
lines changed

5 files changed

+18
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Durdraw
55
_| |__ __ _____ __| |_____ _____ __ __ __
66
/ _ | | | __| _ | __| _ | | | |\
77
/_____|_____|__|__|_____|__|___\____|________| |
8-
\_____________________________________________\| v 0.21.0
8+
\_____________________________________________\| v 0.21.1
99

1010

1111
![Durdraw-0 20-demo](https://github.com/cmang/durdraw/assets/261501/ce539865-2e84-4423-92af-cd9ddeeb02ce)

durdraw/durdraw_appstate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class AppState():
1313
""" run-time app state, separate from movie options (Options()) """
1414
def __init__(self): # User friendly defeaults
1515
self.quickStart = False
16+
self.showStartupScreen = True
1617
self.curOpenFileName = ""
1718
self.colorMode = "256" # or 16, or possibly "none" or "true" or "rgb" (24 bit rgb "truecolor")
1819
self.totalFgColors = "128"
@@ -48,12 +49,11 @@ def __init__(self): # User friendly defeaults
4849
self.durhelp16_fullpath = None
4950
self.durhelp16_page2_fullpath = None
5051
self.showBgColorPicker = False # until BG colors work in 256 color mode. (ncurses 5 color pair limits)
51-
5252
# This doesn't work yet (color pairs past 256 colors. They set, but the background color doesn't get set.
5353
#if sys.version_info >= (3, 10):
5454
# if curses.has_extended_color_support(): # Requires Ncures 6
5555
# self.showBgColorPicker = True # until BG colors work in 256 color mode. (ncurses 5 color pair limits)
56-
56+
self.topLine = 0 # the top line visible on the screen, used in refresh() for scrolling
5757
self.drawBorders = True
5858
self.durFileVer = 0 # gets set in main() from DUR_FILE_VER
5959
self.themesEnabled = True

durdraw/durdraw_ui_curses.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ def __init__(self, app):
8383
#time.sleep(2)
8484
if self.appState.colorMode == "16":
8585
self.ansi.initColorPairs_cga()
86-
if not app.quickStart:
86+
if not app.quickStart and app.showStartupScreen:
8787
print(f"Color mode: {self.appState.colorMode}")
8888
time.sleep(2)
8989
#if self.appState.colorMode == "16":
@@ -2513,7 +2513,8 @@ def saveAnsiFile(self, filename, lastLineNum=False, lastColNum=False, firstColNu
25132513
if not lastColNum:
25142514
lastColNum = self.findFrameLastCol(self.mov.currentFrame)
25152515
if not firstColNum:
2516-
firstColNum = self.findFrameFirstCol(self.mov.currentFrame)
2516+
#firstColNum = self.findFrameFirstCol(self.mov.currentFrame)
2517+
firstColNum = 0 # Don't crop leftmost blank columns
25172518
if not firstLineNum:
25182519
firstLineNum = self.findFrameFirstLine(self.mov.currentFrame)
25192520
#for lineNum in range(0, lastLineNum): # y == lines
@@ -2797,7 +2798,8 @@ def hardRefresh(self):
27972798

27982799
def refresh(self): # rename to redraw()?
27992800
"""Refresh the screen"""
2800-
linenum = 0
2801+
#linenum = 0
2802+
linenum = self.appState.topLine
28012803
if self.appState.playingHelpScreen_2:
28022804
mov = self.appState.helpMov_2
28032805
elif self.appState.playingHelpScreen:

durdraw/main.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def undosize(size_s):
2626
raise argparse.ArgumentTypeError("Undo size must be between 1 and 1000.")
2727

2828
def main():
29-
DUR_VER = '0.21.0'
29+
DUR_VER = '0.21.1'
3030
DUR_FILE_VER = 7
3131
DEBUG_MODE = False # debug = makes debug_write available, sends more notifications
3232
durlogo = '''
@@ -82,7 +82,7 @@ def main():
8282
app.setDebug(True)
8383
if args.undosize:
8484
app.undoHistorySize = int(args.undosize[0])
85-
showStartupScreen=True
85+
app.showStartupScreen=True
8686

8787

8888
term_size = os.get_terminal_size()
@@ -102,9 +102,9 @@ def main():
102102
if term_size[1] > 24:
103103
app.height = term_size[1] - 2
104104
if args.play:
105-
showStartupScreen=False
105+
app.showStartupScreen=False
106106
elif args.quick:
107-
showStartupScreen=False
107+
app.showStartupScreen=False
108108
app.quickStart = True
109109
if args.nomouse:
110110
app.hasMouse = False
@@ -155,7 +155,7 @@ def main():
155155
durhelp_fullpath = 'durdraw/help/durhelp.dur'
156156
app.loadHelpFile(durhelp_fullpath)
157157

158-
if showStartupScreen:
158+
if app.showStartupScreen:
159159
print(durlogo)
160160
if app.hasHelpFile:
161161
print(f"Help file: Found in {durhelp_fullpath}")
@@ -178,7 +178,10 @@ def main():
178178
else:
179179
print(f"Configuration file not found.")
180180

181-
print(f"Theme: {app.themeName}")
181+
if app.themesEnabled:
182+
print(f"Theme: {app.themeName}")
183+
else:
184+
print(f"Theme: Default (none)")
182185

183186
print("Undo history size = %d" % app.undoHistorySize)
184187
if app.width == 80 and app.height == 24:

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
setup(
88
name='durdraw',
9-
version='0.21.0',
9+
version='0.21.1',
1010
author='Sam Foster',
1111
author_email='samfoster@gmail.com',
1212
description='Animated Color ASCII and Unicode Art Editor',

0 commit comments

Comments
 (0)