视图选项

ViewOptions.java
TwoColumnView = new ZLBooleanOption("Options", "TwoColumnView", x * x + y * y >= 42 * dpi * dpi);
LeftMargin = new ZLIntegerRangeOption("Options", "LeftMargin", 0, 100, horMargin);
RightMargin = new ZLIntegerRangeOption("Options", "RightMargin", 0, 100, horMargin);
TopMargin = new ZLIntegerRangeOption("Options", "TopMargin", 0, 100, 66);
BottomMargin = new ZLIntegerRangeOption("Options", "BottomMargin", 0, 100, 66);
SpaceBetweenColumns = new ZLIntegerRangeOption("Options", "SpaceBetweenColumns", 0, 300, 3 * horMargin);
ScrollbarType = new ZLIntegerRangeOption("Options", "ScrollbarType", 0, 4, FBView.SCROLLBAR_SHOW_AS_FOOTER);
FooterHeight = new ZLIntegerRangeOption("Options", "FooterHeight", 8, dpi / 8, dpi / 10);
ColorProfileName = new ZLStringOption("Options", "ColorProfile", ColorProfile.DAY);
ColorProfileName.setSpecialName("colorProfile");

ViewOptions 是阅读器暴露的配置接口,这里的参数值会直接被程序使用。例如:TopMargin、BottomMargin 会最终被 ZLTextViewBase 类使用,进而影响到文字绘制区域的大小。

ZLTextViewBase.java
int getTextAreaHeight() {
	return getContextHeight() - getTopMargin() - getBottomMargin();
}

Last updated

Was this helpful?