Commit graph

34 commits

Author SHA1 Message Date
Thomas Goyne
85a820918f Fix a crash when opening a new file when the grid is not scrolled to the top 2015-09-13 18:49:46 +02:00
Thomas Goyne
2269dbcfe0 Reuse previously calculated string widths 2015-02-07 14:56:48 -08:00
Thomas Goyne
8c1b20e651 Speed up grid painting with many unique effects/actors a bit 2015-02-01 20:09:35 -08:00
Thomas Goyne
6159f1587d Update wx
Removes the need for the RTL hacks in BaseGrid as the bugs have been
fixed properly in wx.
2014-08-23 15:56:32 -07:00
Thomas Goyne
62c28ce0d3 Avoid pointless repaints of the grid when seeking video
Keep track of which lines are displayed on the current video frame so
that video seeks only have to repaint the grid when the set actually
changes. Speeds up video playback on non-fbf stuff by ~15%.
2014-06-12 17:06:25 -07:00
Thomas Goyne
2508dd9c6e Only scroll the grid to the active line if the row has actually changed
Makes it so that undo/redo only scrolls to the active line if it's
different in the two versions of the file.
2014-06-12 17:06:25 -07:00
Thomas Goyne
e061ac8755 Pull even more of the subs load logic into Project
The relative order of the on-file-load logic matters, so signals don't
work very well for it. Doing it all explicitly in Project fixes a bunch
of inconsistent issues related to restoring saved state.

Closes #1759.
2014-06-02 13:02:06 -07:00
Thomas Goyne
09e325a1c3 Clean up unused includes 2014-05-23 07:28:24 -07:00
Thomas Goyne
9c7119fdc2 Redesign how project metadata is stored in the file
Remove it from the script info section and put it in its own section
that isn't tracked by undo and make it not stringly typed. Removes the
need for the gross hack where changes are slipped in just before saving
to circumvent the undo system, cuts down on the uses of string literals
to identify fields, and probably improves performance a little.
2014-05-22 09:29:15 -07:00
Thomas Goyne
19e8f19e52 Redesign project file handling
Add a new Project class which is responsible for everything related to
opening and closing audio, video, subtitles, timecodes and keyframes.
This pulls almost everything not directly related to playing audio/video
out of the audio and video controllers, pulls more crap out of
FrameMain, and happens to make things a little simpler in the process.
2014-05-22 09:29:12 -07:00
Thomas Goyne
164ad33753 Fix RTL painting of the subtitles grid
wx comes very close to just making it work automatically, but it doesn't
translate the origin to the top-right corner and wxBufferedPaintDC
doesn't handle RTL at all, so reimplement it with some hacks.

Closes #1354.
2014-05-12 08:04:24 -07:00
Thomas Goyne
1bd3572054 Make the CPS warning thresholds and color customizable 2014-04-21 11:11:40 -07:00
Thomas Goyne
543034b96b Change the background color of the CPS column when the value is excessively high 2014-04-21 11:11:40 -07:00
Thomas Goyne
a1a289c4c0 Push more of the painting logic into the grid column classes 2014-04-21 11:11:40 -07:00
Thomas Goyne
6e0160d730 Fix ugly extra grid line drawn when the first row is selected 2014-04-20 19:46:03 -07:00
Thomas Goyne
5646c05be7 Draw the active line box on top of the grid columns 2014-04-20 19:39:48 -07:00
Thomas Goyne
f14cef7321 Remove pointless vertical alignment logic
The only time it has an effect is when font substitution occurs, and the
end result tends to be worse than doing nothing at all.
2014-04-20 19:32:39 -07:00
Thomas Goyne
2387b31cee Rearrange BaseGrid's data members 2014-04-20 07:01:49 -07:00
Thomas Goyne
c3e024954c Make frame mode handling in grid columns a little less ugly 2014-04-20 07:01:48 -07:00
Thomas Goyne
bd53302907 Remove unused variable 2014-04-18 14:28:55 -07:00
Thomas Goyne
5df871f599 Extract all of the column-specific logic from BaseGrid 2014-04-18 12:17:03 -07:00
Thomas Goyne
909be4494a Use a struct for the cached grid brushes rather than an array+enum 2014-04-18 07:17:38 -07:00
Thomas Goyne
d5274b72d4 Cap CPS column at 999 2014-04-18 07:07:03 -07:00
Thomas Goyne
867eaae7a8 Add basic characters-per-second column to the grid 2014-04-17 19:11:35 -07:00
Thomas Goyne
c93d38cc34 Clean up BaseGrid a little
Eliminate the hardcoded uses of 11 all over the place and cache the
calculation of the header widths.
2014-04-17 18:08:03 -07:00
Thomas Goyne
1d5292fdee Kill config.h and just force-include acconf.h in non-pch builds 2014-04-16 08:11:37 -07:00
Thomas Goyne
c59b9d59b8 Clean up OptionValue
Make the vtables less absurdly huge (knocks 100KB off aegisub32.exe),
eliminate some copies of the values when constructing the options, and
use an enum class for the value type.
2014-03-31 10:23:36 -07:00
Thomas Goyne
3bbbc56053 Add the line's row number to AssDialogue
The grid needs to be able to map AssDialogue * to a row number, and just
storing it in the AssDialogue is nearly strictly better than a std::map
mapping events to rows. Probably will be of use elsewhere as well.
2014-03-31 08:11:43 -07:00
Thomas Goyne
f07a2559b8 Update the grid scrollbar after dialogue count changes 2014-03-27 18:49:16 -07:00
Thomas Goyne
523d858374 Extract SelectionController from BaseGrid 2014-03-25 17:06:47 -07:00
Thomas Goyne
ab39cfe362 Replace rref + const ref overloads with one version taking by value 2014-03-12 18:02:17 -07:00
Thomas Goyne
26c92453b8 Slather on some std::moves when setting the selection 2014-03-12 15:20:37 -07:00
Thomas Goyne
7c2363ee5b Add rref overloads to SetSelectedSet and SetSelectionAndActive 2014-03-12 15:20:34 -07:00
Thomas Goyne
33a4a056a4 Move everything up a level since the root dir no longer has stuff 2014-03-11 12:14:57 -07:00
Renamed from aegisub/src/base_grid.cpp (Browse further)