mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-03 17:59:33 +02:00
TextStyleCollection moved into ViewOptions
This commit is contained in:
parent
19206273d6
commit
8df6ffa064
5 changed files with 12 additions and 8 deletions
|
@ -64,7 +64,7 @@ public class PreferenceActivity extends ZLPreferenceActivity {
|
|||
final PageTurningOptions pageTurningOptions = new PageTurningOptions();
|
||||
final ImageOptions imageOptions = new ImageOptions();
|
||||
final ColorProfile profile = viewOptions.getColorProfile();
|
||||
final ZLTextStyleCollection collection = fbReader.TextStyleCollection;
|
||||
final ZLTextStyleCollection collection = viewOptions.getTextStyleCollection();
|
||||
final ZLKeyBindings keyBindings = new ZLKeyBindings();
|
||||
|
||||
final ZLAndroidLibrary androidLibrary = (ZLAndroidLibrary)ZLAndroidLibrary.Instance();
|
||||
|
|
|
@ -32,7 +32,7 @@ class ChangeFontSizeAction extends FBAction {
|
|||
@Override
|
||||
protected void run(Object ... params) {
|
||||
final ZLIntegerRangeOption option =
|
||||
Reader.TextStyleCollection.getBaseStyle().FontSizeOption;
|
||||
Reader.ViewOptions.getTextStyleCollection().getBaseStyle().FontSizeOption;
|
||||
option.setValue(option.getValue() + myDelta);
|
||||
Reader.clearTextCaches();
|
||||
Reader.getViewWidget().repaint();
|
||||
|
|
|
@ -30,15 +30,12 @@ import org.geometerplus.zlibrary.core.util.*;
|
|||
import org.geometerplus.zlibrary.text.hyphenation.ZLTextHyphenator;
|
||||
import org.geometerplus.zlibrary.text.model.ZLTextModel;
|
||||
import org.geometerplus.zlibrary.text.view.*;
|
||||
import org.geometerplus.zlibrary.text.view.style.ZLTextStyleCollection;
|
||||
|
||||
import org.geometerplus.fbreader.book.*;
|
||||
import org.geometerplus.fbreader.bookmodel.*;
|
||||
import org.geometerplus.fbreader.fbreader.options.*;
|
||||
|
||||
public final class FBReaderApp extends ZLApplication {
|
||||
public final ZLTextStyleCollection TextStyleCollection;
|
||||
|
||||
public final MiscOptions MiscOptions;
|
||||
public final ImageOptions ImageOptions;
|
||||
public final ViewOptions ViewOptions;
|
||||
|
@ -48,8 +45,6 @@ public final class FBReaderApp extends ZLApplication {
|
|||
private final ZLKeyBindings myBindings;
|
||||
|
||||
{
|
||||
TextStyleCollection = new ZLTextStyleCollection("Base");
|
||||
|
||||
MiscOptions = new MiscOptions();
|
||||
ImageOptions = new ImageOptions();
|
||||
ViewOptions = new ViewOptions();
|
||||
|
|
|
@ -340,7 +340,7 @@ public final class FBView extends ZLTextView {
|
|||
|
||||
@Override
|
||||
public ZLTextStyleCollection getTextStyleCollection() {
|
||||
return myReader.TextStyleCollection;
|
||||
return myReader.ViewOptions.getTextStyleCollection();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -21,6 +21,7 @@ package org.geometerplus.fbreader.fbreader.options;
|
|||
|
||||
import org.geometerplus.zlibrary.core.library.ZLibrary;
|
||||
import org.geometerplus.zlibrary.core.options.*;
|
||||
import org.geometerplus.zlibrary.text.view.style.ZLTextStyleCollection;
|
||||
|
||||
import org.geometerplus.fbreader.fbreader.FBView;
|
||||
|
||||
|
@ -36,6 +37,7 @@ public class ViewOptions {
|
|||
public final ZLStringOption ColorProfileName;
|
||||
|
||||
private ColorProfile myColorProfile;
|
||||
private ZLTextStyleCollection myTextStyleCollection;
|
||||
|
||||
public ViewOptions() {
|
||||
final ZLibrary zlibrary = ZLibrary.Instance();
|
||||
|
@ -72,4 +74,11 @@ public class ViewOptions {
|
|||
}
|
||||
return myColorProfile;
|
||||
}
|
||||
|
||||
public ZLTextStyleCollection getTextStyleCollection() {
|
||||
if (myTextStyleCollection == null) {
|
||||
myTextStyleCollection = new ZLTextStyleCollection("Base");
|
||||
}
|
||||
return myTextStyleCollection;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue