Layer and margin columns are no longer shown if all lines have default values for those.

Originally committed to SVN as r1338.
This commit is contained in:
Rodrigo Braz Monteiro 2007-07-03 01:48:04 +00:00
parent 79e3e49cf4
commit 075bb0184c
2 changed files with 15 additions and 5 deletions

View File

@ -769,6 +769,9 @@ void BaseGrid::SetColumnWidths() {
}
// O(n) widths
bool showMargin[3];
showMargin[0] = showMargin[1] = showMargin[2] = false;
bool showLayer = false;
int styleLen = 0;
int actorLen = 0;
int effectLen = 0;
@ -780,7 +783,10 @@ void BaseGrid::SetColumnWidths() {
curDiag = GetDialogue(i);
if (curDiag) {
// Layer
if (curDiag->Layer > maxLayer) maxLayer = curDiag->Layer;
if (curDiag->Layer > maxLayer) {
maxLayer = curDiag->Layer;
showLayer = true;
}
// Actor
if (!curDiag->Actor.IsEmpty()) {
@ -800,6 +806,11 @@ void BaseGrid::SetColumnWidths() {
if (fw > effectLen) effectLen = fw;
}
// Margins
for (int j=0;j<3;j++) {
if (curDiag->Margin[j] != 0) showMargin[j] = true;
}
// Times
if (byFrame) {
int tmp = VFR_Output.GetFrameAtTime(curDiag->Start.GetMS(),true);
@ -841,15 +852,13 @@ void BaseGrid::SetColumnWidths() {
// Set column widths
colWidth[0] = labelLen;
colWidth[1] = layerLen;
colWidth[1] = showLayer ? layerLen : 0;
colWidth[2] = startLen;
colWidth[3] = endLen;
colWidth[4] = styleLen;
colWidth[5] = actorLen;
colWidth[6] = effectLen;
colWidth[7] = marginLen;
colWidth[8] = marginLen;
colWidth[9] = marginLen;
for (int i=0;i<3;i++) colWidth[i+7] = showMargin[i] ? marginLen : 0;
// Hide columns
for (int i=0;i<10;i++) {

View File

@ -104,6 +104,7 @@ Please visit http://aegisub.net to download latest version
o Added Paste Over function, which allows you to paste subtitle lines over others, overwriting the fields of your choice. (AMZ)
o Scrollbar in grid didn't always allow scrolling through all the subs. (jfs)
o Minor fix to the calculation of the grid's "Style" column width. (AMZ)
o Layer and margin columns are no longer shown if all lines have default values for those. (AMZ)
- Subtitles edit box changes:
o The whole layout has been tweaked. (AMZ)
o Replaced wxTextCtrl with wxStyledTextCtrl, to solve many issues related to the Rich Text edit control. (AMZ)